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
0effa088
Commit
0effa088
authored
Aug 26, 2007
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up usage of some deprecated APIs, particularly schema-unsafe
usage of RelationNameGetTupleDesc().
parent
08fc73c4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
34 deletions
+39
-34
contrib/hstore/hstore.sql.in
contrib/hstore/hstore.sql.in
+34
-30
contrib/hstore/hstore_op.c
contrib/hstore/hstore_op.c
+5
-3
contrib/hstore/uninstall_hstore.sql
contrib/hstore/uninstall_hstore.sql
+0
-1
No files found.
contrib/hstore/hstore.sql.in
View file @
0effa088
...
...
@@ -2,15 +2,17 @@ SET search_path = public;
BEGIN;
CREATE TYPE hstore;
CREATE FUNCTION hstore_in(cstring)
RETURNS hstore
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (isstrict)
;
LANGUAGE
C STRICT
;
CREATE FUNCTION hstore_out(hstore)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (isstrict)
;
LANGUAGE
C STRICT
;
CREATE TYPE hstore (
INTERNALLENGTH = -1,
...
...
@@ -22,7 +24,7 @@ CREATE TYPE hstore (
CREATE FUNCTION fetchval(hstore,text)
RETURNS text
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
CREATE OPERATOR -> (
LEFTARG = hstore,
...
...
@@ -33,12 +35,12 @@ CREATE OPERATOR -> (
CREATE FUNCTION isexists(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','exists'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
CREATE FUNCTION exist(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','exists'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
CREATE OPERATOR ? (
LEFTARG = hstore,
...
...
@@ -51,22 +53,22 @@ CREATE OPERATOR ? (
CREATE FUNCTION isdefined(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','defined'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
CREATE FUNCTION defined(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','defined'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
CREATE FUNCTION delete(hstore,text)
RETURNS hstore
AS 'MODULE_PATHNAME','delete'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
CREATE FUNCTION hs_concat(hstore,hstore)
RETURNS hstore
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
CREATE OPERATOR || (
LEFTARG = hstore,
...
...
@@ -77,12 +79,12 @@ CREATE OPERATOR || (
CREATE FUNCTION hs_contains(hstore,hstore)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
CREATE FUNCTION hs_contained(hstore,hstore)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
CREATE OPERATOR @> (
LEFTARG = hstore,
...
...
@@ -124,7 +126,7 @@ CREATE OPERATOR ~ (
CREATE FUNCTION tconvert(text,text)
RETURNS hstore
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (iscachable)
;
LANGUAGE
C IMMUTABLE
;
CREATE OPERATOR => (
LEFTARG = text,
...
...
@@ -135,43 +137,45 @@ CREATE OPERATOR => (
CREATE FUNCTION akeys(hstore)
RETURNS _text
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
CREATE FUNCTION avals(hstore)
RETURNS _text
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
CREATE FUNCTION skeys(hstore)
RETURNS setof text
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
CREATE FUNCTION svals(hstore)
RETURNS setof text
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict,iscachable);
create type hs_each as (key text, value text);
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION each(hstore)
RETURNS setof hs_each
CREATE FUNCTION each(IN hs hstore,
OUT key text,
OUT value text)
RETURNS SETOF record
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (isstrict,iscachable)
;
LANGUAGE
C STRICT IMMUTABLE
;
-- define the GiST support methods
CREATE TYPE ghstore;
CREATE FUNCTION ghstore_in(cstring)
RETURNS ghstore
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (isstrict)
;
LANGUAGE
C STRICT
;
CREATE FUNCTION ghstore_out(ghstore)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE
'C' with (isstrict)
;
LANGUAGE
C STRICT
;
CREATE TYPE ghstore (
INTERNALLENGTH = -1,
...
...
@@ -182,37 +186,37 @@ CREATE TYPE ghstore (
CREATE FUNCTION ghstore_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE
'C'
;
LANGUAGE
C
;
CREATE FUNCTION ghstore_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE
'C'
;
LANGUAGE
C
;
CREATE FUNCTION ghstore_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE
'C' WITH (isstrict)
;
LANGUAGE
C STRICT
;
CREATE FUNCTION ghstore_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE
'C'
;
LANGUAGE
C
;
CREATE FUNCTION ghstore_union(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE
'C'
;
LANGUAGE
C
;
CREATE FUNCTION ghstore_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE
'C'
;
LANGUAGE
C
;
CREATE FUNCTION ghstore_consistent(internal,internal,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE
'C'
;
LANGUAGE
C
;
-- register the opclass for indexing (not as default)
CREATE OPERATOR CLASS gist_hstore_ops
...
...
contrib/hstore/hstore_op.c
View file @
0effa088
...
...
@@ -595,8 +595,10 @@ each(PG_FUNCTION_ARGS)
memcpy
(
st
->
hs
,
hs
,
VARSIZE
(
hs
));
funcctx
->
user_fctx
=
(
void
*
)
st
;
tupdesc
=
RelationNameGetTupleDesc
(
"hs_each"
);
funcctx
->
slot
=
TupleDescGetSlot
(
tupdesc
);
/* Build a tuple descriptor for our result type */
if
(
get_call_result_type
(
fcinfo
,
NULL
,
&
tupdesc
)
!=
TYPEFUNC_COMPOSITE
)
elog
(
ERROR
,
"return type must be a row type"
);
funcctx
->
attinmeta
=
TupleDescGetAttInMetadata
(
tupdesc
);
MemoryContextSwitchTo
(
oldcontext
);
...
...
@@ -637,7 +639,7 @@ each(PG_FUNCTION_ARGS)
st
->
i
++
;
tuple
=
heap_formtuple
(
funcctx
->
attinmeta
->
tupdesc
,
dvalues
,
nulls
);
res
=
TupleGetDatum
(
funcctx
->
slot
,
tuple
);
res
=
HeapTupleGetDatum
(
tuple
);
pfree
(
DatumGetPointer
(
dvalues
[
0
]));
if
(
nulls
[
1
]
!=
'n'
)
...
...
contrib/hstore/uninstall_hstore.sql
View file @
0effa088
...
...
@@ -40,7 +40,6 @@ DROP FUNCTION gin_extract_hstore(internal, internal);
DROP
FUNCTION
gin_extract_hstore_query
(
internal
,
internal
,
smallint
);
DROP
TYPE
hstore
CASCADE
;
DROP
TYPE
hs_each
CASCADE
;
DROP
TYPE
ghstore
CASCADE
;
COMMIT
;
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