From: L J Bayuk <ljb220@mindspring.com>
To: hehe88hk@yahoo.com.hk
Cc: pgsql-interfaces@postgresql.org
Subject: Re: create large object by tcl
Date: Sun, 22 Feb 2004 20:09:09 -0500 (EST)
Message-ID: <200402230109.i1N199pP001050@mindspring.com> (raw)
In-Reply-To: <20040222141220.75395.qmail@web14908.mail.yahoo.com>
> 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.
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: ljb220@mindspring.com, hehe88hk@yahoo.com.hk
Subject: Re: create large object by tcl
In-Reply-To: <200402230109.i1N199pP001050@mindspring.com>
* 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