pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
About COPY
3+ messages / 3 participants
[nested] [flat]

* About COPY
@ 2003-02-25 14:07 Andrés Repossi <andres.repossi@c1.pjn.gov.ar>
  2003-02-25 15:09 ` Re: About COPY Robert Treat <xzilla@users.sourceforge.net>
  2003-02-25 15:28 ` Re: About COPY Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 3+ messages in thread

From: Andrés Repossi @ 2003-02-25 14:07 UTC (permalink / raw)
  To: pgsql-admin

Hi, I'm new working with PostgreSQL, and I'm trying to load an ascii text file to a table using the command copy but it throws me an error message that it can't parse the line, and I don't really don't know why is this hapening.

The sentence I'm using is:  

copy tfal from 'C:\\tfal.txt' with delimiter '|'

Te error message is: ERROR: parser: parse error at or near "delimiter"

The tfal.txt has only one row, and the format of the row is:

5|M|118 |BELLAFRONTE|LUIS|0|0|0|1996|9|15|818  |2    |54  |1996|B|||1996|11|1|0|02/04/2003|

and, the schema of the table is:

CREATE TABLE tfal (

tfal_dni int4 NOT NULL,  

tfal_sexo char(1) NOT NULL,  

tfal_ofisec char(4),  

tfal_ape varchar(35),  

tfal_nom varchar(35),  

tfal_anionac int2,  

tfal_mesnac int2,  

tfal_dianac int2,  

tfal_aniofal int2,  

tfal_mesfal int2,  

tfal_diafal int2,  

tfal_acta char(5),  

tfal_tomo char(5),  

tfal_folio char(4),  

tfal_anioi int2,  

tfal_provfal char(1),  

tfal_dptofal char(2),  

tfal_localfal varchar(30),  

tfal_anioing int2,  

tfal_mesing int2,  

tfal_diaing int2,  

tfal_fechaps int4,  

tfal_fechacarga date,  

CONSTRAINT tfal_pkey PRIMARY KEY (tfal_dni, tfal_sexo)

) WITH OIDS;

Does anyone had a trouble like this?, I don't understand what am I doing wrong. The version of the PGAdmin II I'm using is 1.4.12.

Could anyone lend me a hand please, thanks,


Andrés

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: About COPY
  2003-02-25 14:07 About COPY Andrés Repossi <andres.repossi@c1.pjn.gov.ar>
@ 2003-02-25 15:09 ` Robert Treat <xzilla@users.sourceforge.net>
  1 sibling, 0 replies; 3+ messages in thread

From: Robert Treat @ 2003-02-25 15:09 UTC (permalink / raw)
  To: Andrés Repossi <andres.repossi@c1.pjn.gov.ar>; +Cc: pgsql-admin

On Tue, 2003-02-25 at 09:07, Andrés Repossi wrote:
> Hi, I'm new working with PostgreSQL, and I'm trying to load an ascii
> text file to a table using the command copy but it throws me an error
> message that it can't parse the line, and I don't really don't know why
> is this hapening.
> 
> The sentence I'm using is:  
> 
> copy tfal from 'C:\\tfal.txt' with delimiter '|'
> 
> Te error message is: ERROR: parser: parse error at or near "delimiter"
> 
<snip>
> 
> Does anyone had a trouble like this?, I don't understand what am I doing
> wrong. The version of the PGAdmin II I'm using is 1.4.12.
> 
> Could anyone lend me a hand please, thanks,
> 

I think the syntax your looking for is:

COPY tfal FROM '/tmp/foo' USING DELIMITERS '|';

At least that's how you'd do it in psql

Robert Treat






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: About COPY
  2003-02-25 14:07 About COPY Andrés Repossi <andres.repossi@c1.pjn.gov.ar>
@ 2003-02-25 15:28 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2003-02-25 15:28 UTC (permalink / raw)
  To: Andrés Repossi <andres.repossi@c1.pjn.gov.ar>; +Cc: pgsql-admin

=?iso-8859-1?Q?Andr=E9s_Repossi?= <andres.repossi@c1.pjn.gov.ar> writes:
> copy tfal from 'C:\\tfal.txt' with delimiter '|'
> Te error message is: ERROR: parser: parse error at or near "delimiter"

> Does anyone had a trouble like this?, I don't understand what am I doing wr=
> ong.

Reading the wrong version of the documentation ;-).  You're evidently
trying to use 7.3 syntax with a pre-7.3 server.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-02-25 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-25 14:07 About COPY Andrés Repossi <andres.repossi@c1.pjn.gov.ar>
2003-02-25 15:09 ` Robert Treat <xzilla@users.sourceforge.net>
2003-02-25 15:28 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox