Re: is it a known issue or just a bug? - Mailing list pgsql-hackers

From Hans-Jürgen Schönig
Subject Re: is it a known issue or just a bug?
Date
Msg-id 416197C0.50303@cybertec.at
Whole thread Raw
In response to Re: is it a known issue or just a bug?  (Josh Berkus <josh@agliodbs.com>)
Responses Re: is it a known issue or just a bug?
List pgsql-hackers
Josh Berkus wrote:
> 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 special cases.    Perhaps a WARNING is in order? 
> 

Personally I like Josh's idea. A warning would be a nice thing.

I have just looked at Oracle and SQL Server to find out what those 
systems are doing ...

Oracle has a very interesting concept *g*:

ORA-02287 sequence number not allowed here:
The usage of a sequence is limited and it can be used only in few areas 
of PL/SQL and SQL coding.

The following are the cases where you can't use a sequence:
For a SELECT Statement:  1. In a WHERE clause  2. In a GROUP BY or ORDER BY clause  3. In a DISTINCT clause  4. Along
witha UNION or INTERSECT or MINUS  5. In a sub-query
 

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

SQL Server does not support sequences the way we know it so it is hard 
to compare.

I did not have time to test DB2 yet.
Thanks a lot,
    Hans


-- 
Cybertec Geschwinde u Schoenig
Schoengrabern 134, A-2020 Hollabrunn, Austria
Tel: +43/720/10 1234567 or +43/660/816 40 77
www.cybertec.at, www.postgresql.at, kernel.cybertec.at




pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: [pgsql-www] Contrib/earthdistance missing from cvsweb.
Next
From: Reini Urban
Date:
Subject: Re: open item: tablespace handing in pg_dump/pg_restore