From: | Greg Quinn <greg(dot)quinn(at)anu(dot)edu(dot)au> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | with queries |
Date: | 2010-09-16 05:05:16 |
Message-ID: | 4C91A58C.7050406@anu.edu.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hullo.
I've been a Postgresql user for many years, so forgive me if I'm doing
something really stupid.
I cannot get 'with' queries to work at all. The test query that I've
entered below (as an example) is direct from the section '7.8 WITH
Queries' of the manual, so I'd expect that to work wouldn't I?
test=# WITH RECURSIVE t(n) AS (VALUES (1) UNION ALL SELECT n+1 FROM t
WHERE n < 100) SELECT sum(n) FROM t;
ERROR: syntax error at or near "WITH RECURSIVE"
LINE 1: WITH RECURSIVE t(n) AS (VALUES (1) UNION ALL SELECT n+1 FROM...
^
test=#
Tried this with 8.4 and 9.0rc1, same result. Any help (even to tell me
that I'm an idiot!) would be much appreciated. In the meantime my query
will revert to Plan A, but it would be so much neater using a 'with'.
--
Greg Quinn
Australian Phenomics Facility
greg(dot)quinn(at)anu(dot)edu(dot)au
(02) 61259407
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Quinn | 2010-09-16 05:45:49 | with queries |
Previous Message | Tatarnikov Alexander | 2010-09-16 02:03:30 | Re: Use "CREATE USER" in plpgsql function - Found word(s) list error in the Text body |