"Thomas F. O'Connell" <[EMAIL PROTECTED]> writes:
> now, this function works for existing records in the table 
> significant_records. but as i add records, i end up having to drop and 
> recreate the function in order for it to record the existence of the new 
> records.

This is hard to believe.

I am not sure that "if not found" means anything after a "select max()"
query.  The select will always return exactly one row --- even if it's
just a NULL --- so I'd expect the "if not found" never to succeed.
Perhaps you want to be testing whether v_significant_date is NULL or
not, instead.

Another issue, since you omitted the details of the view and of what
version you are running, is whether the view involves GROUP BY and/or
aggregates.  An aggregate over a grouped view won't work properly in
versions before 7.1.

If it's not those issues then we'll need more details --- preferably
a self-contained example.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to