pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ERROR: replace_vars_with_subplan_refs (!?)
3+ messages / 2 participants
[nested] [flat]

* ERROR: replace_vars_with_subplan_refs (!?)
@ 2000-09-20 13:25 Louis-David Mitterrand <cunctator@apartia.ch>
  2000-09-20 14:43 ` Re: ERROR: replace_vars_with_subplan_refs (!?) Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Louis-David Mitterrand @ 2000-09-20 13:25 UTC (permalink / raw)
  To: pgsql-sql

How should I interpret that error?

auction=# SELECT (select max(b.price) from bid b where b.auction_id = a.id and b.person_id = buyer.id) as last_lot,auction_status(a.id) > 0 AS current, a.lot, a.person_id, next_price(a.id), seller.mail AS seller_mail, buyer.mail AS buyer_mail, seller.locale AS seller_locale, buyer.login AS buyer_login, num_bid(a.id), seller.login AS seller_login, t.name AS auction_type FROM auction* a, person seller, person buyer, auction_type t WHERE a.id = 84 AND seller.id = a.person_id AND COALESCE(a.type,1) = t.id AND buyer.id = 2;
ERROR:  replace_vars_with_subplan_refs: variable not in subplan target list

Thanks,

-- 
Louis-David Mitterrand - ldm@apartia.org - http://www.apartia.org

 Marijuana is nature's way of saying, "Hi!".



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: ERROR: replace_vars_with_subplan_refs (!?)
  2000-09-20 13:25 ERROR: replace_vars_with_subplan_refs (!?) Louis-David Mitterrand <cunctator@apartia.ch>
@ 2000-09-20 14:43 ` Tom Lane <tgl@sss.pgh.pa.us>
  2000-09-20 16:13   ` Re: ERROR: replace_vars_with_subplan_refs (!?) Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2000-09-20 14:43 UTC (permalink / raw)
  To: ldm@apartia.ch; +Cc: pgsql-sql

Louis-David Mitterrand <cunctator@apartia.ch> writes:
> How should I interpret that error?
> ERROR:  replace_vars_with_subplan_refs: variable not in subplan target list

Looks like a bug to me.  I think this may already be fixed in current
sources, but not sure.  Could I trouble you for the relevant table
declarations, so I can try the example without a lot of guessing?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: ERROR: replace_vars_with_subplan_refs (!?)
  2000-09-20 13:25 ERROR: replace_vars_with_subplan_refs (!?) Louis-David Mitterrand <cunctator@apartia.ch>
  2000-09-20 14:43 ` Re: ERROR: replace_vars_with_subplan_refs (!?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2000-09-20 16:13   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2000-09-20 16:13 UTC (permalink / raw)
  To: ldm@apartia.ch; +Cc: pgsql-sql

Louis-David Mitterrand <ldm@apartia.ch> writes:
> On Wed, Sep 20, 2000 at 10:43:59AM -0400, Tom Lane wrote:
>> Louis-David Mitterrand <cunctator@apartia.ch> writes:
>>>> How should I interpret that error?
>>>> ERROR:  replace_vars_with_subplan_refs: variable not in subplan target list
>> 
>> Looks like a bug to me.  I think this may already be fixed in current
>> sources, but not sure.  Could I trouble you for the relevant table
>> declarations, so I can try the example without a lot of guessing?

> Please find attached the full dump.

OK, this is indeed fixed in current sources.  I think you are running
into the same problem you reported in June, namely that subselects
appearing in the targetlist of an Append plan are misprocessed in 7.0.*.
Append is mainly used for handling inherited queries, so it's the
combination of inheritance and subselect in targetlist that's needed
to trigger the bug.

This probably also explains the other report you filed this morning;
once the subselect is messed up, all sorts of things start to go wrong
:-( 

I think you could back-patch the fix into 7.0.* just by dropping rev
1.64 of setrefs.c into the 7.0 source tree --- see
http://www.postgresql.org/cgi/cvswebtest.cgi/pgsql/src/backend/optimizer/plan/setrefs.c
for that version.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2000-09-20 16:13 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-09-20 13:25 ERROR: replace_vars_with_subplan_refs (!?) Louis-David Mitterrand <cunctator@apartia.ch>
2000-09-20 14:43 ` Tom Lane <tgl@sss.pgh.pa.us>
2000-09-20 16:13   ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox