Re: [GENERAL] copy command - date

2007-08-17 Thread Raj A
Thanks again guys =) I've managed to use temp table to load the data and create new table/s Now, how do I convert a text field with 'YY/MM/DD' to date field 'DD/MM/YY'? On 13/08/07, Tom Lane <[EMAIL PROTECTED]> wrote: > Paul Lambert <[EMAIL PROTECTED]> writes: > >> novice wrote: > >>> db5=> \copy

Re: [GENERAL] copy command - date

2007-08-13 Thread Scott Marlowe
On 8/12/07, novice <[EMAIL PROTECTED]> 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("da

Re: [GENERAL] copy command - date

2007-08-12 Thread Tino Wildenhain
novice schrieb: 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 in

Re: [GENERAL] copy command - date

2007-08-12 Thread novice
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 On

Re: [GENERAL] copy command - date

2007-08-12 Thread novice
Thanks again guys =) I've managed to use temp table to load the data and create new table/s Now, how do I convert a text field with 'YY/MM/DD' to date field 'DD/MM/YY'? On 13/08/07, Tom Lane <[EMAIL PROTECTED]> wrote: > Paul Lambert <[EMAIL PROTECTED]> writes: > >> novice wrote: > >>> db5=> \copy

Re: [GENERAL] copy command - date

2007-08-12 Thread Tom Lane
Paul Lambert <[EMAIL PROTECTED]> writes: >> novice wrote: >>> db5=> \copy maintenance FROM test.txt > I don't think copy allows you to leave columns out of your input file - > even if they belong to a sequence. Well, it does, but you have to specify which ones are being provided, eg \copy tab(c

Re: [GENERAL] copy command - date

2007-08-12 Thread novice
Thank you! That was exactly what I was looking for =) On 13/08/07, Paul Lambert <[EMAIL PROTECTED]> wrote: > Paul Lambert wrote: > > novice wrote: > >> I'm using pg version 8.2.4. What is the best method to load this data? > >> I have just a little over 55,000 entries. > >> > >> db5=> \copy mai

Re: [GENERAL] copy command - date

2007-08-12 Thread Paul Lambert
Paul Lambert wrote: novice wrote: I'm using pg version 8.2.4. What is the best method to load this data? I have just a little over 55,000 entries. db5=> \copy maintenance FROM test.txt ERROR: invalid input syntax for integer: "3665 OK SM 07/07/13 06:09" CONTEXT: COPY maintenance

Re: [GENERAL] copy command - date

2007-08-12 Thread Michael Glaesemann
On Aug 12, 2007, at 20:49 , novice wrote: I'm using pg version 8.2.4. What is the best method to load this data? I have just a little over 55,000 entries. db5=> \copy maintenance FROM test.txt ERROR: invalid input syntax for integer: "3665 OK SM 07/07/13 06:09" CONTEXT: COPY

Re: [GENERAL] copy command - date

2007-08-12 Thread Paul Lambert
novice wrote: I'm using pg version 8.2.4. What is the best method to load this data? I have just a little over 55,000 entries. db5=> \copy maintenance FROM test.txt ERROR: invalid input syntax for integer: "3665 OK SM 07/07/13 06:09" CONTEXT: COPY maintenance, line 1, column main

Re: [GENERAL] copy command - date

2007-08-12 Thread Tom Lane
novice <[EMAIL PROTECTED]> writes: > db5=> \copy maintenance FROM test.txt > ERROR: invalid input syntax for integer: "3665 OK SM > 07/07/13 06:09" > CONTEXT: COPY maintenance, line 1, column maintenance_id: "3665 OK > SM 07/07/13 06:09" It looks to me like your problem i

Re: [GENERAL] copy command - date

2007-08-12 Thread novice
I'm using pg version 8.2.4. What is the best method to load this data? I have just a little over 55,000 entries. db5=> \copy maintenance FROM test.txt ERROR: invalid input syntax for integer: "3665 OK SM 07/07/13 06:09" CONTEXT: COPY maintenance, line 1, column maintenance_id: "366

Re: [GENERAL] copy command - date

2007-08-12 Thread Tom Lane
novice <[EMAIL PROTECTED]> writes: > I'm having trouble loading the date field. Should I convert it first > or should I be using a text processor before loading the data in? > 3665 OK SM 07/07/13 06:09 > 5162 OK SM 07/02/12 06:10 > 3665 OK SM 07/06/19 06:10 Wh

[GENERAL] copy command - date

2007-08-12 Thread novice
What is the best method to load the following? I'm having trouble loading the date field. Should I convert it first or should I be using a text processor before loading the data in? 3665 OK SM 07/07/13 06:09 5162 OK SM 07/02/12 06:10 3665 OK SM 07/06/19 06:10