Fwd: Re: [SQL] Blobs

From: Compte utilisateur Sultan-advl <webmaster(at)advl(dot)org>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: Fwd: Re: [SQL] Blobs
Date: 2000-01-24 16:16:07
Message-ID: 00012417171000.01945@sultan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

---------- Message rachemin ----------
Subject: Re: [SQL] Blobs
Date: Mon, 24 Jan 2000 17:07:05 +0100
From: Compte utilisateur Sultan-advl <webmaster(at)advl(dot)org>

You can find this in Postgresql documentation :
PostgreSQL
Prev
Chapter 44. Large Objects
Built in registered functions
There are two built-in registered functions, lo_import and lo_export which are convenient for use in SQL queries.
Here is an example of their use

CREATE TABLE image (
name text,
raster oid
);

INSERT INTO image (name, raster)
VALUES ('beautiful image', lo_import('/etc/motd'));

SELECT lo_export(image.raster, "/tmp/motd") from image
WHERE name = 'beautiful image';

Regards.
Emmanuel.

Le lun, 24 jan 2000, vous avez crit :
> >%_Hi Folks
>
> I want to store Word docs etc into the mighty Postgres. I think this means using blobs.
>
> 1.Does anybody know the SQL to create say a table with a field called docs to store them in. I don't know what the data type is.
>
> ie something like CREATE TABLE documents docs (blob datatype ??)
>
> 2. Is there some special syntax to get the blob back. ie SELECT (special syntax)
>
> Thanks
>
> Neil(at)blueice
>
>

----------------------------------------
Content-Type: text/html; name="unnamed"
Content-Transfer-Encoding: quoted-printable
Content-Description:
---------------------------------------

Browse pgsql-sql by date

  From Date Subject
Next Message Mark Volpe 2000-01-24 16:25:21 Backend crash
Previous Message Mark Volpe 2000-01-24 16:14:42 Backend crash