0

I'm trying to use PgAdmin 4 to import some data from a csv file into a table. The following error is being returned for a column named "Event_Date"

ERROR:  date/time field value out of range: "26/04/2017 21:10:00"
HINT:  Perhaps you need a different "datestyle" setting.

"Event_Date" is formatted as "timestamp (6) without time zone". What is the proper format that should be used for this type of date? Also, the date part of the "Event_Date" variable is in DMY, not MDY. Could that be causing problems? Thanks!

natnay
  • 460
  • 1
  • 5
  • 24
  • Possible duplicate of [How to change datestyle in PostgreSQL?](https://stackoverflow.com/questions/13244460/how-to-change-datestyle-in-postgresql) – Harry Oct 23 '17 at 21:09

1 Answers1

0

Yes, just type SET datestyle in the same session you're issuing COPY:

SET datestyle = 'DMY';
SELECT '26/04/2017 21:10:00'::TIMESTAMP;

More info here.

Michel Milezzi
  • 10,087
  • 3
  • 21
  • 36