views:

50

answers:

1

The error message is kinda vague... The query below works on one server, but fails on another:

INSERT INTO searches (status, uid, datecreated, searchname, options) 
VALUES (0, 1, NOW(), 'TEST', '16') RETURNING sid;

And I get this error:

Query failed: ERROR: syntax error at or near "RETURNING"

Am I missing something here?

+2  A: 

Query certainly looks right - assuming the field sid does exist (I take it it's a SERIAL field).

Are you sure you're using a PostgreSQL version that has support for RETURNING? You need version 8.2 or newer for this.

Magnus Hagander