Re: pg_dump/psql < db.out issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "mdavis(at)sevainc(dot)com" <mdavis(at)sevainc(dot)com>
Cc: "'pgsql-admin(at)postgresql(dot)org'" <pgsql-admin(at)postgresql(dot)org>, "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_dump/psql < db.out issue
Date: 2001-01-02 16:44:45
Message-ID: 12702.978453885@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Michael Davis <mdavis(at)sevainc(dot)com> writes:
> I have several tables with text fields that contain single quotes (').
> Pg_dump exports these tables and the single quotes (') okay. Psql,
> however, will not import the data into the tables because of the single
> quote (') in one of the columns in one of the records.

Huh? That's worked just fine for a long time. What version are you
running?

play=> select * from foo;
f1
----------
I'm here
(1 row)

play=> \q
$ pg_dump -t foo play >quote.sql
$ cat quote.sql
\connect - tgl
CREATE TABLE "foo" (
"f1" text
);
COPY "foo" FROM stdin;
I'm here
\.
$ psql play
Welcome ...
play=> drop table foo;
DROP
play=> \i quote.sql
You are now connected as new user tgl.
CREATE
play=> select * from foo;
f1
----------
I'm here
(1 row)

play=>

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message SRINIVASARAGHAVAN, RAJESH (HP-Cupertino, ex1) 2001-01-02 21:12:01 programmatic interface into admin
Previous Message Scott Goodwin 2001-01-02 15:35:21 Automatic typing of foreign keys when creating tables

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-01-02 16:52:41 Re: Possible "off-topic"
Previous Message Stephan Szabo 2001-01-02 16:39:18 Re: Two tables refenceing each other's columns