Skip site navigation (1) Skip section navigation (2)

7.2.1: pg_dump of UNIONed VIEWs broken

From: Ian Morgan <imorgan(at)webcon(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: 7.2.1: pg_dump of UNIONed VIEWs broken
Date: 2002-04-22 06:07:39
Message-ID: Pine.LNX.4.44.0204220200300.1964-100000@light.webcon.net (view raw or flat)
Thread:
Lists: pgsql-bugs
PostgreSQL 7.2.1's pg_dump prduces bad SQL for VIEW's.

The SQL for CREATE VIEW as output by pg_dump generates an error, because the
appropriate nesting of SELECTs with parentheses is missing:
ERROR: parser: parse error at or near "SELECT"


Original SQL:

CREATE VIEW "agents" as (
        (
        SELECT DISTINCT
                employees.contact_id
        FROM
                employees
        ORDER BY
                employees.contact_id
        )
UNION
        (
        SELECT DISTINCT
                contractors.contact_id
        FROM
                contractors
        ORDER BY
                contractors.contact_id
        )
);


As output by pg_dump:

CREATE VIEW "agents" as SELECT DISTINCT employees.contact_id FROM employees
ORDER BY employees.contact_id UNION SELECT DISTINCT contractors.contact_id
FROM contractors ORDER BY contractors.contact_id;

As you can see, the nesting is entirely lost.

Regards,
Ian Morgan
-- 
-------------------------------------------------------------------
 Ian E. Morgan        Vice President & C.O.O.         Webcon, Inc.
 imorgan(at)webcon(dot)net         PGP: #2DA40D07          www.webcon.net
    *  Customized Linux network solutions for your business  *
-------------------------------------------------------------------


Responses

pgsql-bugs by date

Next:From: Gerhard HäringDate: 2002-04-22 06:21:30
Subject: Re: Escaping of special characters in ARRAYs is broken
Previous:From: Thomas LockhartDate: 2002-04-22 02:57:55
Subject: Re: Patches applied; initdb time!

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group