From: Jouneau Luc <Luc.Jouneau@diamant.jouy.inra.fr>
To: Somasekhar Bangalore <sbangalore@zensutra.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Blob Data type in postgres ?
Date: Fri, 5 Sep 2003 13:59:46 +0200
Message-ID: <009201c373a5$340f1e70$4703668a@pc502jlo> (raw)
References: <BF493B193A334743AA9EF48945E69C134340DE@exchange.india.zensutra.com>
As far as I am concerned, I think that lobs are managed in postgres with oid.
Create your table like this :
CREATE TABLE table_of_lobs (
title varchar(100),
content_reference oid);
content_reference is a handler on lobs data contained in specials postgres system tables called Toast.
Create a rule to automatically destroy LOB data when you delete a tuple in table_of_lobs :
CREATE RULE del_table_of_lobs AS ON DELETE TO table_of_lobs
DO SELECT lo_unlink(old.content) AS lo_unlink;
Once you've created your table, use lo_import/lo_export functions to import/export your LOB data in a pgsql session (you must be super useer)
or use LOBS management functions available in libpq in order to interface lobs data management in your favorite program language.
Regards,
Luc Jouneau
----- Original Message -----
From: Somasekhar Bangalore
To: pgsql-admin@postgresql.org
Sent: Friday, September 05, 2003 12:41 PM
Subject: [ADMIN] Blob Data type in postgres ?
Hi ,
I would like to create a table with blob as a datatype.I found that postgres doesn't have a datatype called BLOB.
Is there any equivalent data type for this or a short cut ?
I appreciate if some one can help me in this regard.
Thank you all,
Regards,
Somasekhar Bangalore
Principal Software Engineer
ZenSutra Software Technologies Pvt. Ltd.
Suite 601, HM Geneva House
#14, Cunningham Road
Bangalore 560-052, India
Ph:+91-80-235-0481
Fax:+91-80-235-0486
Email: sbangalore@zensutra.com
Weaving the knowledge tapestry'
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: Luc.Jouneau@diamant.jouy.inra.fr, sbangalore@zensutra.com
Subject: Re: Blob Data type in postgres ?
In-Reply-To: <009201c373a5$340f1e70$4703668a@pc502jlo>
References: <BF493B193A334743AA9EF48945E69C134340DE@exchange.india.zensutra.com> <009201c373a5$340f1e70$4703668a@pc502jlo>
* 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