Re: [GENERAL] Custom functions for default values for columns on insert

2007-08-14 Thread Tom Lane
"Lim Berger" <[EMAIL PROTECTED]> writes: > create table test (id serial primary key, nowd timestamp without time > zone, processed_id varchar(10)); > create or replace rule test_ins as on insert to test > DO UPDATE test > SET processed_id = MYFUNCTION(NEW.id) > WHERE id = NEW.id > ; I thin

[GENERAL] Custom functions for default values for columns on insert

2007-08-14 Thread Lim Berger
The "default" values of a column during table definition do not accept values generated by passing another column's value through my own function. So I try to do this with a rule as follows. The name of my function in this example is MYFUNCTION. drop table test cascade; create table test (id ser