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

Problems with lo_unlink

From: "Carlos J(dot) Garcia Orellana" <carlos(at)nernet(dot)unex(dot)es>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Problems with lo_unlink
Date: 1998-08-30 17:15:29
Message-ID: 000601bdd439$ca55ffe0$ (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

Is it 'lo_unlink' a secure function?.
I've problems with it. I'm using a database with large objects (images) and
I've problems
with that, this problems are:

* Sometimes, when I tried to export a large object with SQL command:

        SELECT lo_export(oid '65570', '/tmp/myfile')

the backend says to me:

        ERROR: xinx65560 is a index relation.

I see that the oids of 'xinv65570' and 'xinx65560' are the same. So, when I
say to postgres  that I want  to export the oid 65570, it thinks that I want
the index xinx65560.
I fix this problem using the function 'heap_openr' in 'inv_open' instead of
'heap_open'. With this change, I always open a 'xinvXXXX'. I've made this
change in 'inv_destroy', too.

* The other problem is related the function 'lo_unlink'. I think that when I
destroy a large object, I destroy its index, then, if I do:

        SELECT lo_unlink( int4 '65560')

I'm sure that I destroy the object 'xinv65560' (because I've changed the
'heap_open' by 'heap_openr'), and if the backend attempts to destroy the
index (whose oid is 65570), and as it's the same oid that the large object
'xinv65570' , it's possible the backend destroy that large object instead of
the index.

Well, my questions are:

* Is this true?, Is it like I think?.

* Are there some solutions for these problems?


(Please answer to me at: carlos(at)nernet(dot)unex(dot)es)

Carlos J. Garcia Orellana.
Universidad de Extramadura - Badajoz

pgsql-hackers by date

Next:From: Peter T MountDate: 1998-08-30 17:44:40
Subject: Re: [HACKERS] pgindent for Monday
Previous:From: Tom LaneDate: 1998-08-30 16:50:55
Subject: Re: [HACKERS] flock patch breaks things here

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