Re: pg_dump system catalog

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>
Cc: Juliano <jplinux(at)protonmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, "achill(at)matrix(dot)gatewaynet(dot)com" <achill(at)matrix(dot)gatewaynet(dot)com>
Subject: Re: pg_dump system catalog
Date: 2016-11-28 15:50:52
Message-ID: eedd7225-8739-91b9-3a47-5a09c35f5ea8@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/28/2016 07:44 AM, Melvin Davidson wrote:
>

>
>
> *To clarify, you cannot dump the pg_catalog schema. It is the main
> control of how all other objects are

Actually you can. I would not of thought so, but tried Achilleas's
suggestion and it worked. Example:

--
-- Name: pg_aggregate; Type: TABLE; Schema: pg_catalog; Owner: postgres
--

CREATE TABLE pg_aggregate (
aggfnoid regproc NOT NULL,
aggkind "char" NOT NULL,
aggnumdirectargs smallint NOT NULL,
aggtransfn regproc NOT NULL,
aggfinalfn regproc NOT NULL,
aggmtransfn regproc NOT NULL,
aggminvtransfn regproc NOT NULL,
aggmfinalfn regproc NOT NULL,
aggfinalextra boolean NOT NULL,
aggmfinalextra boolean NOT NULL,
aggsortop oid NOT NULL,
aggtranstype oid NOT NULL,
aggtransspace integer NOT NULL,
aggmtranstype oid NOT NULL,
aggmtransspace integer NOT NULL,
agginitval text,
aggminitval text
);

COPY pg_aggregate (aggfnoid ....

and you do get errors:

pg_dump: WARNING: typtype of data type "any" appears to be invalid
pg_dump: WARNING: typtype of data type "anyarray" appears to be invalid
pg_dump: WARNING: typtype of data type "anyelement" appears to be invalid
pg_dump: WARNING: typtype of data type "anyenum" appears to be invalid
pg_dump: WARNING: typtype of data type "anynonarray" appears to be invalid
pg_dump: WARNING: typtype of data type "anyrange" appears to be invalid
pg_dump: WARNING: typtype of data type "cstring" appears to be invalid

....

Still not sure why you would want to, but you can.

> stored in the cluster. There is no point in dumping it and all it's
> tables and views are already clearly
> documented.
> https://www.postgresql.org/docs/9.6/static/catalogs.html
>
> pg_catalog itself is generated with the initdb command when a new
> postgresql cluster is generated.
> https://www.postgresql.org/docs/9.6/static/creating-cluster.html
> https://www.postgresql.org/docs/9.6/static/app-initdb.html*
>
> --
> *Melvin Davidson*
> I reserve the right to fantasize. Whether or not you
> wish to share my fantasy is entirely up to you.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2016-11-28 16:43:34 Re: Storing files: 2.3TBytes, 17M file count
Previous Message Melvin Davidson 2016-11-28 15:44:05 Re: pg_dump system catalog