Here's a smallish script which reproduces the problem on 8.2RC1 / OSX:
If you comment out the 'and NEW.id not in (select t1_id from skip_t1_ids) ' clause in the trigger, then the script completes.
social=# \i 8.2.bug.sql BEGINpsql:8.2.bug.sql:15: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "t1"
CREATE TABLE CREATE TABLE CREATE SEQUENCE CREATE TABLE CREATE FUNCTION CREATE TRIGGER INSERT 0 1 INSERT 0 1 INSERT 0 1 INSERT 0 1 INSERT 0 1 psql:8.2.bug.sql:52: ERROR: cache lookup failed for function 0CONTEXT: SQL statement "SELECT $1 <> $2 and $3 not in (select t1_id from skip_t1_ids)"
PL/pgSQL function "track_t1_changes" line 2 at if ROLLBACK
8.2.bug.sql
Description: Binary data
---- James Robinson Socialserve.com
---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq