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

Re: Bug: 8.0 beta1 either view optimization or pgdump/pgrestore

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sim Zacks <sim(at)compulab(dot)co(dot)il>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Bug: 8.0 beta1 either view optimization or pgdump/pgrestore
Date: 2004-10-27 18:21:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Sim Zacks <sim(at)compulab(dot)co(dot)il> writes:
> /*Here is the virtual table I mentioned using select * on a join*/
> (select * from PackagePricingGroups b Inner JOIN PricingGroups c ON b.PricingGroupID = c.PricingGroupID) groups

Okay, evidently the problem is that you have identically named
columns in the two tables PackagePricingGroups and PricingGroups,
so the "groups" join contains duplicate column names.  (AFAICS this
is not illegal per the SQL spec, but I wonder whether it shouldn't
be, because it's very hard to avoid ambiguity.)

I've tweaked ruleutils.c for 8.0 so that the display looks like

  LEFT JOIN ( SELECT b.packagepricinggroupid, b.pricinggroupid,
              b.packageid, b.createuserid, b.createdate, b.modifyuserid,
              b.modifydate, c.pricinggroupid, c.description,
              c.supplierid, c.baseprice, c.priceperpin, c.currencyid,
              c.createuserid, c.createdate, c.modifyuserid, c.modifydate
              FROM packagepricinggroups b
                   JOIN pricinggroups c ON

which solves this particular issue.  I'm not sure a complete solution is
possible in the presence of duplicate column names; perhaps you should
modify the query to avoid that.

			regards, tom lane

In response to


pgsql-general by date

Next:From: Daniel VeriteDate: 2004-10-27 18:33:12
Subject: Re: Problème de thread
Previous:From: Thomas HallgrenDate: 2004-10-27 18:16:21
Subject: Re: Reasoning behind process instead of thread based

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