dbTalk Databases Forums  

WITH clause not supported in PostgreSQL 8.3?

comp.databases.postgresql comp.databases.postgresql


Discuss WITH clause not supported in PostgreSQL 8.3? in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mladen Gogala
 
Posts: n/a

Default WITH clause not supported in PostgreSQL 8.3? - 11-23-2009 , 04:13 PM






The following query executes without a problem on 8.4 but fails with
syntax error on 8.3. Is there a "new features" document which would
tell me the differences?

with emp1 as (select ename,
deptno,
rank() over
(partition by deptno order by sal) as salrank
from emp)
select ename,deptno,salrank from emp1 where salrank=1;




--
http://mgogala.byethost5.com

Reply With Quote
  #2  
Old   
Thomas Kellerer
 
Posts: n/a

Default Re: WITH clause not supported in PostgreSQL 8.3? - 11-23-2009 , 05:46 PM






Mladen Gogala wrote on 23.11.2009 23:13:
Quote:
The following query executes without a problem on 8.4 but fails with
syntax error on 8.
Yes, CTEs were introduced in 8.4

Quote:
Is there a "new features" document which would
tell me the differences?
http://www.postgresql.org/docs/curre...c/release.html

Reply With Quote
  #3  
Old   
David Bolen
 
Posts: n/a

Default Re: WITH clause not supported in PostgreSQL 8.3? - 11-23-2009 , 06:36 PM



Mladen Gogala <no (AT) email (DOT) here.invalid> writes:

Quote:
The following query executes without a problem on 8.4 but fails with
syntax error on 8.3. Is there a "new features" document which would
tell me the differences?
The manual has a release notes section (Appendix E) which generally
covers any changes, though how prominent a change is featured varies.

In this case, the WITH clause is mentioned in "E.2.3.3. Queries".

Window functions (the use of rank() and OVER in your query) are also
8.4 features (mentioned in E.2.1 and E.2.3.3), so you won't be able to
just replace the WITH clause with a sub-query under 8.3.x

-- David

Reply With Quote
  #4  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: WITH clause not supported in PostgreSQL 8.3? - 11-24-2009 , 12:15 AM



On Mon, 23 Nov 2009 19:36:25 -0500, David Bolen wrote:

Quote:
Window functions (the use of rank() and OVER in your query) are also 8.4
features (mentioned in E.2.1 and E.2.3.3), so you won't be able to just
replace the WITH clause with a sub-query under 8.3.x
Bummer! I would have the developers use 8.4.1 a long time ago but one of
the developers told me that pljava is not supported with 8.4.1. I
installed the RPM packages for 8.4.1 from the download site but there is,
indeed, no pljava for 8.4.1. I will try compiling it from the source.



--
http://mgogala.byethost5.com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.