Re: 7.2.1: pg_dump of UNIONed VIEWs broken

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Ian Morgan <imorgan(at)webcon(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: 7.2.1: pg_dump of UNIONed VIEWs broken
Date: 2002-04-23 21:03:14
Message-ID: 200204232103.g3NL3Eq18519@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Can someone phrase a TODO item for me?

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

Ian Morgan wrote:
> 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 *
> -------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Ian Morgan 2002-04-23 21:10:19 Re: 7.2.1: pg_dump of UNIONed VIEWs broken
Previous Message Jean-Paul ARGUDO 2002-04-23 16:40:23 Re: cvs update, configure, make, error in bootstrap.* ?...