diff options
| author | Tom Lane | 2000-11-21 21:51:58 +0000 |
|---|---|---|
| committer | Tom Lane | 2000-11-21 21:51:58 +0000 |
| commit | cfbcb6bb21ed9bf06ffba723756ba24d440eb1ef (patch) | |
| tree | ae56cd7a900c2df0b8df6f6b979a83791a1d0a03 /contrib/lo/lo.sql.in | |
| parent | a70e74b060ab2769523ad831f571cb80122121d3 (diff) | |
Make the world safe for unsigned OIDs.
Diffstat (limited to 'contrib/lo/lo.sql.in')
| -rw-r--r-- | contrib/lo/lo.sql.in | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/lo/lo.sql.in b/contrib/lo/lo.sql.in index 9b340b196f..f9fed597fd 100644 --- a/contrib/lo/lo.sql.in +++ b/contrib/lo/lo.sql.in @@ -1,7 +1,7 @@ -- -- PostgreSQL code for LargeObjects -- --- $Id: lo.sql.in,v 1.5 2000/11/20 20:36:55 tgl Exp $ +-- $Id: lo.sql.in,v 1.6 2000/11/21 21:51:58 tgl Exp $ -- -- -- Create the data type @@ -33,6 +33,15 @@ create function lo_oid(lo) as 'MODULE_PATHNAME' language 'c'; +-- same function, named to allow it to be used as a type coercion, eg: +-- create table a (image lo); +-- select image::oid from a; +-- +create function oid(lo) + returns oid + as 'MODULE_PATHNAME', 'lo_oid' + language 'c'; + -- this allows us to convert an oid to a managed lo object -- ie: insert into test values (lo_import('/fullpath/file')::lo); create function lo(oid) @@ -44,13 +53,4 @@ create function lo(oid) create function lo_manage() returns opaque as 'MODULE_PATHNAME' - language 'C'; - --- This allows us to map lo to oid --- --- eg: --- create table a (image lo); --- select image::oid from a; --- -create function oid(lo) returns oid as 'select lo_oid($1)' language 'sql'; - + language 'c'; |
