On Wed, Jul 27, 2005 at 12:08:18AM -0400, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > Is anybody with a deeper understanding of the code looking at this? > > I tried to reproduce the problem ... no joy ...
Hmmm...not even with the example that starts from initdb? I'm up to date with the latest commits and I can consistently reproduce it. I was just about to post that TRUNCATE apparently "fixes" the problem: CREATE TABLE foo (t timestamptz DEFAULT now()) WITH OIDS; CREATE OR REPLACE FUNCTION oidtest() RETURNS integer AS $$ DECLARE foo_count integer; foo_oid integer; BEGIN EXECUTE 'INSERT INTO foo DEFAULT VALUES'; GET DIAGNOSTICS foo_count = ROW_COUNT; GET DIAGNOSTICS foo_oid = RESULT_OID; RAISE INFO 'ROW_COUNT = %, RESULT_OID = %', foo_count, foo_oid; RETURN foo_oid; END; $$ LANGUAGE plpgsql VOLATILE; SELECT oidtest(); INFO: ROW_COUNT = 1, RESULT_OID = 17008 oidtest --------- 17008 (1 row) CREATE OR REPLACE FUNCTION oidtest() RETURNS integer AS $$ DECLARE foo_count integer; foo_oid integer; BEGIN EXECUTE 'INSERT INTO foo DEFAULT VALUES'; GET DIAGNOSTICS foo_count = ROW_COUNT; GET DIAGNOSTICS foo_oid = RESULT_OID; RAISE INFO 'ROW_COUNT = %, RESULT_OID = %', foo_count, foo_oid; RETURN foo_oid; END; $$ LANGUAGE plpgsql VOLATILE; SELECT oidtest(); INFO: ROW_COUNT = <NULL>, RESULT_OID = <NULL> oidtest --------- (1 row) TRUNCATE foo; SELECT oidtest(); INFO: ROW_COUNT = 1, RESULT_OID = 17011 oidtest --------- 17011 (1 row) Could this be platform-specific? Right now I can only test with Solaris 9/sparc, but if necessary I could build HEAD on FreeBSD 4.11-STABLE/i386. Kevin, what platform are you using? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend