Thread: pg_dump for domains

pg_dump for domains

From
"Rod Taylor"
Date:
Adds domain dumping support to pg_dump.

Is the use of deps proper or necessary?


Tested with the below:


--
-- Selected TOC Entries:
--
\connect - rbt

--
-- TOC Entry ID 2 (OID 16582)
--
-- Name: dom1 Type: DOMAIN Owner: rbt
--

CREATE DOMAIN "dom1" AS integer NOT NULL;

--
-- TOC Entry ID 4 (OID 16583)
--
-- Name: dom2 Type: DOMAIN Owner: rbt
--

CREATE DOMAIN "dom2" AS text DEFAULT 'haha';

--
-- TOC Entry ID 5 (OID 16584)
--
-- Name: dom3 Type: DOMAIN Owner: rbt
--

CREATE DOMAIN "dom3" AS integer NOT NULL DEFAULT 4;

--
-- TOC Entry ID 6 (OID 16585)
--
-- Name: tab1 Type: TABLE Owner: rbt
--

CREATE TABLE "tab1" (
        "col1" dom1 NOT NULL,
        "col2" dom2,
        "col3" dom3 NOT NULL,
        "col4" dom1 DEFAULT 1 NOT NULL,
        "col5" dom2 DEFAULT 'different' NOT NULL
);

--
-- Data for TOC Entry ID 7 (OID 16585)
--
-- Name: tab1 Type: TABLE DATA Owner: rbt
--


COPY "tab1" FROM stdin;
1       haha    4       1       different
\.
--
-- TOC Entry ID 3 (OID 16582)
--
-- Name: DOMAIN "dom1" Type: COMMENT Owner:
--

COMMENT ON DOMAIN "dom1" IS 'HEHE';
--
Rod Taylor

Your eyes are weary from staring at the CRT. You feel sleepy. Notice
how restful it is to watch the cursor blink. Close your eyes. The
opinions stated above are yours. You cannot imagine why you ever felt
otherwise.


Attachment

Re: pg_dump for domains

From
"Christopher Kings-Lynne"
Date:
One nice thing about the way this dump works is that if the implementation
details are changed at a later date (as Tom has suggested) then older dumps
will still work without any trouble - unlike foreign keys!

Chris

> -----Original Message-----
> From: pgsql-patches-owner@postgresql.org
> [mailto:pgsql-patches-owner@postgresql.org]On Behalf Of Rod Taylor
> Sent: Thursday, 28 March 2002 8:57 AM
> To: pgsql-patches@postgresql.org
> Subject: [PATCHES] pg_dump for domains
>
>
> Adds domain dumping support to pg_dump.
>
> Is the use of deps proper or necessary?
>
>
> Tested with the below:
>
>
> --
> -- Selected TOC Entries:
> --
> \connect - rbt
>
> --
> -- TOC Entry ID 2 (OID 16582)
> --
> -- Name: dom1 Type: DOMAIN Owner: rbt
> --
>
> CREATE DOMAIN "dom1" AS integer NOT NULL;
>
> --
> -- TOC Entry ID 4 (OID 16583)
> --
> -- Name: dom2 Type: DOMAIN Owner: rbt
> --
>
> CREATE DOMAIN "dom2" AS text DEFAULT 'haha';
>
> --
> -- TOC Entry ID 5 (OID 16584)
> --
> -- Name: dom3 Type: DOMAIN Owner: rbt
> --
>
> CREATE DOMAIN "dom3" AS integer NOT NULL DEFAULT 4;
>
> --
> -- TOC Entry ID 6 (OID 16585)
> --
> -- Name: tab1 Type: TABLE Owner: rbt
> --
>
> CREATE TABLE "tab1" (
>         "col1" dom1 NOT NULL,
>         "col2" dom2,
>         "col3" dom3 NOT NULL,
>         "col4" dom1 DEFAULT 1 NOT NULL,
>         "col5" dom2 DEFAULT 'different' NOT NULL
> );
>
> --
> -- Data for TOC Entry ID 7 (OID 16585)
> --
> -- Name: tab1 Type: TABLE DATA Owner: rbt
> --
>
>
> COPY "tab1" FROM stdin;
> 1       haha    4       1       different
> \.
> --
> -- TOC Entry ID 3 (OID 16582)
> --
> -- Name: DOMAIN "dom1" Type: COMMENT Owner:
> --
>
> COMMENT ON DOMAIN "dom1" IS 'HEHE';
> --
> Rod Taylor
>
> Your eyes are weary from staring at the CRT. You feel sleepy. Notice
> how restful it is to watch the cursor blink. Close your eyes. The
> opinions stated above are yours. You cannot imagine why you ever felt
> otherwise.
>
>


Re: pg_dump for domains

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Rod Taylor wrote:
> Adds domain dumping support to pg_dump.
>
> Is the use of deps proper or necessary?
>
>
> Tested with the below:
>
>
> --
> -- Selected TOC Entries:
> --
> \connect - rbt
>
> --
> -- TOC Entry ID 2 (OID 16582)
> --
> -- Name: dom1 Type: DOMAIN Owner: rbt
> --
>
> CREATE DOMAIN "dom1" AS integer NOT NULL;
>
> --
> -- TOC Entry ID 4 (OID 16583)
> --
> -- Name: dom2 Type: DOMAIN Owner: rbt
> --
>
> CREATE DOMAIN "dom2" AS text DEFAULT 'haha';
>
> --
> -- TOC Entry ID 5 (OID 16584)
> --
> -- Name: dom3 Type: DOMAIN Owner: rbt
> --
>
> CREATE DOMAIN "dom3" AS integer NOT NULL DEFAULT 4;
>
> --
> -- TOC Entry ID 6 (OID 16585)
> --
> -- Name: tab1 Type: TABLE Owner: rbt
> --
>
> CREATE TABLE "tab1" (
>         "col1" dom1 NOT NULL,
>         "col2" dom2,
>         "col3" dom3 NOT NULL,
>         "col4" dom1 DEFAULT 1 NOT NULL,
>         "col5" dom2 DEFAULT 'different' NOT NULL
> );
>
> --
> -- Data for TOC Entry ID 7 (OID 16585)
> --
> -- Name: tab1 Type: TABLE DATA Owner: rbt
> --
>
>
> COPY "tab1" FROM stdin;
> 1       haha    4       1       different
> \.
> --
> -- TOC Entry ID 3 (OID 16582)
> --
> -- Name: DOMAIN "dom1" Type: COMMENT Owner:
> --
>
> COMMENT ON DOMAIN "dom1" IS 'HEHE';
> --
> Rod Taylor
>
> Your eyes are weary from staring at the CRT. You feel sleepy. Notice
> how restful it is to watch the cursor blink. Close your eyes. The
> opinions stated above are yours. You cannot imagine why you ever felt
> otherwise.
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: pg_dump for domains

From
Bruce Momjian
Date:
Patch applied.  Thanks.

---------------------------------------------------------------------------



Rod Taylor wrote:
> Adds domain dumping support to pg_dump.
>
> Is the use of deps proper or necessary?
>
>
> Tested with the below:
>
>
> --
> -- Selected TOC Entries:
> --
> \connect - rbt
>
> --
> -- TOC Entry ID 2 (OID 16582)
> --
> -- Name: dom1 Type: DOMAIN Owner: rbt
> --
>
> CREATE DOMAIN "dom1" AS integer NOT NULL;
>
> --
> -- TOC Entry ID 4 (OID 16583)
> --
> -- Name: dom2 Type: DOMAIN Owner: rbt
> --
>
> CREATE DOMAIN "dom2" AS text DEFAULT 'haha';
>
> --
> -- TOC Entry ID 5 (OID 16584)
> --
> -- Name: dom3 Type: DOMAIN Owner: rbt
> --
>
> CREATE DOMAIN "dom3" AS integer NOT NULL DEFAULT 4;
>
> --
> -- TOC Entry ID 6 (OID 16585)
> --
> -- Name: tab1 Type: TABLE Owner: rbt
> --
>
> CREATE TABLE "tab1" (
>         "col1" dom1 NOT NULL,
>         "col2" dom2,
>         "col3" dom3 NOT NULL,
>         "col4" dom1 DEFAULT 1 NOT NULL,
>         "col5" dom2 DEFAULT 'different' NOT NULL
> );
>
> --
> -- Data for TOC Entry ID 7 (OID 16585)
> --
> -- Name: tab1 Type: TABLE DATA Owner: rbt
> --
>
>
> COPY "tab1" FROM stdin;
> 1       haha    4       1       different
> \.
> --
> -- TOC Entry ID 3 (OID 16582)
> --
> -- Name: DOMAIN "dom1" Type: COMMENT Owner:
> --
>
> COMMENT ON DOMAIN "dom1" IS 'HEHE';
> --
> Rod Taylor
>
> Your eyes are weary from staring at the CRT. You feel sleepy. Notice
> how restful it is to watch the cursor blink. Close your eyes. The
> opinions stated above are yours. You cannot imagine why you ever felt
> otherwise.
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026