The date format is not the same as the database.
By default, the format is YYYY-MM-DD HH: MM: SS
You can change the date format of the section with the command:
SET datestyle TO (format);
follows list of formats below:
- MDY | month-day-year | 12/16/2011
- DMY | day-month-year | 12/16/2011
- YMD | year-month-day | 2011-12-16
- ISO | ISO 8601 / SQL standard (default) | 2011-12-16 07: 37: 16-08
- POSTGRES | verbose style | Fri Dec 16 07:37:16 2012 PST
- SQL | traditional style | 12/16/2011 07:37:16 PST
- GERMAN | regional style | 16.12.2011 07:37:16 PST
To use the SQL option, you must enter the month and day order.
Ex:
- SQL, DMY | day / month / year | 12/17/2007 3:37:16 PM CET
- SQL, MDY | month / day / year | 12/17/2007 07:37:16 PST
To insert data with the date in Brazilian format, simply run the select below before performing COPY:
// This will change the format of the date only for this session.
SET datestyle TO (SQL, MDY);