Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
9ab7ab51
Commit
9ab7ab51
authored
Dec 31, 2002
by
Hiroshi Inoue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add casts between lo and oid.
parent
699782b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
contrib/lo/lo.sql.in
contrib/lo/lo.sql.in
+8
-6
No files found.
contrib/lo/lo.sql.in
View file @
9ab7ab51
--
--
-- PostgreSQL code for LargeObjects
-- PostgreSQL code for LargeObjects
--
--
-- $Id: lo.sql.in,v 1.
8 2002/10/18 18:41:20 momjian
Exp $
-- $Id: lo.sql.in,v 1.
9 2002/12/31 10:22:03 inoue
Exp $
--
--
--
--
-- Create the data type
-- Create the data type
...
@@ -17,13 +17,13 @@ SET autocommit TO 'on';
...
@@ -17,13 +17,13 @@ SET autocommit TO 'on';
CREATE FUNCTION lo_in(cstring)
CREATE FUNCTION lo_in(cstring)
RETURNS lo
RETURNS lo
AS 'MODULE_PATHNAME'
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE 'C'
IMMUTABLE
;
-- used by the lo type, it returns the oid of the object
-- used by the lo type, it returns the oid of the object
CREATE FUNCTION lo_out(lo)
CREATE FUNCTION lo_out(lo)
RETURNS cstring
RETURNS cstring
AS 'MODULE_PATHNAME'
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE 'C'
IMMUTABLE
;
-- finally the type itself
-- finally the type itself
CREATE TYPE lo (
CREATE TYPE lo (
...
@@ -37,7 +37,7 @@ CREATE TYPE lo (
...
@@ -37,7 +37,7 @@ CREATE TYPE lo (
CREATE FUNCTION lo_oid(lo)
CREATE FUNCTION lo_oid(lo)
RETURNS oid
RETURNS oid
AS 'MODULE_PATHNAME'
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE 'C'
IMMUTABLE
;
-- same function, named to allow it to be used as a type coercion, eg:
-- same function, named to allow it to be used as a type coercion, eg:
-- CREATE TABLE a (image lo);
-- CREATE TABLE a (image lo);
...
@@ -46,14 +46,16 @@ LANGUAGE 'C';
...
@@ -46,14 +46,16 @@ LANGUAGE 'C';
CREATE FUNCTION oid(lo)
CREATE FUNCTION oid(lo)
RETURNS oid
RETURNS oid
AS 'MODULE_PATHNAME', 'lo_oid'
AS 'MODULE_PATHNAME', 'lo_oid'
LANGUAGE 'C';
LANGUAGE 'C' IMMUTABLE;
CREATE CAST (lo as oid) WITH FUNCTION oid(lo) AS IMPLICIT;
-- this allows us to convert an oid to a managed lo object
-- this allows us to convert an oid to a managed lo object
-- ie: insert into test values (lo_import('/fullpath/file')::lo);
-- ie: insert into test values (lo_import('/fullpath/file')::lo);
CREATE FUNCTION lo(oid)
CREATE FUNCTION lo(oid)
RETURNS lo
RETURNS lo
AS 'MODULE_PATHNAME'
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE 'C' IMMUTABLE;
CREATE CAST (oid as lo) WITH FUNCTION lo(oid) AS IMPLICIT;
-- This is used in triggers
-- This is used in triggers
CREATE FUNCTION lo_manage()
CREATE FUNCTION lo_manage()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment