dimitri / pgloader

Migrate to PostgreSQL in a single command!
http://pgloader.io
Other
5.45k stars 548 forks source link

Date Issue - When Month Name is given #842

Closed NoelJoseph94 closed 6 years ago

NoelJoseph94 commented 6 years ago

Hi,

When a timestamp/date field has data with the month name explicitly specified, the data is being auto converted to the month value in number . Eg: When the data file has value 'May 20 2018' , the target table is populated as 05-20-2018.

Consider the scenario:

--Sample load file:

image

--Sample Data File image

--During pgloader run got the following output image

-- The target table data (obtained output): image

--The required output in the target table:

1919 May 21 12:00:21.213

Can you please suggest a way this can be achieved.

dimitri commented 6 years ago

The data is correct. The formatting is not a problem for pgloader once the correct data is found in the target database. Please read the PostgreSQL documentation about date formatting, such as https://www.postgresql.org/docs/current/functions-formatting.html and https://www.postgresql.org/docs/current/datatype-datetime.html ; and https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-DATESTYLE too.