Re: proposed todo: use insert/update returning anywhere a table is allowed

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposed todo: use insert/update returning anywhere a table is allowed
Date: 2007-02-19 20:07:07
Message-ID: 200702192007.l1JK77923998@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Added to TODO:

* Allow INSERT/UPDATE ... RETURNING inside a SELECT 'FROM' clause

http://archives.postgresql.org/pgsql-general/2006-09/msg00803.php
http://archives.postgresql.org/pgsql-hackers/2006-10/msg00693.php

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

Jeff Davis wrote:
> On Tue, 2007-02-06 at 16:54 -0500, Merlin Moncure wrote:
> > It would be great to be able to join to update, returning, etc. It
> > looks like the code was deliberately tied off as-is and I was
> > surprised not to see a todo for this.
> >
> > the basic idea is to be able to do things like:
> > select * from (update foo set id = 1 returning *) q;
> >
> > which currently syntax errors out on 'set' which is a bit odd.
> >
> > here are tom's brief notes on it and also some context on how select
> > combined with insert/update might influence triggers:
> >
> > http://archives.postgresql.org/pgsql-hackers/2006-10/msg00693.php
> >
>
> Also a relevent thread:
>
> http://archives.postgresql.org/pgsql-general/2006-09/msg00803.php
>
> Regards,
> Jeff Davis
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-02-19 20:08:22 Re: Multiple Storage per Tablespace, or Volumes
Previous Message August Zajonc 2007-02-19 20:00:50 Re: New feature request: FlashBack Query