Re: Can LC_TIME affect timestamp input?

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Can LC_TIME affect timestamp input?
Date: 2013-01-27 03:00:20
Message-ID: ke2584$65m$1@gonzo.reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2013-01-25, Paul Jones <pbj(at)cmicdo(dot)com> wrote:
> Is it possible for LC_TIME locale to affect the format with which
> timestamps are input?

> I have DB2 CSV dumps with timestamps like '2003-10-21-22.59.44.000000'

All the non-digit symbols between "21" and the "44" look unusual

> that I want to load into Postgres with \copy.  I would like to eliminate
> the sed scripts that convert the timestamps in order to speed up the load.

> (I know I could stage it through a temp table and use to_timestamp()
> but that requires a temp table for each real table, which is not viable
> w.r.t. our project goals).

could you use a text column and then do alter table?

> I created a special locale with the DB2 timestamp format defined and did
>
>         set lc_time='en_DB.UTF-8';

what's "DB" ?

> It didn't affect anything, in or out with Postgres.  I know the locale
> works because date(1) displays the DB2 format correctly.

That feels like a bug somewhere

AIUI date uses strftime("%c",...
and strftime() doesn't support fractional seconds, so postgres can't
use it.
.

--
⚂⚃ 100% natural

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2013-01-27 03:17:45 Re: Cast double precision to integer & check for overflow
Previous Message Tim Uckun 2013-01-27 00:55:05 Re: Running update in chunks?