Re: [BUGS] General Bug Report: Large Object Example testlo fails

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mika Saari <Mika(dot)Saari(at)nokia(dot)com>
Cc: Vince Vielhaber <vev(at)michvhf(dot)com>, pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: [BUGS] General Bug Report: Large Object Example testlo fails
Date: 1999-07-15 14:22:45
Message-ID: 6134.932048565@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Mika(dot)Saari(at)nokia(dot)com writes:
> libpq++ Large Object Example testlo fails in PostgreSQL 6.5 but NOT
> in 6.4.2. The ERROR message is
> Connection to database 'template1' failed.
> PQsendQuery() -- There is no connection to the backend.

> 14. ./testlo template1 testlo test 0

It looks like testlo is now set up so that the first argument is a
conninfo string, not just a database name. So, something like

./testlo dbname=template1 testlo test 0

should work.

If the other method is still being recommended in some documentation
somewhere, then we need to fix that --- where did you find the info?

Also, I'd say that the error message here is pretty awful. Looks like
that's because PQconnectdb's original message about bogus syntax for a
conninfo string (which might actually have been helpful) is being
overwritten when the PgLargeObject constructors plow ahead with trying
to create and open a large object. They should not do that if the
underlying connection constructor failed :-(.

Finally, I don't particularly like the fact that both constructors for
PgLargeObject insist on creating and opening a LO. If you're going to
import() or export() you do not need an LO filehandle; and if you're
going to import() then the constructor-created LO is wasted, making
for a semi-permanent diskspace leak.

Perhaps the best way to design PgLargeObject is to make both creation
and opening "lazy", happening only at the first call that requires 'em.

regards, tom lane

Browse pgsql-bugs by date

  From Date Subject
Next Message Wayne Piekarski 1999-07-16 08:28:33 Backend dies creating plpgsql procedures (with reproducible example!)
Previous Message Unprivileged user 1999-07-15 07:52:37 General Bug Report: Large Object Example testlo fails