Bug#61519: Copy does not work with special characters? (fwd) - Mailing list pgsql-bugs

From Oliver Elphick
Subject Bug#61519: Copy does not work with special characters? (fwd)
Date
Msg-id 200004011402.e31E2iR04740@linda.lfix.co.uk
Whole thread Raw
List pgsql-bugs
Can someone suggest a solution for this problem in 6.5.3, please?

------- Forwarded Message

Date:    Sat, 01 Apr 2000 11:57:30 +0200
From:    Torsten Landschoff <torsten@debian.org>
To:      submit@bugs.debian.org
Subject: Bug#61519: Copy does not work with special characters?

Package: postgresql
Version: 6.5.3-15

Hi Oliver,

I was told about a problem in PostgreSQL (seems to be an upstream bug but
I am not sure). Look at this:

template1=> create table foo (bar varchar(30), baz varchar(30));
CREATE
template1=> insert into foo values ('this', 'works');
INSERT 21328 1
template1=> insert into foo values ('thiß', 'not');
template1'> insert into foo values ('thiß', 'not');
INSERT 21330 1
template1=> insert into foo values ('this works', 'again');
INSERT 21331 1

See? Why is psql opening a continuation line when inserting 'thiß'?
Now the result is:

template1=> select * from foo;
bar       |baz
- ----------+-----
this      |works
thiß      |not
thiß      |not
this works|again
(4 rows)

??? It was inserted twice just as if Postgres did not have any problem
with it. Perhaps psql has a bug? But this only happened to me when I
tried to reproduce the bug which is interesting for us. We are inserting
data using the ODBC interface and it works even with special chars.
But we are having problems making a backup of that stuff:

torsten@pulsar:~ $ pg_dump template1
\connect - torsten
CREATE TABLE "foo" (
        "bar" character varying(30),
        "baz" character varying(30));
\connect - postgres
CREATE FUNCTION "plpgsql_call_handler" ( ) RETURNS opaque AS
'/usr/lib/postgresql/lib/plpgsql.so' LANGUAGE 'C';
CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER "plpgsql_call_handler"
LANCOMPILER 'PL/pgSQL';
\connect - torsten
COPY "foo" FROM stdin;
this    works
thiß
thiß
this works      again
\.

Now where did the second column go when exporting? We had a lot of work
with reconstructing the contents of one of our databases (we lost it
due to a disk crash).

Right, we should have tested our backups but they worked with the tested
data set...

Oliver, can you please forward this upstream?

Thanks

    Torsten

- --
Torsten Landschoff           Bluehorn@IRC               <torsten@debian.org>
           Debian Developer and Quality Assurance Committee Member


------- End of Forwarded Message


--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "Therefore, if anyone is in Christ, he is a new
      creation; the old has gone, the new has come."
                      II Corinthians 5:17

pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [BUGS] grant/revoke bug with delete/update
Next
From: werner
Date:
Subject: --enable-locale doesn't work