Search Postgresql Archives

INSERT doc discrepancy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



INSERT INTO table [ ( column [, ...] ) ]
    { DEFAULT VALUES | VALUES ( { _expression_ | DEFAULT } [, ...] ) [, ...] | query }
    [ RETURNING * | output_expression [ AS output_name ] [, ...] ]

but it seems if i want to return the result into a record i have to use it with INTO clause in the end:

        INSERT INTO tablename (
             a
            ,b
            ,c
        ) VALUES (
             in_a
            ,in_b
            ,in_c
        ) RETURNING * INTO _r;

using either

        INSERT INTO tablename (
             a
            ,b
            ,c
        ) VALUES (
             in_a
            ,in_b
            ,in_c
        ) RETURNING  _r;

or 

        INSERT INTO tablename (
             a
            ,b
            ,c
        ) VALUES (
             in_a
            ,in_b
            ,in_c
        ) RETURNING * AS _r;

didn't work on PostgreSQL 8.2.4 

Kristo Kaiv
http://kaiv.wordpress.com (PostgreSQL blog)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux