Skip site navigation (1) Skip section navigation (2)

Re: RESULT_OID Bug

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Kevin McArthur <postgresql-list(at)stormtide(dot)ca>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: RESULT_OID Bug
Date: 2005-07-26 23:19:57
Message-ID: 20050726231957.GA85084@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, Jul 26, 2005 at 03:36:26PM -0700, Kevin McArthur wrote:
> Recent cvs versions are failing the following script;
> 
> create table oidtest(a time default now()) with oids;
> 
> CREATE OR REPLACE FUNCTION oidtest() RETURNS integer AS $oidtest$
>  DECLARE
>   insert_oid_var INTEGER;
>  BEGIN
>   INSERT INTO oidtest DEFAULT VALUES;
>   GET DIAGNOSTICS insert_oid_var = RESULT_OID;
>   RETURN insert_oid_var;
>  END;
> $oidtest$ Language plpgsql;
> 
> select oidtest();
> 
> if its working you will see an oid, if its failing you will see 1 row with blank data.

The function appears to work in a session until you replace it (or
drop and recreate it), after which you get NULL.  If you exit the
session and reconnect then it works again.  I checked 8.0.3 and it
doesn't have this problem.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-07-26 23:24:02
Subject: pgsql: Basic documentation for ROLEs.
Previous:From: Tom LaneDate: 2005-07-26 23:15:24
Subject: Re: Checkpoint cost, looks like it is WAL/CRC

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group