"Thomas F. O'Connell" <tfo(at)monsterlabs(dot)com> 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
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
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
In response to
pgsql-general by date
|Next:||From: Dr. Evil||Date: 2001-04-30 18:31:35|
|Subject: chr() command in PG7.03?|
|Previous:||From: Dan Wilson||Date: 2001-04-30 16:45:03|
|Subject: Dynamic Queries in pl/pgsql [w/variable substitution]|