Re: [HACKERS] Re: CVS HEAD: Error accessing system column from plpgsql trigger function

2010-01-10 Thread Dean Rasheed
2010/1/10 Tom Lane : > > I've applied a patch along these lines. > Cool. Thanks, that works great. Cheers, Dean -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Re: CVS HEAD: Error accessing system column from plpgsql trigger function

2010-01-10 Thread Tom Lane
Dean Rasheed writes: > 2010/1/9 Tom Lane : >> I think that a variant of your idea could be made to work: change >> plpgsql_LookupIdentifiers to a three-state variable (which'd basically >> mean "in DECLARE, in a SQL expression, anywhere else"), do no lookups in >> DECLARE, and in SQL expressions d

Re: [HACKERS] Re: CVS HEAD: Error accessing system column from plpgsql trigger function

2010-01-09 Thread Dean Rasheed
2010/1/9 Tom Lane : > Dean Rasheed writes: >> I wonder if it might be better to have plpgsql_parse_dblword() ignore >> plpgsql_LookupIdentifiers, and always do the lookups. > > Not if you'd like things to still work. > OK, I admit that I'm totally new that area of code, so I'm not seeing it - wha

Re: [HACKERS] Re: CVS HEAD: Error accessing system column from plpgsql trigger function

2010-01-09 Thread Dean Rasheed
2010/1/9 Tom Lane : >> OK, I admit that I'm totally new that area of code, so I'm not seeing >> it - what does it break? > > The main problem is... Ah OK. Thanks for the explanation. > I think that a variant of your idea could be made to work: change > plpgsql_LookupIdentifiers to a three-state v

Re: [HACKERS] Re: CVS HEAD: Error accessing system column from plpgsql trigger function

2010-01-09 Thread Tom Lane
Dean Rasheed writes: > 2010/1/9 Tom Lane : >> Dean Rasheed writes: >>> I wonder if it might be better to have plpgsql_parse_dblword() ignore >>> plpgsql_LookupIdentifiers, and always do the lookups. >> Not if you'd like things to still work. > OK, I admit that I'm totally new that area of code,

Re: [HACKERS] Re: CVS HEAD: Error accessing system column from plpgsql trigger function

2010-01-09 Thread Tom Lane
Dean Rasheed writes: > I wonder if it might be better to have plpgsql_parse_dblword() ignore > plpgsql_LookupIdentifiers, and always do the lookups. Not if you'd like things to still work. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresq

Re: [HACKERS] Re: CVS HEAD: Error accessing system column from plpgsql trigger function

2010-01-09 Thread Dean Rasheed
2010/1/9 Tom Lane : > Dean Rasheed writes: >>> ERROR:  attribute number -1 exceeds number of columns 1 > > I guess your previous message slipped through the cracks --- sorry about > that.  It looks like the best fix is to teach ExecEvalFieldSelect that > references to system columns are OK.  Worki

Re: [HACKERS] Re: CVS HEAD: Error accessing system column from plpgsql trigger function

2010-01-09 Thread Tom Lane
Dean Rasheed writes: >> ERROR:  attribute number -1 exceeds number of columns 1 I guess your previous message slipped through the cracks --- sorry about that. It looks like the best fix is to teach ExecEvalFieldSelect that references to system columns are OK. Working on it now.

[HACKERS] Re: CVS HEAD: Error accessing system column from plpgsql trigger function

2010-01-09 Thread Dean Rasheed
2009/12/4 Dean Rasheed : > With CVS HEAD... > > create table foo (a int); > > create or replace function foo_trig_fn() returns trigger as $$ > begin >  raise notice 'In trigger: added %', new.ctid; >  return new; > end > $$ language plpgsql; > > create trigger foo_trig after insert on foo >  for ea