pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #8567: sql "with" for delete and update not work correctly
2+ messages / 2 participants
[nested] [flat]

* BUG #8567: sql "with" for delete and update not work correctly
@ 2013-10-29 15:32 ingsis.johnparra@gmail.com
  2013-11-13 03:51 ` Re: BUG #8567: sql "with" for delete and update not work correctly Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: ingsis.johnparra@gmail.com @ 2013-10-29 15:32 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      8567
Logged by:          John Parra
Email address:      ingsis.johnparra@gmail.com
PostgreSQL version: 9.2.4
Operating system:   Fedora 19
Description:        

To executed an query with reserved word "with del as (...) delete from ...=
(select id from del)" and had to run more than once.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #8567: sql "with" for delete and update not work correctly
  2013-10-29 15:32 BUG #8567: sql "with" for delete and update not work correctly ingsis.johnparra@gmail.com
@ 2013-11-13 03:51 ` Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2013-11-13 03:51 UTC (permalink / raw)
  To: ingsis.johnparra@gmail.com; +Cc: pgsql-bugs

On Wed, Oct 30, 2013 at 12:32 AM,  <ingsis.johnparra@gmail.com> wrote:
> The following bug has been logged on the website:
>
> Bug reference:      8567
> Logged by:          John Parra
> Email address:      ingsis.johnparra@gmail.com
> PostgreSQL version: 9.2.4
> Operating system:   Fedora 19
> Description:
>
> To executed an query with reserved word "with del as (...) delete from ...=
> (select id from del)" and had to run more than once.
You are not giving much information here... But I'd guess that you
forgot to add a RETURNING clause, necessary with a DML inside WITH:
=# create table aa (a int);
CREATE TABLE
=# insert into aa values (generate_series(1,5));
INSERT 0 5
=# with del1 as (delete from aa where a = 1 or a = 3 returning a)
select * from del1;
 a
---
 1
 3
(2 rows)
=# select * from aa;
 a
---
 2
 4
 5
(3 rows)

Regards,
-- 
Michael


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2013-11-13 03:51 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-10-29 15:32 BUG #8567: sql "with" for delete and update not work correctly ingsis.johnparra@gmail.com
2013-11-13 03:51 ` Michael Paquier <michael.paquier@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox