pl/pgsql noob - Mailing list pgsql-novice

From Don Patou
Subject pl/pgsql noob
Date
Msg-id 200306011912.09344.pknoob@noos.fr
Whole thread Raw
List pgsql-novice
I wanna use a function as a column default value. the problem is that I don't
know how to use a function as a default value (how to call it) and that my
function ain't working properly. so here is my function:

CREATE FUNCTION myfunction() RETURNS trigger AS '
    BEGIN
select count(episode.show_name) from episode where
episode.show_name=show.show_name;
return countshow;
end;
' LANGUAGE plpgsql;

this function is a query that counts how many show_name are in the table
episode, show_name is a foreign key from table show. the result is suppose to
go in the column count_show in table show.

thanx in advance

pgsql-novice by date:

Previous
From: Frank Bax
Date:
Subject: Re: Me again..nOOb alert
Next
From: Josh Berkus
Date:
Subject: Re: Me again..nOOb alert