Re: pqlib large object error

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pqlib large object error
Дата
Msg-id 27739.1213147492@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pqlib large object error  (Edward Amsden <amsden_linux@embarqmail.com>)
Ответы Re: pqlib large object error  (Edward Amsden <amsden_linux@embarqmail.com>)
Список pgsql-interfaces
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


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Edward Amsden
Дата:
Сообщение: Re: pqlib large object error
Следующее
От: Edward Amsden
Дата:
Сообщение: Re: pqlib large object error