Re: copy command - date - Mailing list pgsql-general

From Scott Marlowe
Subject Re: copy command - date
Date
Msg-id dcc563d10708130733n1d5272c9ua83daedd68760c90@mail.gmail.com
Whole thread Raw
In response to Re: copy command - date  (novice <user.postgresql@gmail.com>)
List pgsql-general
On 8/12/07, novice <user.postgresql@gmail.com> wrote:
> I resolved it by doing this - is there another more efficient method?
> And yes, the text file I am working with doesn't have any TABs
>
> 5162   OK           SM 06/12/04 06:12
>
> substr("data", 30, 2)||'-'||substr("data", 27,
> 2)||'-20'||substr("data", 24, 2)||substr("data", 32, 6) as
> inspection_date

I didn't have to do anything special, just copied it in:

create table g (ts timestamp);
set datestyle=ISO, MDY;
copy g (ts) from stdin;
06/12/04 12:00:00
\.
select * from g;
         ts
---------------------
 2004-06-12 12:00:00
delete from g;
set datestyle=ISO, DMY;
copy g (ts) from stdin;
06/12/04 12:00:00
\.
 select * from g;
         ts
---------------------
 2004-12-06 12:00:00

pgsql-general by date:

Previous
From: "Terri Reid"
Date:
Subject: non superuser creating flat files
Next
From: "Scott Marlowe"
Date:
Subject: Re: Persistent connections in PHP