Re: [SQL] sintax error

2010-02-19 Thread Tom Lane
Richard Huxton writes: > I thought it was the PERFORM statements, but it's not. The line number > seems right, although the error message is misleading. FWIW, things are better in HEAD: regression=# create function foo() returns int as $$ regression$# begin regression$# return; regression$# e

Re: [SQL] Unable to get UPDATE ... FROM syntax correct

2010-02-19 Thread Richard Huxton
On 19/02/10 10:58, Gordon Ross wrote: On 19/02/2010 10:36, "Richard Huxton" wrote: Works here - are you sure you don't have any triggers interfering? Doh ! *blush* Yes, I did, to stop anyone tampering with the audit table ;-) There you go - it worked :-) -- Richard Huxton Archonet Lt

Re: [SQL] Unable to get UPDATE ... FROM syntax correct

2010-02-19 Thread Gordon Ross
On 19/02/2010 10:36, "Richard Huxton" wrote: > Works here - are you sure you don't have any triggers interfering? Doh ! *blush* Yes, I did, to stop anyone tampering with the audit table ;-) Thanks for that. GTG -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes t

Re: [SQL] sintax error

2010-02-19 Thread Richard Huxton
On 19/02/10 07:52, iuri de araujo sampaio wrote: Hi there, i have got the followed error in the pgsql function bellow. Log messages point to: ERROR: syntax error at end of input LINE 1: SELECT ^ QUERY: SELECT CONTEXT: SQL statement in PL/PgSQL function "cms_permission__revok

Re: [SQL] Unable to get UPDATE ... FROM syntax correct

2010-02-19 Thread Richard Huxton
On 19/02/10 09:25, Gordon Ross wrote: UPDATE audit SET key = extension.number FROM extension WHERE audit.record_id = extension.number; But that returns saying "UPDATE 0" Works here - are you sure you don't have any triggers interfering? BEGIN; CREATE TEMP TABLE audit ( idint,

Re: [SQL] Unable to get UPDATE ... FROM syntax correct

2010-02-19 Thread zkn
update audit set key = (select extension.number from extension where audit.record_id = extension_id) On 19.02.2010, at 11:25, Gordon Ross wrote: > I have two tables: > > Table "public.audit" > Column |Type | Modifiers > +--+-

Re: [SQL] Unable to get UPDATE ... FROM syntax correct

2010-02-19 Thread Gordon Ross
On 19/02/2010 10:28, "zkn" wrote: > update audit set key = (select extension.number from extension where > audit.record_id = extension_id) No joy, I still get "UPDATE 0" :-( GTG -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.pos

[SQL] sintax error

2010-02-19 Thread iuri de araujo sampaio
Hi there, i have got the followed error in the pgsql function bellow. Log messages point to: ERROR: syntax error at end of input LINE 1: SELECT ^ QUERY: SELECT CONTEXT: SQL statement in PL/PgSQL function "cms_permission__revoke_permission" near line 67 *

[SQL] Unable to get UPDATE ... FROM syntax correct

2010-02-19 Thread Gordon Ross
I have two tables: Table "public.audit" Column |Type | Modifiers +--+--- id | integer | (serial) record_id | integer | not null key| character varying| (...) Table