1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Add a bunch of pseudo-types to replace the behavior formerly associated

with OPAQUE, as per recent pghackers discussion.  I still want to do some
more work on the 'cstring' pseudo-type, but I'm going to commit the bulk
of the changes now before the tree starts shifting under me ...
This commit is contained in:
Tom Lane
2002-08-22 00:01:51 +00:00
parent 606c9b9d4f
commit b663f3443b
126 changed files with 2005 additions and 1205 deletions

View File

@ -99,14 +99,6 @@ cube_in(char *str)
return ((NDBOX *) result);
}
/*
* You might have noticed a slight inconsistency between the following
* declaration and the SQL definition:
* CREATE FUNCTION cube_out(opaque) RETURNS opaque ...
* The reason is that the argument pass into cube_out is really just a
* pointer. POSTGRES thinks all output functions are:
* char *out_func(char *);
*/
char *
cube_out(NDBOX *cube)
{

View File

@ -5,13 +5,13 @@ BEGIN TRANSACTION;
-- Adjust this setting to control where the objects get created.
SET search_path = public;
CREATE FUNCTION cube_in(opaque)
RETURNS opaque
CREATE FUNCTION cube_in(cstring)
RETURNS cube
AS 'MODULE_PATHNAME'
LANGUAGE 'c' WITH (isStrict);
CREATE FUNCTION cube_out(opaque)
RETURNS opaque
CREATE FUNCTION cube_out(cube)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c' WITH (isStrict);
@ -192,25 +192,25 @@ CREATE OPERATOR ~ (
-- define the GiST support methods
CREATE FUNCTION g_cube_consistent(opaque,cube,int4) RETURNS bool
CREATE FUNCTION g_cube_consistent(internal,cube,int4) RETURNS bool
AS 'MODULE_PATHNAME' LANGUAGE 'c';
CREATE FUNCTION g_cube_compress(opaque) RETURNS opaque
CREATE FUNCTION g_cube_compress(internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
CREATE FUNCTION g_cube_decompress(opaque) RETURNS opaque
CREATE FUNCTION g_cube_decompress(internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
CREATE FUNCTION g_cube_penalty(opaque,opaque,opaque) RETURNS opaque
CREATE FUNCTION g_cube_penalty(internal,internal,internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c' with (isstrict);
CREATE FUNCTION g_cube_picksplit(opaque, opaque) RETURNS opaque
CREATE FUNCTION g_cube_picksplit(internal, internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
CREATE FUNCTION g_cube_union(bytea, opaque) RETURNS cube
CREATE FUNCTION g_cube_union(bytea, internal) RETURNS cube
AS 'MODULE_PATHNAME' LANGUAGE 'c';
CREATE FUNCTION g_cube_same(cube, cube, opaque) RETURNS opaque
CREATE FUNCTION g_cube_same(cube, cube, internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
@ -226,13 +226,13 @@ CREATE OPERATOR CLASS gist_cube_ops
OPERATOR 6 = ,
OPERATOR 7 @ ,
OPERATOR 8 ~ ,
FUNCTION 1 g_cube_consistent (opaque, cube, int4),
FUNCTION 2 g_cube_union (bytea, opaque),
FUNCTION 3 g_cube_compress (opaque),
FUNCTION 4 g_cube_decompress (opaque),
FUNCTION 5 g_cube_penalty (opaque, opaque, opaque),
FUNCTION 6 g_cube_picksplit (opaque, opaque),
FUNCTION 7 g_cube_same (cube, cube, opaque);
FUNCTION 1 g_cube_consistent (internal, cube, int4),
FUNCTION 2 g_cube_union (bytea, internal),
FUNCTION 3 g_cube_compress (internal),
FUNCTION 4 g_cube_decompress (internal),
FUNCTION 5 g_cube_penalty (internal, internal, internal),
FUNCTION 6 g_cube_picksplit (internal, internal),
FUNCTION 7 g_cube_same (cube, cube, internal);
END TRANSACTION;