pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: COPY doesn't works when containing ' ' or ' ' characters on db
7+ messages / 5 participants
[nested] [flat]
* Re: COPY doesn't works when containing ' ' or ' ' characters on db
@ 2001-02-27 03:16 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 7+ messages in thread
From: Tom Lane @ 2001-02-27 03:16 UTC (permalink / raw)
To: Jaume Teixi <teixi@6tems.com>; +Cc: pgsql-hackers@postgresql.org, pgsql-admin@postgresql.org, "Richard T. Robino" <rickspam@wavedivision.com>; Stefan Huber <schweinsaug@crosswinds.net>
Jaume Teixi <teixi@6tems.com> writes:
> I finally percated that when data contains 'ñ' or 'à' it's impossible to
> parse trought:
> COPY products FROM '/var/lib/postgres/dadesi.txt' USING DELIMITERS '|' \g
> it causes:
> SELECT edicion FROM products;
> edicion
> -----------------
> España|Nacional <-------puts on the same cell either there's an '|' in
> the middle!!!
Very odd. What LOCALE and multibyte encodings are you using, if any?
This seems like it must be a multibyte issue, but I can't guess what.
Also, which Postgres version are you running? If you said, I missed it.
regards, tom lane
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: COPY doesn't works when containing ' ' or ' ' characters on db
@ 2001-02-27 15:38 Oliver Elphick <olly@lfix.co.uk>
parent: Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 7+ messages in thread
From: Oliver Elphick @ 2001-02-27 15:38 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Jaume Teixi <teixi@6tems.com>; pgsql-hackers@postgresql.org, pgsql-admin@postgresql.org, "Richard T. Robino" <rickspam@wavedivision.com>; Stefan Huber <schweinsaug@crosswinds.net>
Tom Lane wrote:
>Jaume Teixi <teixi@6tems.com> writes:
>> I finally percated that when data contains '' or '' it's impossible to
>> parse trought:
>
>> COPY products FROM '/var/lib/postgres/dadesi.txt' USING DELIMITERS '|' \g
>
>> it causes:
>
>> SELECT edicion FROM products;
>> edicion
>> -----------------
>> Espaa|Nacional <-------puts on the same cell either there's an '|' in
>> the middle!!!
>
>Very odd. What LOCALE and multibyte encodings are you using, if any?
>This seems like it must be a multibyte issue, but I can't guess what.
>
>Also, which Postgres version are you running? If you said, I missed it.
I think this happens when the front-end encoding is SQL_ASCII and the
database is using UNICODE. Then, there are misunderstandings between
front-end and back-end, so that a single character with the eighth bit
set may be sent by the front-end and interpreted by the back-end as the
first half of a UNICODE two-byte character.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"If we confess our sins, he is faithful and just to
forgive us our sins, and to cleanse us from all
unrighteousness." I John 1:9
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: COPY doesn't works when containing ' ' or ' ' characters on db
@ 2001-02-27 17:19 Tom Lane <tgl@sss.pgh.pa.us>
parent: Oliver Elphick <olly@lfix.co.uk>
0 siblings, 1 reply; 7+ messages in thread
From: Tom Lane @ 2001-02-27 17:19 UTC (permalink / raw)
To: Oliver Elphick <olly@lfix.co.uk>; +Cc: Jaume Teixi <teixi@6tems.com>; pgsql-hackers@postgresql.org, pgsql-admin@postgresql.org, "Richard T. Robino" <rickspam@wavedivision.com>; Stefan Huber <schweinsaug@crosswinds.net>
"Oliver Elphick" <olly@lfix.co.uk> writes:
> I think this happens when the front-end encoding is SQL_ASCII and the
> database is using UNICODE. Then, there are misunderstandings between
> front-end and back-end, so that a single character with the eighth bit
> set may be sent by the front-end and interpreted by the back-end as the
> first half of a UNICODE two-byte character.
I wondered about that, but his examples had one or more characters
between the eighth-bit-set character and the '|', so this doesn't seem
to explain the problem.
Still, if it went away after moving to ASCII encoding, it clearly is
a multibyte issue of some sort.
regards, tom lane
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [HACKERS] Re: COPY doesn't works when containing ' ' or ' ' characters on db
@ 2001-02-28 01:01 Tatsuo Ishii <t-ishii@sra.co.jp>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 7+ messages in thread
From: Tatsuo Ishii @ 2001-02-28 01:01 UTC (permalink / raw)
To: tgl@sss.pgh.pa.us; +Cc: olly@lfix.co.uk; teixi@6tems.com; pgsql-hackers@postgresql.org; pgsql-admin; rickspam@wavedivision.com; schweinsaug@crosswinds.net
> "Oliver Elphick" <olly@lfix.co.uk> writes:
> > I think this happens when the front-end encoding is SQL_ASCII and the
> > database is using UNICODE. Then, there are misunderstandings between
> > front-end and back-end, so that a single character with the eighth bit
> > set may be sent by the front-end and interpreted by the back-end as the
> > first half of a UNICODE two-byte character.
>
> I wondered about that, but his examples had one or more characters
> between the eighth-bit-set character and the '|', so this doesn't seem
> to explain the problem.
No.
^ permalink raw reply [nested|flat] 7+ messages in thread
* RE: COPY doesn't works when containing ' ' or ' ' characters on db
@ 2001-02-28 23:01 Rainer Mager <rmager@vgkk.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 7+ messages in thread
From: Rainer Mager @ 2001-02-28 23:01 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin
I haven't been following this thread very carefully but I just remembered a
similar problem we had that is probably related. We did a dump from a UTF-8
db containind English, Japanese, and Korean data. When the dump was done in
the default mode (e.g., via COPY statements) then we could no restore it. It
would die on certain characters. We then tried dumping in with -nd flags.
This fixed the problem for us although the restore is a lot slower.
--Rainer
> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org
> [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Tom Lane
> Sent: Tuesday, February 27, 2001 12:17 PM
> To: Jaume Teixi
> Cc: pgsql-hackers@postgresql.org; pgsql-admin@postgresql.org; Richard T.
> Robino; Stefan Huber
> Subject: Re: [ADMIN] COPY doesn't works when containing ' ' or ' '
> characters on db
>
>
> Jaume Teixi <teixi@6tems.com> writes:
> > I finally percated that when data contains '$B!&(B or '$B!&(B it's impossible to
> > parse trought:
>
> > COPY products FROM '/var/lib/postgres/dadesi.txt' USING
> DELIMITERS '|' \g
>
> > it causes:
>
> > SELECT edicion FROM products;
> > edicion
> > -----------------
> > Espa$BB(B|Nacional <-------puts on the same cell either there's an '|' in
> > the middle!!!
>
> Very odd. What LOCALE and multibyte encodings are you using, if any?
> This seems like it must be a multibyte issue, but I can't guess what.
>
> Also, which Postgres version are you running? If you said, I missed it.
>
> regards, tom lane
^ permalink raw reply [nested|flat] 7+ messages in thread
* RE: COPY doesn't works when containing ' ' or ' ' charact ers on db
@ 2001-03-02 13:01 Johan Segernas <johan.segernas@foretagsuniversitetet.se>
0 siblings, 0 replies; 7+ messages in thread
From: Johan Segernas @ 2001-03-02 13:01 UTC (permalink / raw)
To: 'Rainer Mager' <rmager@vgkk.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin
I had exactley the same problem and solved in the very same way.
A lot slower and alot faster but it worked.
Tried with changing encoding and so on, but -d made my difference.
Is there any way to go around this? I dont have to be forced to take backup
with -d if our database gets bigger.. if avoidable.
> -----Original Message-----
> From: Rainer Mager [mailto:rmager@vgkk.com]
> Sent: den 1 mars 2001 00:02
> To: Tom Lane; pgsql-admin@postgresql.org
> Subject: RE: [ADMIN] COPY doesn't works when containing ' '
> or ' ' characters on db
>
>
> I haven't been following this thread very carefully but I
> just remembered a
> similar problem we had that is probably related. We did a
> dump from a UTF-8
> db containind English, Japanese, and Korean data. When the
> dump was done in
> the default mode (e.g., via COPY statements) then we could no
> restore it. It
> would die on certain characters. We then tried dumping in
> with -nd flags.
> This fixed the problem for us although the restore is a lot slower.
>
> --Rainer
>
> > -----Original Message-----
> > From: pgsql-admin-owner@postgresql.org
> > [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Tom Lane
> > Sent: Tuesday, February 27, 2001 12:17 PM
> > To: Jaume Teixi
> > Cc: pgsql-hackers@postgresql.org;
> pgsql-admin@postgresql.org; Richard T.
> > Robino; Stefan Huber
> > Subject: Re: [ADMIN] COPY doesn't works when containing ' ' or ' '
> > characters on db
> >
> >
> > Jaume Teixi <teixi@6tems.com> writes:
> > > I finally percated that when data contains '$B!&(J or '$B!&(J it's
> impossible to
> > > parse trought:
> >
> > > COPY products FROM '/var/lib/postgres/dadesi.txt' USING
> > DELIMITERS '|' \g
> >
> > > it causes:
> >
> > > SELECT edicion FROM products;
> > > edicion
> > > -----------------
> > > Espa$B!)(J|Nacional <-------puts on the same cell either
> there's an '|' in
> > > the middle!!!
> >
> > Very odd. What LOCALE and multibyte encodings are you
> using, if any?
> > This seems like it must be a multibyte issue, but I can't
> guess what.
> >
> > Also, which Postgres version are you running? If you said,
> I missed it.
> >
> > regards, tom lane
>
###########################################
This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.F-Secure.com/
^ permalink raw reply [nested|flat] 7+ messages in thread
* RE: COPY doesn't works when containing ' ' or ' ' charact ers on db
@ 2001-03-02 13:05 Johan Segernas <johan.segernas@foretagsuniversitetet.se>
0 siblings, 0 replies; 7+ messages in thread
From: Johan Segernas @ 2001-03-02 13:05 UTC (permalink / raw)
To: Johan Segernas <johan.segernas@foretagsuniversitetet.se>; pgsql-admin
And of course i mean 'bigger' not 'faster'..
-----Original Message-----
From: Johan Segernas [mailto:johan.segernas@foretagsuniversitetet.se]
Sent: den 2 mars 2001 14:01
To: 'Rainer Mager'; Tom Lane; pgsql-admin@postgresql.org
Subject: RE: [ADMIN] COPY doesn't works when containing ' ' or ' ' charact
ers on db
I had exactley the same problem and solved in the very same way.
A lot slower and alot faster but it worked.
Tried with changing encoding and so on, but -d made my difference.
Is there any way to go around this? I dont have to be forced to take backup
with -d if our database gets bigger.. if avoidable.
> -----Original Message-----
> From: Rainer Mager [ mailto:rmager@vgkk.com <mailto:rmager@vgkk.com> ]
> Sent: den 1 mars 2001 00:02
> To: Tom Lane; pgsql-admin@postgresql.org
> Subject: RE: [ADMIN] COPY doesn't works when containing ' '
> or ' ' characters on db
>
>
> I haven't been following this thread very carefully but I
> just remembered a
> similar problem we had that is probably related. We did a
> dump from a UTF-8
> db containind English, Japanese, and Korean data. When the
> dump was done in
> the default mode (e.g., via COPY statements) then we could no
> restore it. It
> would die on certain characters. We then tried dumping in
> with -nd flags.
> This fixed the problem for us although the restore is a lot slower.
>
> --Rainer
>
> > -----Original Message-----
> > From: pgsql-admin-owner@postgresql.org
> > [ mailto:pgsql-admin-owner@postgresql.org
<mailto:pgsql-admin-owner@postgresql.org> ]On Behalf Of Tom Lane
> > Sent: Tuesday, February 27, 2001 12:17 PM
> > To: Jaume Teixi
> > Cc: pgsql-hackers@postgresql.org;
> pgsql-admin@postgresql.org; Richard T.
> > Robino; Stefan Huber
> > Subject: Re: [ADMIN] COPY doesn't works when containing ' ' or ' '
> > characters on db
> >
> >
> > Jaume Teixi <teixi@6tems.com> writes:
> > > I finally percated that when data contains '$B!&(J or '$B!&(J it's
> impossible to
> > > parse trought:
> >
> > > COPY products FROM '/var/lib/postgres/dadesi.txt' USING
> > DELIMITERS '|' \g
> >
> > > it causes:
> >
> > > SELECT edicion FROM products;
> > > edicion
> > > -----------------
> > > Espa$B!)(J|Nacional <-------puts on the same cell either
> there's an '|' in
> > > the middle!!!
> >
> > Very odd. What LOCALE and multibyte encodings are you
> using, if any?
> > This seems like it must be a multibyte issue, but I can't
> guess what.
> >
> > Also, which Postgres version are you running? If you said,
> I missed it.
> >
> > regards, tom lane
>
###########################################
This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.F-Secure.com/
<http://www.F-Secure.com/;
###########################################
This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.F-Secure.com/
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2001-03-02 13:05 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-02-27 03:16 Re: COPY doesn't works when containing ' ' or ' ' characters on db Tom Lane <tgl@sss.pgh.pa.us>
2001-02-27 15:38 ` Oliver Elphick <olly@lfix.co.uk>
2001-02-27 17:19 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-02-28 01:01 ` Tatsuo Ishii <t-ishii@sra.co.jp>
2001-02-28 23:01 ` Rainer Mager <rmager@vgkk.com>
2001-03-02 13:01 RE: COPY doesn't works when containing ' ' or ' ' charact ers on db Johan Segernas <johan.segernas@foretagsuniversitetet.se>
2001-03-02 13:05 RE: COPY doesn't works when containing ' ' or ' ' charact ers on db Johan Segernas <johan.segernas@foretagsuniversitetet.se>
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