Re: date format

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Marc Millas <marc(dot)millas(at)mokadb(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: date format
Date: 2023-06-14 17:27:01
Message-ID: CAKFQuwa6mQaHigAZpcwTTA5RTTnB3yZfpJZnriJdbVDHOK5Eeg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jun 14, 2023 at 9:42 AM Marc Millas <marc(dot)millas(at)mokadb(dot)com> 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 so
> asking for a normalization may take ages.
>
> obviously I could load as char and then apply an appropriate
> transformation. no pb.
> But is there a direct way to do this ?
>

Probably no - casting formats via locale cannot be specified at that scope
when using copy. Either the cast for a given single setting produces the
correct result or it doesn't. If you need a custom cast like this you have
to get away from COPY first. Usually that is best done after importing
data to a temporary table as text.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc Millas 2023-06-14 18:02:01 Re: date format
Previous Message Michael Nolan 2023-06-14 17:05:00 Re: date format