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

Re: BUG #2962: 8.2.1 lo_creat Documentation incorrect?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Gary Chambers" <gwchamb(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2962: 8.2.1 lo_creat Documentation incorrect?
Date: 2007-02-06 05:05:42
Message-ID: 29596.1170738342@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Gary Chambers" <gwchamb(at)gmail(dot)com> writes:
> 8.2.1 documentation, section 30.4:
> SELECT lo_creat(-1);       -- returns OID of new, empty large object

That works for me ...

> The documentation states that a new, empty oid is returned if -1 is passed
> to either lo_creat or lo_create.  

It says no such thing about lo_create().  Now AFAICS lo_creat() doesn't
pay any attention to its argument --- the fact that it even takes one is
historical.  So -1 or any other input value would behave the same.
But lo_create(-1) would try to create a LO numbered 2^32-1 which would
work the first time and not thereafter.

> This returns 2^32-1 on every invocation.  Passing a zero seems to work
> correctly, however.

Looking at the code, it appears that lo_create(0) will behave like
lo_creat(), that is create a LO with an unspecified OID.

Your report seems a bit confused.  Want to test a little more and
try again?

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2007-02-06 05:09:56
Subject: Re: BUG #2963: PQprepare and transactions.
Previous:From: Stephan SzaboDate: 2007-02-06 03:25:49
Subject: Re: BUG #2961: NULL values in subselects force NOT IN to false

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