Thread: Questions, help!!

Questions, help!!

From
Date:
1.ERROR: line 1, "Bad date external representation" when executing copy
cliente from '/home/txtfiles/cliente.asc' with delimiter as '|'.

a. RH Linux 9.0
b. PostgreSQL 7.3
c. Importing text file from SQL informix Online 5.0
d. Configured datestyle: "ISO with US (NonEuropean) conventions

2. ERROR: copy: line 1, "Extra data after last expected column" when
executing copy maxtrn from '/home/txtfiles/maxtrn.asc' with delimiter as
'|'

a. The text file "maxtrn.asc" was generated by Informix Online 5.0, and
its  structure is:
5|02|C|286|
5|40|C|287|
b. The table "maxtrn" has columns:
cvesuc int2
cuenta char(2)
cvetrn char(1)
folio int4

3. I cannot connect to PostgreSQL database from Kylix 3. I got the error
message "DbExpress Error: Invalid username/password"

a. I'm trying to connect with the account "postgres" which was generated
by RH Linux 9.0 and I verified entrance to the account with the password I
assigned to it previously.

Thanks for your help!!







Re: Questions, help!!

From
Tom Lane
Date:
<barron@clubinter.net> writes:
> 1.ERROR: line 1, "Bad date external representation" when executing copy
> cliente from '/home/txtfiles/cliente.asc' with delimiter as '|'.

Can't help you on that without seeing the data it's objecting to.

> 2. ERROR: copy: line 1, "Extra data after last expected column" when
> executing copy maxtrn from '/home/txtfiles/maxtrn.asc' with delimiter as
> '|'

> a. The text file "maxtrn.asc" was generated by Informix Online 5.0, and
> its  structure is:
> 5|02|C|286|
> 5|40|C|287|
> b. The table "maxtrn" has columns:
> cvesuc int2
> cuenta char(2)
> cvetrn char(1)
> folio int4

COPY thinks that these data lines have five columns, with the fifth being
empty.  You can either get rid of the trailing "|" characters (a quick
sed script would do it), or you can make COPY happy by providing a fifth
column to import into.  For instance,

        ALTER TABLE maxtrn ADD COLUMN junk text;
        ... COPY ...
        ALTER TABLE maxtrn DROP COLUMN junk;

> 3. I cannot connect to PostgreSQL database from Kylix 3. I got the error
> message "DbExpress Error: Invalid username/password"

Sorry, dunno anything about Kylix.  If you can show us the message that
shows up in the postmaster's log (postmaster stderr output) when you try
to connect, maybe we could help.

            regards, tom lane

Re: Questions, help!!

From
Bruce Momjian
Date:
barron@clubinter.net wrote:
> 1.ERROR: line 1, "Bad date external representation" when executing copy
> cliente from '/home/txtfiles/cliente.asc' with delimiter as '|'.
>
> a. RH Linux 9.0
> b. PostgreSQL 7.3
> c. Importing text file from SQL informix Online 5.0
> d. Configured datestyle: "ISO with US (NonEuropean) conventions

Please show us the date value on line 1.

> 2. ERROR: copy: line 1, "Extra data after last expected column" when
> executing copy maxtrn from '/home/txtfiles/maxtrn.asc' with delimiter as
> '|'

Yes, this is a known problem.  Informix puts the delimiter at the end of
the line, while we don't.  You have to strip them, perhap with sed:

    sed 's/|$//' file

> a. The text file "maxtrn.asc" was generated by Informix Online 5.0, and
> its  structure is:
> 5|02|C|286|
> 5|40|C|287|
> b. The table "maxtrn" has columns:
> cvesuc int2
> cuenta char(2)
> cvetrn char(1)
> folio int4
>
> 3. I cannot connect to PostgreSQL database from Kylix 3. I got the error
> message "DbExpress Error: Invalid username/password"
>
> a. I'm trying to connect with the account "postgres" which was generated
> by RH Linux 9.0 and I verified entrance to the account with the password I
> assigned to it previously.

Not sure on that one.  Perhaps it is using an older PostgreSQL client
library and you have to use 'password' or 'crypt' rather than 'md5'.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073