Thread: large object unlinking

large object unlinking

From
"sandhya"
Date:
hi...
 
Is there any possibility to delete /Unlink  a group of large objects at a time?
Please tell me .To test my application i have loaded somany files into database.Now i want to unlink all those objects.
Please help me in doing this.......
 
Thanks,
Sandhya

Re: large object unlinking

From
Michael Fuhr
Date:
On Thu, Feb 23, 2006 at 01:24:43PM +0530, sandhya wrote:
> Is there any possibility to delete /Unlink  a group of large objects at a time?
> Please tell me .To test my application i have loaded somany files into database.
> Now i want to unlink all those objects.

You could call lo_unlink() in a query.  Example:

SELECT lo_unlink(loid) FROM (SELECT DISTINCT loid FROM foo) AS s;

See also contrib/vacuumlo, which will automatically remove large
objects that aren't referenced anywhere.

--
Michael Fuhr

Re: large object unlinking

From
"sandhya"
Date:
Thank You Fuhr.
In select lo_unlink(objid) from (select distinct objid from filetbl)AS s;
the above query what is that 'S' stands for in AS 'S'
Can u pls explain me.....



----- Original Message -----
From: "Michael Fuhr" <mike@fuhr.org>
To: "sandhya" <sandhyar@amiindia.co.in>
Cc: "Postgres" <pgsql-admin@postgresql.org>
Sent: Thursday, February 23, 2006 8:58 PM
Subject: Re: [ADMIN] large object unlinking


> On Thu, Feb 23, 2006 at 01:24:43PM +0530, sandhya wrote:
> > Is there any possibility to delete /Unlink  a group of large objects at
a time?
> > Please tell me .To test my application i have loaded somany files into
database.
> > Now i want to unlink all those objects.
>
> You could call lo_unlink() in a query.  Example:
>
> SELECT lo_unlink(loid) FROM (SELECT DISTINCT loid FROM foo) AS s;
>
> See also contrib/vacuumlo, which will automatically remove large
> objects that aren't referenced anywhere.
>
> --
> Michael Fuhr
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>



Re: large object unlinking

From
Michael Fuhr
Date:
On Fri, Feb 24, 2006 at 11:57:57AM +0530, sandhya wrote:
> In select lo_unlink(objid) from (select distinct objid from filetbl)AS s;
> the above query what is that 'S' stands for in AS 'S'

"s" is a table alias, which is required for a subquery.  The choice
of "s" is arbitrary; it can be any valid label.

http://www.postgresql.org/docs/8.1/interactive/queries-table-expressions.html#QUERIES-SUBQUERIES

--
Michael Fuhr