The following bug has been logged online: Bug reference: 1604 Logged by: Chris Trawick Email address: [EMAIL PROTECTED] PostgreSQL version: 8.0.1 Operating system: i686-pc-linux-gnu, compiled by GCC i686-pc-linux-gnu-gcc (GCC) 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) Description: Composite types, triggers, and INET_CLIENT_ADDR() function Details:
I'm encountering an error when using a plpgsql insert trigger to automatically log the client connection information using INET_CLIENT_ADDR(). No changes from default install configuration. Fresh PG_DATA install. Here's my test case: CREATE TYPE SocketAddress AS( addr INET, port INT ); CREATE TABLE BugTable( intValue int NOT NULL, clientAddr SocketAddress NOT NULL ); CREATE FUNCTION BugTable_setClientAddr() RETURNS TRIGGER AS $$ BEGIN NEW.clientAddr := (INET_CLIENT_ADDR(),INET_CLIENT_PORT()); RETURN NEW; END; $$ LANGUAGE plpgsql; CREATE TRIGGER BugTable_onInsert_setClientAddr BEFORE INSERT ON BugTable FOR EACH ROW EXECUTE PROCEDURE BugTable_setClientAddr(); $ psql -h localhost ctrawick=# SELECT version(); version ---------------------------------------------------------------------------- ----------------------------------------------------------------- PostgreSQL 8.0.1 on i686-pc-linux-gnu, compiled by GCC i686-pc-linux-gnu-gcc (GCC) 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) (1 row) ctrawick=# \set VERBOSITY verbose ctrawick=# INSERT INTO BugTable(intValue) VALUES(0); ERROR: XX000: could not find block containing chunk 0x83664e8 CONTEXT: PL/pgSQL function "bugtable_setclientaddr" line 2 at assignment LOCATION: AllocSetFree, aset.c:786 ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match