surppressing column names in COPY format - Mailing list pgsql-general

From Robert Treat
Subject surppressing column names in COPY format
Date
Msg-id 1059661876.22273.1585.camel@camel
Whole thread Raw
Responses Re: surppressing column names in COPY format
List 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


pgsql-general by date:

Previous
From: Paul Ramsey
Date:
Subject: Re: Upgrading to 7.3.4?
Next
From: Bjørn T Johansen
Date:
Subject: Re: Upgrading to 7.3.4?