All pastes #46311 Raw Edit

Miscellany

public text v1 · immutable
#46311 ·published 2006-03-20 04:23 UTC
rendered paste body
vmail=>  CREATE FUNCTION creat_luser_en_serv_func  () returns trigger as '
vmail'> begin
vmail'> 
vmail'>  INSERT INTO luser_services DEFAULT VALUES ;
vmail'>  UPDATE luser SET enabled_services = currval(luser_services_id_seq) where id = curval(luser_id_seq);
vmail'> end;
vmail'> ' Language plpgsql;
CREATE FUNCTION
vmail=> CREATE TRIGGER creat_luser_en_serv_trig after insert on luser for each row execute procedure creat_luser_en_serv_func(); 
CREATE TRIGGER
vmail=> INSERT INTO luser ( irlname, irladdress, oldmail, passwrd, login) VALUES ( 'foo bar', 'somestreet 32323 n', 'foo@bar.net', 'asdf', 'foobar' );
ERROR:  column "luser_services_id_seq" does not exist
CONTEXT:  PL/pgSQL function "creat_luser_en_serv_func" line 4 at SQL statement