pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Edward Amsden <amsden_linux@embarqmail.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: pqlib large object error
Date: Tue, 10 Jun 2008 21:24:52 -0400
Message-ID: <27739.1213147492@sss.pgh.pa.us> (raw)
In-Reply-To: <1213146291.19203.4.camel@dad-desktop2>
References: <1213118594.9123.11.camel@dad-desktop2>
	<21991.1213122593@sss.pgh.pa.us>
	<1213130242.15557.3.camel@dad-desktop2>
	<24396.1213130996@sss.pgh.pa.us>
	<1213134089.15557.22.camel@dad-desktop2>
	<26209.1213139125@sss.pgh.pa.us>
	<1213146291.19203.4.camel@dad-desktop2>

Edward Amsden <amsden_linux@embarqmail.com> writes:
> Thanks for all your help. I'm somewhat amateur with C and even less
> experienced with PostgreSQL (I'm a recent MySQL convert). Even after
> some googling, I have no idea what this BEGIN block is. Is it C or is it
> SQL? That probably makes me a n00b. :-|

You need a SQL "BEGIN" (or "START TRANSACTION") command and a SQL
"COMMIT" (or "END") command around anything that involves having a
large object descriptor open.  It might help to look at the sample
program here:

http://www.postgresql.org/docs/8.3/static/lo-examplesect.html

It's not amazingly well commented :-(, but the lines

	res = PQexec(conn, "begin");
	res = PQexec(conn, "end");

are *not* optional.

Meanwhile, I'm still wondering what happened to your pg_largeobject
index.  You said you saw the problem in multiple databases, which
suggests that the index was broken in template1 and then the damage
was propagated to other databases by CREATE DATABASE.  Can you still
see a problem if you make your program connect to some other database?

			regards, tom lane



view thread (13+ messages)  latest in thread

Message-ID: <27739.1213147492@sss.pgh.pa.us>
Permalink:  ../27739.1213147492@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27739.1213147492@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, amsden_linux@embarqmail.com
  Subject: Re: pqlib large object error
  In-Reply-To: <27739.1213147492@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox