BUG #3320: Error when using INSERT...RETURNING as a subquery

From: "Jan Szumiec" <jan(dot)szumie(at)infiniteloop(dot)eu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3320: Error when using INSERT...RETURNING as a subquery
Date: 2007-05-29 11:27:05
Message-ID: 200705291127.l4TBR5g9040971@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3320
Logged by: Jan Szumiec
Email address: jan(dot)szumie(at)infiniteloop(dot)eu
PostgreSQL version: 8.2.4
Operating system: Windows XP
Description: Error when using INSERT...RETURNING as a subquery
Details:

Having:

CREATE TABLE efforts
(
id serial NOT NULL,
effort integer
)
WITHOUT OIDS;

CREATE TABLE items
(
id serial NOT NULL,
"type" character varying(255),
created_at timestamp without time zone,
subject character varying(255),
body text,
effort integer,
CONSTRAINT items_pkey PRIMARY KEY (id)
)
WITHOUT OIDS;

executing the following query:

UPDATE items SET (type, post_id) = (INSERT INTO efforts (effort) VALUES
(667) RETURNING 'Item', id) WHERE id = 1937

produces this error:

ERROR: syntax error at or near "INTO"
SQL state:42601
Character:44

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Huxton 2007-05-29 11:50:48 Re: [HACKERS] exit
Previous Message Marcos Fabrício Corso 2007-05-29 11:12:38 [HACKERS] exit