BUG #2962: 8.2.1 lo_creat Documentation incorrect?

Started by Gary Chambersabout 19 years ago3 messagesbugs
Jump to latest
#1Gary Chambers
gwchamb@gmail.com

The following bug has been logged online:

Bug reference: 2962
Logged by: Gary Chambers
Email address: gwchamb@gmail.com
PostgreSQL version: 8.2.1
Operating system: RHEL WS 4 (2.6.9-42.0.3.EL)
Description: 8.2.1 lo_creat Documentation incorrect?
Details:

8.2.1 documentation, section 30.4:

SELECT lo_creat(-1); -- returns OID of new, empty large object

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

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Gary Chambers (#1)
Re: BUG #2962: 8.2.1 lo_creat Documentation incorrect?

"Gary Chambers" <gwchamb@gmail.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

#3Gary Chambers
gwchamb@gmail.com
In reply to: Tom Lane (#2)
Re: BUG #2962: 8.2.1 lo_creat Documentation incorrect?

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

Nonsense! My report is not confused at all. The reporter, on the
other hand, is -- was! I apologize for the bogus report. I hope to
someday redeem myself for my inattention to detail.

-- Gary Chambers

// Nothing fancy and nothing Microsoft!