Re: [BUG] views and functions on relations - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [BUG] views and functions on relations
Date
Msg-id 17513.987648469@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUG] views and functions on relations  (Alex Pilosov <alex@pilosoft.com>)
List pgsql-hackers
Alex Pilosov <alex@pilosoft.com> writes:
> Here's more info on the bug:
> background: function cust_name(customers) returns varchar;
> Query in question:

> SELECT
> cust_name(a)
> FROM customers AS a, addresses AS b
> WHERE
> b.cust_id=a.cust_id
> and b.oid=get_billing_record(a.cust_id)
> and cust_balance(a.cust_id)>0


I think I see the problem.  Is your query being executed via a mergejoin
plan with an explicit sort on customers?  Does the failure go away if
you force a nestloop join?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: Re: [BUG?] tgconstrrelid doesn't survive a dump/restore
Next
From: Tatsuo Ishii
Date:
Subject: Re: Re: No printable 7.1 docs?