Día de la semana Postgresql
select extract(dow from date '2016-12-18'); /* sunday */
Black Buffalo
select extract(dow from date '2016-12-18'); /* sunday */
SELECT date_part('day', TIMESTAMP '2001-02-16 20:38:40');
Result: 16
SELECT date_part('hour', INTERVAL '4 hours 3 minutes');
Result: 4
select to_char(current_date, 'IYYY-IW');