[gameprogrammer] Re: Slightly offtopic: SQL Command
- From: Kevin Jenkins <gameprogrammer@xxxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Fri, 10 Nov 2006 18:40:59 -0800
That was it. I updated to the very latest and it worked.
Sami Näätänen wrote:
On Saturday 11 November 2006 01:56, Kevin Jenkins wrote:
PostgreSQL at least returns the oid of the inserted tuple.
This of course is unique. This can be used to get any
auto_increment etc stuff whit ease. So check the behaviour of the
DB you use. It can provide some similar way to get that.
PS. How it seams that every time I encounter new DB system
PostgreSQL seams to do things right or better. :) Or maybe I'm a
litle bit biased to PostgreSQL. ;)
I'm trying to implement this as described here:
http://developer.postgresql.org/pgdocs/postgres/sql-insert.html
but RETURNING doesn't work:
BEGIN;
CREATE TABLE blah(name integer);
INSERT INTO blah(name) VALUES (0) RETURNING name;
COMMIT;
ERROR: syntax error at or near "RETURNING" at character 79
Ideas?
Are you sure you use correct documentation?
Top of the link you posted says "PostgreSQL 8.2beta3 Documentation"
try:
prompt ~ $ psql
Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
user=> \h insert
Command: INSERT
Description: create new rows in a table
Syntax:
INSERT INTO table [ ( column [, ...] ) ]
{ DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...] ) |
query }
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- References:
- [gameprogrammer] Re: Slightly offtopic: SQL Command
- From: Kevin Jenkins
- [gameprogrammer] Re: Slightly offtopic: SQL Command
- From: Sami Näätänen
Other related posts:
- » [gameprogrammer] Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
- » [gameprogrammer] Re: Slightly offtopic: SQL Command
On Saturday 11 November 2006 01:56, Kevin Jenkins wrote:
PostgreSQL at least returns the oid of the inserted tuple. This of course is unique. This can be used to get any auto_increment etc stuff whit ease. So check the behaviour of the DB you use. It can provide some similar way to get that. PS. How it seams that every time I encounter new DB system PostgreSQL seams to do things right or better. :) Or maybe I'm a litle bit biased to PostgreSQL. ;)I'm trying to implement this as described here: http://developer.postgresql.org/pgdocs/postgres/sql-insert.html but RETURNING doesn't work: BEGIN; CREATE TABLE blah(name integer); INSERT INTO blah(name) VALUES (0) RETURNING name; COMMIT; ERROR: syntax error at or near "RETURNING" at character 79 Ideas?
Are you sure you use correct documentation?
Top of the link you posted says "PostgreSQL 8.2beta3 Documentation"
try:
prompt ~ $ psql
Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
user=> \h insert
Command: INSERT
Description: create new rows in a table
Syntax:
INSERT INTO table [ ( column [, ...] ) ]
{ DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...] ) |
query }
--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- [gameprogrammer] Re: Slightly offtopic: SQL Command
- From: Kevin Jenkins
- [gameprogrammer] Re: Slightly offtopic: SQL Command
- From: Sami Näätänen