Re: [GENERAL] OLD. || myColumnNameVar (How to generically access columns in a trigger's OLD or NEW records)

2011-08-24 Thread ivan_14_32
01.05.2011 12:58, Basil Bourque wrote: Hoorah! I was able to complete my single PL/pgSQL function to create history records tracking individual field value changes generically for all my tables. Some developers call this an audit trail, though an accountant might say otherwise. I made

Re: [GENERAL] OLD. || myColumnNameVar (How to generically access columns in a trigger's OLD or NEW records)

2011-08-24 Thread Merlin Moncure
On Wed, Aug 24, 2011 at 1:03 PM, ivan_14_32 ivan_14...@mail.ru wrote: 01.05.2011 12:58, Basil Bourque wrote: Hoorah! I was able to complete my single PL/pgSQL function to create history records tracking individual field value changes generically for all my tables. Some developers call this an

Re: [GENERAL] OLD. || myColumnNameVar (How to generically access columns in a trigger's OLD or NEW records)

2011-05-01 Thread Sim Zacks
On 04/28/2011 10:46 PM, Basil Bourque wrote: In PL/pgSQL, how does one generically access the fields of the OLD or NEW record? I've tried code such as this: 'NEW.' || quote_ident( myColumnNameVar ) || '::varchar' But when run by an EXECUTE command, I get errors such as: ERROR: missing

Re: [GENERAL] OLD. || myColumnNameVar (How to generically access columns in a trigger's OLD or NEW records)

2011-05-01 Thread Basil Bourque
Hoorah! I was able to complete my single PL/pgSQL function to create history records tracking individual field value changes generically for all my tables. Some developers call this an audit trail, though an accountant might say otherwise. Thanks for all the replies. Special thanks to John

[GENERAL] OLD. || myColumnNameVar (How to generically access columns in a trigger's OLD or NEW records)

2011-04-28 Thread Basil Bourque
In PL/pgSQL, how does one generically access the fields of the OLD or NEW record? I've tried code such as this: 'NEW.' || quote_ident( myColumnNameVar ) || '::varchar' But when run by an EXECUTE command, I get errors such as: ERROR: missing FROM-clause entry for table old SQL state:

Re: [GENERAL] OLD. || myColumnNameVar (How to generically access columns in a trigger's OLD or NEW records)

2011-04-28 Thread hubert depesz lubaczewski
On Thu, Apr 28, 2011 at 12:46:50PM -0700, Basil Bourque wrote: In PL/pgSQL, how does one generically access the fields of the OLD or NEW record? I've tried code such as this: 'NEW.' || quote_ident( myColumnNameVar ) || '::varchar' But when run by an EXECUTE command, I get errors such

Re: [GENERAL] OLD. || myColumnNameVar (How to generically access columns in a trigger's OLD or NEW records)

2011-04-28 Thread John DeSoi
On Apr 28, 2011, at 3:46 PM, Basil Bourque wrote: It seems that I cannot get PL/pgSQL to interpret the text of NEW. + column name as text. My goal is to loop each field in a trigger, comparing the OLD. NEW. values of each field. If different I want to log both values in a