Re: [GENERAL] :) Import file2table Question

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: Korapat Charukumnerdkanok <korapat(dot)c(at)cdg(dot)co(dot)th>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] :) Import file2table Question
Date: 1998-07-06 10:12:16
Message-ID: 199807061112.MAA07933@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Korapat Charukumnerdkanok wrote:
>1 -How can I import a text file into Postgres table ?
> (append to the last row)
>
> -What is the format of that text file ?
>
>This is what I've done and its result....
>
>ProjDB=> copy PrjTB from /prj_data/test.txt using delimiters ,
>ProjDB-> ;
>ERROR: parser: syntax error at or near "/"

COPY ? Copies data between files and tables.

COPY [BINARY] table [WITH OIDS]
TO|FROM 'filename'|stdin|stdout
[USING DELIMITERS 'delimiter']

Therefore:

copy PrjTB from '/prj_data/test.txt' using delimiters ',';

I don't know the answer to your second question.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP key from public servers; key ID 32B8FAA1
========================================
"Ask, and it shall be given you; seek, and ye shall
find; knock, and it shall be opened unto you."
Matthew 7:7

Browse pgsql-general by date

  From Date Subject
Next Message Goran Thyni 1998-07-06 11:40:35 Re: [GENERAL] difference in INDEX's
Previous Message Roman Volkoff 1998-07-06 10:10:55 unsubscribe