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

Re: create large object by tcl

From: L J Bayuk <ljb220(at)mindspring(dot)com>
To: hehe88hk(at)yahoo(dot)com(dot)hk (=?big5?q?Wong=20Eric?=)
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: create large object by tcl
Date: 2004-02-23 01:09:09
Message-ID: 200402230109.i1N199pP001050@mindspring.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
> However, I would like to ask why a transaction is
> needed for accessing large object?

Here's how I understand it. If I get it badly wrong, perhaps someone
else will step in and correct me.

The PostgreSQL database server creates a context in which to store
information it needs to process commands.  If you don't start a transaction
block with BEGIN, a new context is created for each command, and destroyed
after the command is processed.  If you use BEGIN to start a transaction
block, the context stays around until you use COMMIT or ROLLBACK to end the
transaction block.

Large object file descriptors, like cursors, are stored in this context.
So if you open a large object outside a transaction block, the large object
file descriptor you get back is invalid, because the context it was created
in was already destroyed.

In response to

pgsql-interfaces by date

Next:From: Richard HuxtonDate: 2004-02-23 07:58:30
Subject: Re: System tuning
Previous:From: Cornelia BoenigkDate: 2004-02-22 23:10:52
Subject: Re: problem with cursur within a scriptfile

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