surppressing column names in COPY format

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: surppressing column names in COPY format
Date: 2003-07-31 14:31:16
Message-ID: 1059661876.22273.1585.camel@camel
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

in 7.2 doing a data only dump (pg_dump -a -x db > dump) would give
output like:

UPDATE "pg_class" SET "reltriggers" = 0 WHERE "relname" = 'status';

COPY "status" FROM stdin;
0 INFO
1 WARNING
2 CRIT
\.
-- Enable triggers
UPDATE pg_class SET reltriggers = (SELECT count(*) FROM pg_trigger where
pg_class.oid = tgrelid) WHERE relname = 'status';

however in 7.3, doing the equivalent (pg_dump -a --disable-triggers db >
dump) i get the following output.

UPDATE pg_catalog.pg_class SET reltriggers = 0 WHERE oid =
'status'::pg_catalog.regclass;

COPY status (status_id, description) FROM stdin;
0 INFO
1 WARNING
2 CRIT
\.

-- Enable triggers
UPDATE pg_catalog.pg_class SET reltriggers = (SELECT pg_catalog.count(*)
FROM pg_catalog.pg_trigger where pg_class.oid = tgrelid) WHERE oid =
'status'::pg_catalog.regclass;

the problem is that I am restoring the data to a database with different
column names, which errors out in 7.3 (but didn't under 7.2 since it
didn't produce column names in the COPY output). I checked the docs and
it provided no clue as to how to suppress column names for COPY only
dumps. I also checked the message archives, but the only thing relevant
seemed to be the original patch which didn't appear to allow for a way
to suppress the column names, am I completely missing something here or
did we lose this functionality?

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Cornelia Boenigk 2003-07-31 14:40:10 Re: [GENERAL] interesting PHP/MySQL thread
Previous Message Csaba Nagy 2003-07-31 12:43:31 Re: Updating from update trigger