Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
9ab7ab51
Commit
9ab7ab51
authored
22 years ago
by
Hiroshi Inoue
Browse files
Options
Downloads
Patches
Plain Diff
Add casts between lo and oid.
parent
699782b6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/lo/lo.sql.in
+8
-6
8 additions, 6 deletions
contrib/lo/lo.sql.in
with
8 additions
and
6 deletions
contrib/lo/lo.sql.in
+
8
−
6
View file @
9ab7ab51
--
-- PostgreSQL code for LargeObjects
--
-- $Id: lo.sql.in,v 1.
8
2002/1
0/18 18:41:20 momjian
Exp $
-- $Id: lo.sql.in,v 1.
9
2002/1
2/31 10:22:03 inoue
Exp $
--
--
-- Create the data type
...
...
@@ -17,13 +17,13 @@ SET autocommit TO 'on';
CREATE FUNCTION lo_in(cstring)
RETURNS lo
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE 'C'
IMMUTABLE
;
-- used by the lo type, it returns the oid of the object
CREATE FUNCTION lo_out(lo)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE 'C'
IMMUTABLE
;
-- finally the type itself
CREATE TYPE lo (
...
...
@@ -37,7 +37,7 @@ CREATE TYPE lo (
CREATE FUNCTION lo_oid(lo)
RETURNS oid
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE 'C'
IMMUTABLE
;
-- same function, named to allow it to be used as a type coercion, eg:
-- CREATE TABLE a (image lo);
...
...
@@ -46,14 +46,16 @@ LANGUAGE 'C';
CREATE FUNCTION oid(lo)
RETURNS 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
-- ie: insert into test values (lo_import('/fullpath/file')::lo);
CREATE FUNCTION lo(oid)
RETURNS lo
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE 'C' IMMUTABLE;
CREATE CAST (oid as lo) WITH FUNCTION lo(oid) AS IMPLICIT;
-- This is used in triggers
CREATE FUNCTION lo_manage()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment