Alvaro Herrera <[EMAIL PROTECTED]> writes:
> Tom Allison escribió:
>> insert into table(string) values(('one'),('two'),('three')) returning
>> idx;
>>
>> I realize that this is an extension to standard SQL but it sure would
>> save me a lot.
> You are wrong -- you can do it, but it is not an
Tom Allison escribió:
> Holy Crud!
> you mean to tell me I can replace:
>
> insert into table(string) values(('one'),('two'),('three'));
> select idx from table where string in ('one','two','three');
>
> with
>
> insert into table(string) values(('one'),('two'),('three')) returning
> idx;
>
Holy Crud!
you mean to tell me I can replace:
insert into table(string) values(('one'),('two'),('three'));
select idx from table where string in ('one','two','three');
Yes.
A smart ORM library should, when you create a new database object from
form values, use INSERT RETURNING to
On Jun 12, 2007, at 11:40 AM, Vincenzo Romano wrote:
On Tuesday 12 June 2007 16:35:05 Martijn van Oosterhout wrote:
On Tue, Jun 12, 2007 at 04:18:32PM +0200, Vincenzo Romano wrote:
Well, at least on v8.2.4 I cannot return count(*), that is the
number of lines actually inserted into the table
On Jun 12, 2007, at 10:18 AM, Vincenzo Romano wrote:
Hi all.
I'm trying to use this wonderful feature (thanks to anyone who
suggested/committed/implemented it).
According to the documentation:
(http://www.postgresql.org/docs/8.2/interactive/sql-insert.html)
"The optional RETURNING clause cau
On Tuesday 12 June 2007 18:26:35 Tom Lane wrote:
> Vincenzo Romano <[EMAIL PROTECTED]> writes:
> > Second, I'm not using nested statements, but rather a plain
> > INSERT ... RETURNING COUNT(*) INTO var (it's inside a PL/PgSQL
> > function body). It should not need any GROUP BY as the query is
> > p
Vincenzo Romano <[EMAIL PROTECTED]> writes:
> Second, I'm not using nested statements, but rather a plain
> INSERT ... RETURNING COUNT(*) INTO var (it's inside a PL/PgSQL
> function body). It should not need any GROUP BY as the query is
> plain.
> Maybe the solution is somewhere in between what yo
Vincenzo Romano <[EMAIL PROTECTED]> writes:
> Well, at least on v8.2.4 I cannot return count(*), that is the
> number of lines actually inserted into the table. Nor I can return
> any aggregate function of them.
> Am I doing anything wrong or is there some missing sentence in the
> documentation?
On Tuesday 12 June 2007 16:35:05 Martijn van Oosterhout wrote:
> On Tue, Jun 12, 2007 at 04:18:32PM +0200, Vincenzo Romano wrote:
> > Well, at least on v8.2.4 I cannot return count(*), that is the
> > number of lines actually inserted into the table. Nor I can
> > return any aggregate function of t
On Tue, Jun 12, 2007 at 04:18:32PM +0200, Vincenzo Romano wrote:
> Well, at least on v8.2.4 I cannot return count(*), that is the
> number of lines actually inserted into the table. Nor I can return
> any aggregate function of them.
I don't think anybody considered the possibility of using an aggr
Hi all.
I'm trying to use this wonderful feature (thanks to anyone who
suggested/committed/implemented it).
According to the documentation:
(http://www.postgresql.org/docs/8.2/interactive/sql-insert.html)
"The optional RETURNING clause causes INSERT to compute and return
value(s) based on each ro
11 matches
Mail list logo