Re: date format

2023-06-14 Thread Laurenz Albe
On Wed, 2023-06-14 at 20:02 +0200, Marc Millas wrote: > So, creating a foreign table with varchar type, and then doing the insert as > select with the appropriate format.. clear. > somewhat sad as it was a one step process with the former oracle db we get > rid off. It can be a one-step process,

Re: date format

2023-06-14 Thread Adrian Klaver
On 6/14/23 11:23, Marc Millas wrote: Sort of like?: https://pgloader.readthedocs.io/en/latest/ref/csv.html date format column-name [date format '-MM-DD HH24-MI-SS.US'] In Postgresql, could you write a simple anonymous procedure that reads the file_fdw table rec

Re: date format

2023-06-14 Thread Marc Millas
On Wed, Jun 14, 2023 at 8:23 PM Marc Millas wrote: > > > > > On Wed, Jun 14, 2023 at 8:15 PM Ron wrote: > >> On 6/14/23 13:02, Marc Millas wrote: >> >> >> On Wed, Jun 14, 2023 at 7:27 PM David G. Johnston < >> david.g.johns...@gmail.com> wrote: >> >>> On Wed, Jun 14, 2023 at 9:42 AM Marc Millas

Re: date format

2023-06-14 Thread Marc Millas
On Wed, Jun 14, 2023 at 8:15 PM Ron wrote: > On 6/14/23 13:02, Marc Millas wrote: > > > On Wed, Jun 14, 2023 at 7:27 PM David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Wed, Jun 14, 2023 at 9:42 AM Marc Millas >> wrote: >> >>> Hi, >>> >>> I would like to load data from a file via

Re: date format

2023-06-14 Thread Ron
On 6/14/23 13:02, Marc Millas wrote: On Wed, Jun 14, 2023 at 7:27 PM David G. Johnston wrote: On Wed, Jun 14, 2023 at 9:42 AM Marc Millas wrote: Hi, I would like to load data from a file via file_fdw or COPY.. its a postgres 14 cluster but.. One da

Re: date format

2023-06-14 Thread Marc Millas
On Wed, Jun 14, 2023 at 7:27 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, Jun 14, 2023 at 9:42 AM Marc Millas > wrote: > >> Hi, >> >> I would like to load data from a file via file_fdw or COPY.. its a >> postgres 14 cluster >> >> but.. One date (timestamp) column is written

Re: date format

2023-06-14 Thread David G. Johnston
On Wed, Jun 14, 2023 at 9:42 AM Marc Millas wrote: > Hi, > > I would like to load data from a file via file_fdw or COPY.. its a > postgres 14 cluster > > but.. One date (timestamp) column is written french order and another > column is written english order. Data comes from a state owned entity s

Re: date format

2023-06-14 Thread Michael Nolan
Can you use a CASE statement? The real issue with date conversion is not knowing if a value of 02-03-2023 is mm-dd- or dd-mm-. On Wed, Jun 14, 2023 at 11:42 AM Marc Millas wrote: > > Hi, > > I would like to load data from a file via file_fdw or COPY.. its a postgres > 14 cluster > > but

date format

2023-06-14 Thread Marc Millas
Hi, I would like to load data from a file via file_fdw or COPY.. its a postgres 14 cluster but.. One date (timestamp) column is written french order and another column is written english order. Data comes from a state owned entity so asking for a normalization may take ages. obviously I could lo

Re: Date Format 9999-12-31-00.00.00.000000

2020-10-16 Thread Laurenz Albe
On Thu, 2020-10-15 at 20:58 +, Dirk Krautschick wrote: > because of a migration from DB2 we have a lot of timestamps like > > -12-31-00.00.00.00 > > What would be the best way to handle this in Postgres also related > to overhead and performance (index usage?). > > Or is > > TO_TIM

Re: Date Format 9999-12-31-00.00.00.000000

2020-10-15 Thread Kyotaro Horiguchi
At Thu, 15 Oct 2020 17:59:39 -0700, Adrian Klaver wrote in > On 10/15/20 1:58 PM, Dirk Krautschick wrote: > > Hi, > > because of a migration from DB2 we have a lot of timestamps like > > -12-31-00.00.00.00 > > I'm assuming these got stored in a varchar field? It seems like an (old-styl

Re: Date Format 9999-12-31-00.00.00.000000

2020-10-15 Thread Adrian Klaver
On 10/15/20 1:58 PM, Dirk Krautschick wrote: Hi, because of a migration from DB2 we have a lot of timestamps like -12-31-00.00.00.00 I'm assuming these got stored in a varchar field? What would be the best way to handle this in Postgres also related to overhead and performance (ind

Date Format 9999-12-31-00.00.00.000000

2020-10-15 Thread Dirk Krautschick
Hi, because of a migration from DB2 we have a lot of timestamps like -12-31-00.00.00.00 What would be the best way to handle this in Postgres also related to overhead and performance (index usage?). Or is TO_TIMESTAMP('-12-31-00.00.00.00', '-MM-DD-HH24.MI.SS.US') the only