Re: Bad dumps... - Mailing list pgsql-admin

From Stef
Subject Re: Bad dumps...
Date
Msg-id 20040713170757.41dfc99b@svb.ucs.co.za
Whole thread Raw
In response to Re: Bad dumps...  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Bad dumps...
List pgsql-admin
Tom Lane mentioned :
=> This is demonstrably not so.  You might have trouble with data coming
=> from somewhere else, if the source doesn't understand the quoting rules
=> for COPY data.  But I can dump and restore a table containing '\N' and
=> variants of that without any trouble.

Here's what I did to recreate the problem :
=# create table text_test ( id text NOT NULL);
CREATE TABLE
=# INSERT INTO text_test values ('\\N');
INSERT 37302671 1
=# \q
[root@p0 postgres]# pg_dump p0 -U postgres -t text_test > text_test.sql
[root@p0 postgres]# psql p0 -U postgres
Welcome to psql 7.3.4, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

=# drop table text_test ;
DROP TABLE
=# \q
[root@p0 postgres]# cat text_test.sql | psql p0 -U postgres
You are now connected as new user postgres.
SET
CREATE TABLE
ERROR:  copy: line 1, CopyFrom: Fail to add null value in not null attribute id
lost synchronization with server, resetting connection
[root@p0 postgres]#

Attachment

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bad dumps...
Next
From: Tom Lane
Date:
Subject: Re: Bad dumps...