Cannot dump/restore text value \N

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Cannot dump/restore text value \N
Date: 2003-10-05 22:29:13
Message-ID: ie51ovcl0gcmj5rs4v692hqb317nrh6jpm@email.aon.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

To be clear, this is not about \N as the default external
representation for NULL, I'm talking about a string consisting of the
two characters backslash and uppercase-N.

CREATE TABLE nonu (tx text NOT NULL);
INSERT INTO nonu VALUES ('\\N');
SELECT * FROM nonu;
COPY nonu TO stdout;

This correctly gives:
\\N

Now try to feed that back into the table:
DELETE FROM nonu;
COPY nonu FROM stdin;
\\N
\.

ERROR: copy: line 1, CopyFrom: Fail to add null value in not null
attribute tx
lost synchronization with server, resetting connection

This happened with 7.3.4, while trying to restore a 1.3 GB dump :-(
ERROR: copy: line 809051, CopyFrom: Fail to add null value in not
null attribute text
FATAL: Socket command type 0 unknown

The bug is still in 7.4Beta3; didn't test with Beta 4 yet.

Servus
Manfred

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2003-10-05 22:52:34 Re: Open 7.4 items
Previous Message Bruce Momjian 2003-10-05 22:23:34 Re: Learning PostgreSQL

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-10-05 22:37:40 Re: fix log_min_duration_statement logic error
Previous Message Bruce Momjian 2003-10-05 22:22:14 Re: fix log_min_duration_statement logic error