[HACKERS] is it a known issue or just a bug?

2004-10-04 Thread Hans-Jürgen Schönig
Folks, Last week one of my students confronted me with a nice little SQL statement which made me call gdb ... Consider the following scenario: [EMAIL PROTECTED] bug]$ cat q1.sql create temporary sequence seq_ab; select * from (Select nextval('seq_ab') as nv, * from(

Re: [HACKERS] is it a known issue or just a bug?

2004-10-04 Thread Tom Lane
=?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= [EMAIL PROTECTED] writes: Consider the following scenario: select * from (Select nextval('seq_ab') as nv, * from( select t_product.id,t_text.value,t_price.price from

Re: [HACKERS] is it a known issue or just a bug?

2004-10-04 Thread Josh Berkus
Tom, I don't think there's any very clean way to fix this sort of problem in general. We could make this particular example work if Frankly, I don't think there *is* any safe way to use volatile functions in subqueries -- I certainly avoid it, except now() and random() which as discussed are

Re: [HACKERS] is it a known issue or just a bug?

2004-10-04 Thread Tom Lane
=?UTF-8?B?SGFucy1Kw7xyZ2VuIFNjaMO2bmln?= [EMAIL PROTECTED] writes: Josh Berkus wrote: Frankly, I don't think there *is* any safe way to use volatile functions in subqueries -- I certainly avoid it, except now() and random() which as discussed are special cases.Perhaps a WARNING is in

Re: [HACKERS] is it a known issue or just a bug?

2004-10-04 Thread Josh Berkus
Tom, It'd be easy enough to put in the anti-flattening defenses (checks (1) and (2) in my prior message) but I've got mixed emotions about whether this is really a good thing to do. Any opinions out there? If my opinion wasn't clear, I was suggesting adding a WARNING and not doing anything