SET search_path = public;
-- create type of int4 key
-CREATE FUNCTION int4key_in(opaque)
-RETURNS opaque
+CREATE FUNCTION int4key_in(cstring)
+RETURNS int4key
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION int4key_out(opaque)
-RETURNS opaque
+CREATE FUNCTION int4key_out(int4key)
+RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
--
--
-- define the GiST support methods
-create function gint4_consistent(opaque,int4,int2) returns bool as 'MODULE_PATHNAME' language 'C';
+create function gint4_consistent(internal,int4,int2) returns bool as 'MODULE_PATHNAME' language 'C';
-create function gint4_compress(opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function gint4_compress(internal) returns internal as 'MODULE_PATHNAME' language 'C';
-create function btree_decompress(opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function btree_decompress(internal) returns internal as 'MODULE_PATHNAME' language 'C';
-create function gint4_penalty(opaque,opaque,opaque) returns opaque as 'MODULE_PATHNAME' language 'C' with(isstrict);
+create function gint4_penalty(internal,internal,internal) returns internal as 'MODULE_PATHNAME' language 'C' with(isstrict);
-create function gint4_picksplit(opaque, opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function gint4_picksplit(internal, internal) returns internal as 'MODULE_PATHNAME' language 'C';
-create function gint4_union(bytea, opaque) returns int4 as 'MODULE_PATHNAME' language 'C';
+create function gint4_union(bytea, internal) returns int4 as 'MODULE_PATHNAME' language 'C';
-create function gint4_same(opaque, opaque, opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function gint4_same(internal, internal, internal) returns internal as 'MODULE_PATHNAME' language 'C';
-- Create the operator class
CREATE OPERATOR CLASS gist_int4_ops
OPERATOR 3 = ,
OPERATOR 4 >= ,
OPERATOR 5 > ,
- FUNCTION 1 gint4_consistent (opaque, int4, int2),
- FUNCTION 2 gint4_union (bytea, opaque),
- FUNCTION 3 gint4_compress (opaque),
- FUNCTION 4 btree_decompress (opaque),
- FUNCTION 5 gint4_penalty (opaque, opaque, opaque),
- FUNCTION 6 gint4_picksplit (opaque, opaque),
- FUNCTION 7 gint4_same (opaque, opaque, opaque),
+ FUNCTION 1 gint4_consistent (internal, int4, int2),
+ FUNCTION 2 gint4_union (bytea, internal),
+ FUNCTION 3 gint4_compress (internal),
+ FUNCTION 4 btree_decompress (internal),
+ FUNCTION 5 gint4_penalty (internal, internal, internal),
+ FUNCTION 6 gint4_picksplit (internal, internal),
+ FUNCTION 7 gint4_same (internal, internal, internal),
STORAGE int4key;
--
-- create type of timestamp key
-CREATE FUNCTION tskey_in(opaque)
-RETURNS opaque
+CREATE FUNCTION tskey_in(cstring)
+RETURNS tskey
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION tskey_out(opaque)
-RETURNS opaque
+CREATE FUNCTION tskey_out(tskey)
+RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
output = tskey_out
);
-create function gts_consistent(opaque,timestamp,int2) returns bool as 'MODULE_PATHNAME' language 'C';
+create function gts_consistent(internal,timestamp,int2) returns bool as 'MODULE_PATHNAME' language 'C';
-create function gts_compress(opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function gts_compress(internal) returns internal as 'MODULE_PATHNAME' language 'C';
-create function gts_penalty(opaque,opaque,opaque) returns opaque as 'MODULE_PATHNAME' language 'C' with(isstrict);
+create function gts_penalty(internal,internal,internal) returns internal as 'MODULE_PATHNAME' language 'C' with(isstrict);
-create function gts_picksplit(opaque, opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function gts_picksplit(internal, internal) returns internal as 'MODULE_PATHNAME' language 'C';
-create function gts_union(bytea, opaque) returns int4 as 'MODULE_PATHNAME' language 'C';
+create function gts_union(bytea, internal) returns int4 as 'MODULE_PATHNAME' language 'C';
-create function gts_same(opaque, opaque, opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function gts_same(internal, internal, internal) returns internal as 'MODULE_PATHNAME' language 'C';
-- Create the operator class
CREATE OPERATOR CLASS gist_timestamp_ops
OPERATOR 3 = ,
OPERATOR 4 >= ,
OPERATOR 5 > ,
- FUNCTION 1 gts_consistent (opaque, timestamp, int2),
- FUNCTION 2 gts_union (bytea, opaque),
- FUNCTION 3 gts_compress (opaque),
- FUNCTION 4 btree_decompress (opaque),
- FUNCTION 5 gts_penalty (opaque, opaque, opaque),
- FUNCTION 6 gts_picksplit (opaque, opaque),
- FUNCTION 7 gts_same (opaque, opaque, opaque),
+ FUNCTION 1 gts_consistent (internal, timestamp, int2),
+ FUNCTION 2 gts_union (bytea, internal),
+ FUNCTION 3 gts_compress (internal),
+ FUNCTION 4 btree_decompress (internal),
+ FUNCTION 5 gts_penalty (internal, internal, internal),
+ FUNCTION 6 gts_picksplit (internal, internal),
+ FUNCTION 7 gts_same (internal, internal, internal),
STORAGE tskey;
-- darcy@druid.net
-- http://www.druid.net/darcy/
--
--- $Header: /cvsroot/pgsql/contrib/chkpass/chkpass.sql.in,v 1.1 2001/08/23 16:50:33 tgl Exp $
+-- $Header: /cvsroot/pgsql/contrib/chkpass/chkpass.sql.in,v 1.2 2002/08/22 00:01:38 tgl Exp $
--
-- best viewed with tabs set to 4
--
-- Input and output functions and the type itself:
--
-create function chkpass_in(opaque)
- returns opaque
+create function chkpass_in(cstring)
+ returns chkpass
as 'MODULE_PATHNAME'
language 'c';
-create function chkpass_out(opaque)
- returns opaque
+create function chkpass_out(chkpass)
+ returns cstring
as 'MODULE_PATHNAME'
language 'c';
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)
{
-- 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);
-- 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';
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;
-CREATE FUNCTION "recordchange" () RETURNS opaque AS
+CREATE FUNCTION "recordchange" () RETURNS trigger AS
'/usr/local/pgsql/lib/pending.so', 'recordchange' LANGUAGE 'C';
CREATE TABLE "MirrorHost" (
The create the function that contains the trigger::
- create function fti() returns opaque as
+ create function fti() returns trigger as
'/path/to/fti.so' language 'C';
And finally define the trigger on the 'cds' table:
* Example:
*
* -- Create the SQL function based on the compiled shared object
- * create function fti() returns opaque as
+ * create function fti() returns trigger as
* '/usr/local/pgsql/lib/contrib/fti.so' language 'C';
*
* -- Create the FTI table
#
# create index fti_idx on my_fti_table (string,id);
#
-# create function fti() returns opaque as
+# create function fti() returns trigger as
# '/path/to/fti/file/fti.so'
# language 'C';
#
-create function fti() returns opaque as
+create function fti() returns trigger as
'MODULE_PATHNAME'
language 'C';
\ No newline at end of file
SET search_path = public;
-- Query type
-CREATE FUNCTION bqarr_in(opaque)
-RETURNS opaque
+CREATE FUNCTION bqarr_in(cstring)
+RETURNS query_int
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION bqarr_out(opaque)
-RETURNS opaque
+CREATE FUNCTION bqarr_out(query_int)
+RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
--------------
-- define the GiST support methods
-CREATE FUNCTION g_int_consistent(opaque,_int4,int4) RETURNS bool
+CREATE FUNCTION g_int_consistent(internal,_int4,int4) RETURNS bool
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION g_int_compress(opaque) RETURNS opaque
+CREATE FUNCTION g_int_compress(internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION g_int_decompress(opaque) RETURNS opaque
+CREATE FUNCTION g_int_decompress(internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION g_int_penalty(opaque,opaque,opaque) RETURNS opaque
+CREATE FUNCTION g_int_penalty(internal,internal,internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION g_int_picksplit(opaque, opaque) RETURNS opaque
+CREATE FUNCTION g_int_picksplit(internal, internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION g_int_union(bytea, opaque) RETURNS _int4
+CREATE FUNCTION g_int_union(bytea, internal) RETURNS _int4
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION g_int_same(_int4, _int4, opaque) RETURNS opaque
+CREATE FUNCTION g_int_same(_int4, _int4, internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
OPERATOR 7 @,
OPERATOR 8 ~,
OPERATOR 20 @@ (_int4, query_int),
- FUNCTION 1 g_int_consistent (opaque, _int4, int4),
- FUNCTION 2 g_int_union (bytea, opaque),
- FUNCTION 3 g_int_compress (opaque),
- FUNCTION 4 g_int_decompress (opaque),
- FUNCTION 5 g_int_penalty (opaque, opaque, opaque),
- FUNCTION 6 g_int_picksplit (opaque, opaque),
- FUNCTION 7 g_int_same (_int4, _int4, opaque);
+ FUNCTION 1 g_int_consistent (internal, _int4, int4),
+ FUNCTION 2 g_int_union (bytea, internal),
+ FUNCTION 3 g_int_compress (internal),
+ FUNCTION 4 g_int_decompress (internal),
+ FUNCTION 5 g_int_penalty (internal, internal, internal),
+ FUNCTION 6 g_int_picksplit (internal, internal),
+ FUNCTION 7 g_int_same (_int4, _int4, internal);
---------------------------------------------
-- intbig
---------------------------------------------
-- define the GiST support methods
-CREATE FUNCTION g_intbig_consistent(opaque,_int4,int4) RETURNS bool
+CREATE FUNCTION g_intbig_consistent(internal,_int4,int4) RETURNS bool
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION g_intbig_compress(opaque) RETURNS opaque
+CREATE FUNCTION g_intbig_compress(internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION g_intbig_decompress(opaque) RETURNS opaque
+CREATE FUNCTION g_intbig_decompress(internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION g_intbig_penalty(opaque,opaque,opaque) RETURNS opaque
+CREATE FUNCTION g_intbig_penalty(internal,internal,internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION g_intbig_picksplit(opaque, opaque) RETURNS opaque
+CREATE FUNCTION g_intbig_picksplit(internal, internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION g_intbig_union(bytea, opaque) RETURNS _int4
+CREATE FUNCTION g_intbig_union(bytea, internal) RETURNS _int4
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION g_intbig_same(_int4, _int4, opaque) RETURNS opaque
+CREATE FUNCTION g_intbig_same(_int4, _int4, internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-- register the opclass for indexing (not as default)
OPERATOR 7 @ RECHECK,
OPERATOR 8 ~ RECHECK,
OPERATOR 20 @@ (_int4, query_int) RECHECK,
- FUNCTION 1 g_intbig_consistent (opaque, _int4, int4),
- FUNCTION 2 g_intbig_union (bytea, opaque),
- FUNCTION 3 g_intbig_compress (opaque),
- FUNCTION 4 g_intbig_decompress (opaque),
- FUNCTION 5 g_intbig_penalty (opaque, opaque, opaque),
- FUNCTION 6 g_intbig_picksplit (opaque, opaque),
- FUNCTION 7 g_intbig_same (_int4, _int4, opaque);
+ FUNCTION 1 g_intbig_consistent (internal, _int4, int4),
+ FUNCTION 2 g_intbig_union (bytea, internal),
+ FUNCTION 3 g_intbig_compress (internal),
+ FUNCTION 4 g_intbig_decompress (internal),
+ FUNCTION 5 g_intbig_penalty (internal, internal, internal),
+ FUNCTION 6 g_intbig_picksplit (internal, internal),
+ FUNCTION 7 g_intbig_same (_int4, _int4, internal);
END TRANSACTION;
--
-- PostgreSQL code for ISSNs.
--
--- $Id: isbn_issn.sql.in,v 1.5 2002/07/30 17:34:37 tgl Exp $
+-- $Id: isbn_issn.sql.in,v 1.6 2002/08/22 00:01:39 tgl Exp $
--
-- Adjust this setting to control where the objects get created.
-- Input and output functions and the type itself:
--
-create function issn_in(opaque)
- returns opaque
+create function issn_in(cstring)
+ returns issn
as 'MODULE_PATHNAME'
language 'c';
-create function issn_out(opaque)
- returns opaque
+create function issn_out(issn)
+ returns cstring
as 'MODULE_PATHNAME'
language 'c';
--
-- PostgreSQL code for ISBNs.
--
--- $Id: isbn_issn.sql.in,v 1.5 2002/07/30 17:34:37 tgl Exp $
+-- $Id: isbn_issn.sql.in,v 1.6 2002/08/22 00:01:39 tgl Exp $
--
--
-- Input and output functions and the type itself:
--
-create function isbn_in(opaque)
- returns opaque
+create function isbn_in(cstring)
+ returns isbn
as 'MODULE_PATHNAME'
language 'c';
-create function isbn_out(opaque)
- returns opaque
+create function isbn_out(isbn)
+ returns cstring
as 'MODULE_PATHNAME'
language 'c';
--
-- PostgreSQL code for LargeObjects
--
--- $Id: lo.sql.in,v 1.6 2000/11/21 21:51:58 tgl Exp $
+-- $Id: lo.sql.in,v 1.7 2002/08/22 00:01:39 tgl Exp $
--
--
-- Create the data type
--
-- used by the lo type, it takes an oid and returns an lo object
-create function lo_in(opaque)
- returns opaque
+create function lo_in(cstring)
+ returns lo
as 'MODULE_PATHNAME'
language 'c';
-- used by the lo type, it returns the oid of the object
-create function lo_out(opaque)
- returns opaque
+create function lo_out(lo)
+ returns cstring
as 'MODULE_PATHNAME'
language 'c';
-- This is used in triggers
create function lo_manage()
- returns opaque
+ returns trigger
as 'MODULE_PATHNAME'
language 'c';
-- remove our test table
drop table a;
--- now drop any sql based functions associated with the lo type
-drop function oid(lo);
+-- now drop the type and associated C functions
+drop type lo CASCADE;
--- now drop the type
-drop type lo;
-
--- as the type is gone, remove the C based functions
-drop function lo_in(opaque);
-drop function lo_out(opaque);
-drop function lo(oid);
+-- the trigger function has no dependency on the type, so drop separately
drop function lo_manage();
-- the lo stuff is now removed from the system
-- Adjust this setting to control where the objects get created.
SET search_path = public;
-CREATE FUNCTION ltree_in(opaque)
-RETURNS opaque
+CREATE FUNCTION ltree_in(cstring)
+RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION ltree_out(opaque)
-RETURNS opaque
+CREATE FUNCTION ltree_out(ltree)
+RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
--lquery type
-CREATE FUNCTION lquery_in(opaque)
-RETURNS opaque
+CREATE FUNCTION lquery_in(cstring)
+RETURNS lquery
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION lquery_out(opaque)
-RETURNS opaque
+CREATE FUNCTION lquery_out(lquery)
+RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
RESTRICT = contsel, JOIN = contjoinsel
);
-CREATE FUNCTION ltxtq_in(opaque)
-RETURNS opaque
+CREATE FUNCTION ltxtq_in(cstring)
+RETURNS ltxtquery
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION ltxtq_out(opaque)
-RETURNS opaque
+CREATE FUNCTION ltxtq_out(ltxtquery)
+RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
);
--GiST support for ltree
-CREATE FUNCTION ltree_gist_in(opaque)
-RETURNS opaque
+CREATE FUNCTION ltree_gist_in(cstring)
+RETURNS ltree_gist
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION ltree_gist_out(opaque)
-RETURNS opaque
+CREATE FUNCTION ltree_gist_out(ltree_gist)
+RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
);
-create function ltree_consistent(opaque,opaque,int2) returns bool as 'MODULE_PATHNAME' language 'C';
-create function ltree_compress(opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
-create function ltree_decompress(opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
-create function ltree_penalty(opaque,opaque,opaque) returns opaque as 'MODULE_PATHNAME' language 'C' with(isstrict);
-create function ltree_picksplit(opaque, opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
-create function ltree_union(bytea, opaque) returns int4 as 'MODULE_PATHNAME' language 'C';
-create function ltree_same(opaque, opaque, opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function ltree_consistent(internal,internal,int2) returns bool as 'MODULE_PATHNAME' language 'C';
+create function ltree_compress(internal) returns internal as 'MODULE_PATHNAME' language 'C';
+create function ltree_decompress(internal) returns internal as 'MODULE_PATHNAME' language 'C';
+create function ltree_penalty(internal,internal,internal) returns internal as 'MODULE_PATHNAME' language 'C' with(isstrict);
+create function ltree_picksplit(internal, internal) returns internal as 'MODULE_PATHNAME' language 'C';
+create function ltree_union(bytea, internal) returns int4 as 'MODULE_PATHNAME' language 'C';
+create function ltree_same(internal, internal, internal) returns internal as 'MODULE_PATHNAME' language 'C';
CREATE OPERATOR CLASS gist_ltree_ops
DEFAULT FOR TYPE ltree USING gist AS
OPERATOR 13 ~ (lquery, ltree) ,
OPERATOR 14 @ (ltree, ltxtquery) ,
OPERATOR 15 @ (ltxtquery, ltree) ,
- FUNCTION 1 ltree_consistent (opaque, opaque, int2),
- FUNCTION 2 ltree_union (bytea, opaque),
- FUNCTION 3 ltree_compress (opaque),
- FUNCTION 4 ltree_decompress (opaque),
- FUNCTION 5 ltree_penalty (opaque, opaque, opaque),
- FUNCTION 6 ltree_picksplit (opaque, opaque),
- FUNCTION 7 ltree_same (opaque, opaque, opaque),
+ FUNCTION 1 ltree_consistent (internal, internal, int2),
+ FUNCTION 2 ltree_union (bytea, internal),
+ FUNCTION 3 ltree_compress (internal),
+ FUNCTION 4 ltree_decompress (internal),
+ FUNCTION 5 ltree_penalty (internal, internal, internal),
+ FUNCTION 6 ltree_picksplit (internal, internal),
+ FUNCTION 7 ltree_same (internal, internal, internal),
STORAGE ltree_gist;
);
--GiST support for ltree[]
-create function _ltree_consistent(opaque,opaque,int2) returns bool as 'MODULE_PATHNAME' language 'C';
-create function _ltree_compress(opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
-create function _ltree_penalty(opaque,opaque,opaque) returns opaque as 'MODULE_PATHNAME' language 'C' with(isstrict);
-create function _ltree_picksplit(opaque, opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
-create function _ltree_union(bytea, opaque) returns int4 as 'MODULE_PATHNAME' language 'C';
-create function _ltree_same(opaque, opaque, opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function _ltree_consistent(internal,internal,int2) returns bool as 'MODULE_PATHNAME' language 'C';
+create function _ltree_compress(internal) returns internal as 'MODULE_PATHNAME' language 'C';
+create function _ltree_penalty(internal,internal,internal) returns internal as 'MODULE_PATHNAME' language 'C' with(isstrict);
+create function _ltree_picksplit(internal, internal) returns internal as 'MODULE_PATHNAME' language 'C';
+create function _ltree_union(bytea, internal) returns int4 as 'MODULE_PATHNAME' language 'C';
+create function _ltree_same(internal, internal, internal) returns internal as 'MODULE_PATHNAME' language 'C';
CREATE OPERATOR CLASS gist__ltree_ops
DEFAULT FOR TYPE _ltree USING gist AS
OPERATOR 13 ~ (lquery, _ltree) RECHECK ,
OPERATOR 14 @ (_ltree, ltxtquery) RECHECK ,
OPERATOR 15 @ (ltxtquery, _ltree) RECHECK ,
- FUNCTION 1 _ltree_consistent (opaque, opaque, int2),
- FUNCTION 2 _ltree_union (bytea, opaque),
- FUNCTION 3 _ltree_compress (opaque),
- FUNCTION 4 ltree_decompress (opaque),
- FUNCTION 5 _ltree_penalty (opaque, opaque, opaque),
- FUNCTION 6 _ltree_picksplit (opaque, opaque),
- FUNCTION 7 _ltree_same (opaque, opaque, opaque),
+ FUNCTION 1 _ltree_consistent (internal, internal, int2),
+ FUNCTION 2 _ltree_union (bytea, internal),
+ FUNCTION 3 _ltree_compress (internal),
+ FUNCTION 4 ltree_decompress (internal),
+ FUNCTION 5 _ltree_penalty (internal, internal, internal),
+ FUNCTION 6 _ltree_picksplit (internal, internal),
+ FUNCTION 7 _ltree_same (internal, internal, internal),
STORAGE ltree_gist;
# SUCH DAMAGE.
#
# $My2pg: my2pg.pl,v 1.24 2001/12/06 19:32:20 fonin Exp $
-# $Id: my2pg.pl,v 1.8 2002/04/24 01:42:29 momjian Exp $
+# $Id: my2pg.pl,v 1.9 2002/08/22 00:01:39 tgl Exp $
# TODO:
# + Handle SETs
#
# $Log: my2pg.pl,v $
+# Revision 1.9 2002/08/22 00:01:39 tgl
+# 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 ...
+#
# Revision 1.8 2002/04/24 01:42:29 momjian
# Update to my2pg 1.24.
#
# push header to libtypes.c
open(LIBTYPES,">$libtypesource");
print LIBTYPES "/******************************************************";
-print LIBTYPES "\n * My2Pg \$Revision: 1.8 $ \translated dump";
+print LIBTYPES "\n * My2Pg \$Revision: 1.9 $ \translated dump";
print LIBTYPES "\n * User types definitions";
print LIBTYPES "\n ******************************************************/";
print LIBTYPES "\n\n#include <postgres.h>\n";
print LIBTYPES "\n * Types for table ".uc($table_name);
print LIBTYPES "\n */\n";
- $types.="\nCREATE FUNCTION $typename"."_in (opaque)
+ $types.="\nCREATE FUNCTION $typename"."_in (cstring)
RETURNS $typename
AS '$libtypename'
LANGUAGE 'c'
- WITH (ISCACHABLE);\n";
+ WITH (ISSTRICT, ISCACHABLE);\n";
# creating output function
my $func_out="
return (*a>=*b);
}\n";
- $types.="\nCREATE FUNCTION $typename"."_out (opaque)
- RETURNS opaque
+ $types.="\nCREATE FUNCTION $typename"."_out ($typename)
+ RETURNS cstring
AS '$libtypename'
LANGUAGE 'c'
- WITH (ISCACHABLE);\n";
+ WITH (ISSTRICT, ISCACHABLE);\n";
$types.="\nCREATE TYPE $typename (
internallength = 2,
print LIBTYPES "\n * Types for table ".uc($table_name);
print LIBTYPES "\n */\n";
- $types.="\nCREATE FUNCTION $typename"."_in (opaque)
+ $types.="\nCREATE FUNCTION $typename"."_in (cstring)
RETURNS $typename
AS '$libtypename'
LANGUAGE 'c';\n";
\n";
- $types.="\nCREATE FUNCTION $typename"."_out (opaque)
- RETURNS opaque
+ $types.="\nCREATE FUNCTION $typename"."_out ($typename)
+ RETURNS cstring
AS '$libtypename'
LANGUAGE 'c';\n";
open(MAKE,">Makefile");
print MAKE "#
-# My2Pg \$Revision: 1.8 $ \translated dump
+# My2Pg \$Revision: 1.9 $ \translated dump
# Makefile
#
DROP FUNCTION noup ();
CREATE FUNCTION noup ()
- RETURNS opaque
+ RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
# Escaping Single Quotes
#$trig->[4] =~ s/'/''/sg;
- $sql_output .= "CREATE FUNCTION pg_fct_\L$trig->[0]\E () RETURNS OPAQUE AS '\n$trig->[4]\n' LANGUAGE 'plpgsql'\n\n";
+ $sql_output .= "CREATE FUNCTION pg_fct_\L$trig->[0]\E () RETURNS TRIGGER AS '\n$trig->[4]\n' LANGUAGE 'plpgsql'\n\n";
$sql_output .= "CREATE TRIGGER \L$trig->[0]\E\n\t$trig->[1] $trig->[2] ON \L$trig->[3]\E FOR EACH ROW\n\tEXECUTE PROCEDURE pg_fct_\L$trig->[0]\E();\n\n";
}
}
$result = $conn->exec("create sequence _rserv_sync_seq_");
RollbackAndQuit($conn) if ($result->resultStatus ne PGRES_COMMAND_OK);
-$result = $conn->exec("CREATE FUNCTION _rserv_log_() RETURNS opaque" .
+$result = $conn->exec("CREATE FUNCTION _rserv_log_() RETURNS trigger" .
" AS '@MODULE_FILENAME@' LANGUAGE 'c'");
RollbackAndQuit($conn) if ($result->resultStatus ne PGRES_COMMAND_OK);
drop function _rserv_log_();
CREATE FUNCTION _rserv_log_()
- RETURNS opaque
+ RETURNS trigger
AS '@MODULE_FILENAME@'
LANGUAGE 'c'
;
--
--
-- define the GiST support methods
-create function gbox_consistent(opaque,box,int4) returns bool as 'MODULE_PATHNAME' language 'C';
+create function gbox_consistent(internal,box,int4) returns bool as 'MODULE_PATHNAME' language 'C';
-create function gbox_compress(opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function gbox_compress(internal) returns internal as 'MODULE_PATHNAME' language 'C';
-create function rtree_decompress(opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function rtree_decompress(internal) returns internal as 'MODULE_PATHNAME' language 'C';
-create function gbox_penalty(opaque,opaque,opaque) returns opaque as 'MODULE_PATHNAME' language 'C' with (isstrict);
+create function gbox_penalty(internal,internal,internal) returns internal as 'MODULE_PATHNAME' language 'C' with (isstrict);
-create function gbox_picksplit(opaque, opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function gbox_picksplit(internal, internal) returns internal as 'MODULE_PATHNAME' language 'C';
-create function gbox_union(bytea, opaque) returns box as 'MODULE_PATHNAME' language 'C';
+create function gbox_union(bytea, internal) returns box as 'MODULE_PATHNAME' language 'C';
-create function gbox_same(box, box, opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function gbox_same(box, box, internal) returns internal as 'MODULE_PATHNAME' language 'C';
-- create the operator class
CREATE OPERATOR CLASS gist_box_ops
OPERATOR 6 ~= ,
OPERATOR 7 ~ ,
OPERATOR 8 @ ,
- FUNCTION 1 gbox_consistent (opaque, box, int4),
- FUNCTION 2 gbox_union (bytea, opaque),
- FUNCTION 3 gbox_compress (opaque),
- FUNCTION 4 rtree_decompress (opaque),
- FUNCTION 5 gbox_penalty (opaque, opaque, opaque),
- FUNCTION 6 gbox_picksplit (opaque, opaque),
- FUNCTION 7 gbox_same (box, box, opaque);
+ FUNCTION 1 gbox_consistent (internal, box, int4),
+ FUNCTION 2 gbox_union (bytea, internal),
+ FUNCTION 3 gbox_compress (internal),
+ FUNCTION 4 rtree_decompress (internal),
+ FUNCTION 5 gbox_penalty (internal, internal, internal),
+ FUNCTION 6 gbox_picksplit (internal, internal),
+ FUNCTION 7 gbox_same (box, box, internal);
--
--
--
-- define the GiST support methods
-create function gpoly_consistent(opaque,polygon,int4) returns bool as 'MODULE_PATHNAME' language 'C';
+create function gpoly_consistent(internal,polygon,int4) returns bool as 'MODULE_PATHNAME' language 'C';
-create function gpoly_compress(opaque) returns opaque as 'MODULE_PATHNAME' language 'C';
+create function gpoly_compress(internal) returns internal as 'MODULE_PATHNAME' language 'C';
-- create the operator class
CREATE OPERATOR CLASS gist_poly_ops
OPERATOR 6 ~= RECHECK ,
OPERATOR 7 ~ RECHECK ,
OPERATOR 8 @ RECHECK ,
- FUNCTION 1 gpoly_consistent (opaque, polygon, int4),
- FUNCTION 2 gbox_union (bytea, opaque),
- FUNCTION 3 gpoly_compress (opaque),
- FUNCTION 4 rtree_decompress (opaque),
- FUNCTION 5 gbox_penalty (opaque, opaque, opaque),
- FUNCTION 6 gbox_picksplit (opaque, opaque),
- FUNCTION 7 gbox_same (box, box, opaque),
+ FUNCTION 1 gpoly_consistent (internal, polygon, int4),
+ FUNCTION 2 gbox_union (bytea, internal),
+ FUNCTION 3 gpoly_compress (internal),
+ FUNCTION 4 rtree_decompress (internal),
+ FUNCTION 5 gbox_penalty (internal, internal, internal),
+ FUNCTION 6 gbox_picksplit (internal, internal),
+ FUNCTION 7 gbox_same (box, box, internal),
STORAGE box;
return (result);
}
-/*
- * You might have noticed a slight inconsistency between the following
- * declaration and the SQL definition:
- * CREATE FUNCTION seg_out(opaque) RETURNS opaque ...
- * The reason is that the argument passed into seg_out is really just a
- * pointer. POSTGRES thinks all output functions are:
- * char *out_func(char *);
- */
char *
seg_out(SEG * seg)
{
-- Adjust this setting to control where the objects get created.
SET search_path = public;
-CREATE FUNCTION seg_in(opaque)
-RETURNS opaque
+CREATE FUNCTION seg_in(cstring)
+RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE 'c';
-CREATE FUNCTION seg_out(opaque)
-RETURNS opaque
+CREATE FUNCTION seg_out(seg)
+RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c';
-- define the GiST support methods
-CREATE FUNCTION gseg_consistent(opaque,seg,int4) RETURNS bool
+CREATE FUNCTION gseg_consistent(internal,seg,int4) RETURNS bool
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION gseg_compress(opaque) RETURNS opaque
+CREATE FUNCTION gseg_compress(internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION gseg_decompress(opaque) RETURNS opaque
+CREATE FUNCTION gseg_decompress(internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION gseg_penalty(opaque,opaque,opaque) RETURNS opaque
+CREATE FUNCTION gseg_penalty(internal,internal,internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION gseg_picksplit(opaque, opaque) RETURNS opaque
+CREATE FUNCTION gseg_picksplit(internal, internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION gseg_union(bytea, opaque) RETURNS seg
+CREATE FUNCTION gseg_union(bytea, internal) RETURNS seg
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION gseg_same(seg, seg, opaque) RETURNS opaque
+CREATE FUNCTION gseg_same(seg, seg, internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
OPERATOR 6 = ,
OPERATOR 7 @ ,
OPERATOR 8 ~ ,
- FUNCTION 1 gseg_consistent (opaque, seg, int4),
- FUNCTION 2 gseg_union (bytea, opaque),
- FUNCTION 3 gseg_compress (opaque),
- FUNCTION 4 gseg_decompress (opaque),
- FUNCTION 5 gseg_penalty (opaque, opaque, opaque),
- FUNCTION 6 gseg_picksplit (opaque, opaque),
- FUNCTION 7 gseg_same (seg, seg, opaque);
+ FUNCTION 1 gseg_consistent (internal, seg, int4),
+ FUNCTION 2 gseg_union (bytea, internal),
+ FUNCTION 3 gseg_compress (internal),
+ FUNCTION 4 gseg_decompress (internal),
+ FUNCTION 5 gseg_penalty (internal, internal, internal),
+ FUNCTION 6 gseg_picksplit (internal, internal),
+ FUNCTION 7 gseg_same (seg, seg, internal);
END TRANSACTION;
DROP FUNCTION autoinc();
CREATE FUNCTION autoinc()
- RETURNS opaque
+ RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
DROP FUNCTION insert_username();
CREATE FUNCTION insert_username()
- RETURNS opaque
+ RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
DROP FUNCTION moddatetime();
CREATE FUNCTION moddatetime()
- RETURNS opaque
+ RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
DROP FUNCTION check_foreign_key ();
CREATE FUNCTION check_primary_key ()
- RETURNS opaque
+ RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
CREATE FUNCTION check_foreign_key ()
- RETURNS opaque
+ RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
DROP FUNCTION set_timetravel(name, int4);
CREATE FUNCTION timetravel()
- RETURNS opaque
+ RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
-- Define the new output functions.
--
-create function c_charout(opaque) returns int4
+create function c_charout(bpchar) returns cstring
as 'MODULE_PATHNAME'
language 'c';
-create function c_textout(opaque) returns int4
+create function c_textout(text) returns cstring
as 'MODULE_PATHNAME'
language 'c';
-create function c_varcharout(opaque) returns int4
+create function c_varcharout(varchar) returns cstring
as 'MODULE_PATHNAME'
language 'c';
-- This is not needed because escapes are handled by the parser
--
--- create function c_textin(opaque)
+-- create function c_textin(cstring)
-- returns text
-- as 'MODULE_PATHNAME'
-- language 'c';
-- TXTIDX type
-CREATE FUNCTION txtidx_in(opaque)
-RETURNS opaque
+CREATE FUNCTION txtidx_in(cstring)
+RETURNS txtidx
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION txtidx_out(opaque)
-RETURNS opaque
+CREATE FUNCTION txtidx_out(txtidx)
+RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
--QUERYTYPES
--without morphology
-CREATE FUNCTION qtxt_in(opaque)
-RETURNS opaque
+CREATE FUNCTION qtxt_in(cstring)
+RETURNS query_txt
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION qtxt_out(opaque)
-RETURNS opaque
+CREATE FUNCTION qtxt_out(query_txt)
+RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
);
--with morphology
-CREATE FUNCTION mqtxt_in(opaque)
-RETURNS opaque
+CREATE FUNCTION mqtxt_in(cstring)
+RETURNS mquery_txt
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
+--same C output function as for query_txt
+CREATE FUNCTION mqtxt_out(mquery_txt)
+RETURNS cstring
+AS 'MODULE_PATHNAME', 'qtxt_out'
+LANGUAGE 'c' with (isstrict);
+
CREATE TYPE mquery_txt (
internallength = -1,
input = mqtxt_in,
-output = qtxt_out
+output = mqtxt_out
);
--only for debug
);
--Trigger
-create function tsearch() returns opaque as
+create function tsearch() returns trigger as
'MODULE_PATHNAME'
language 'C';
--GiST
--GiST key type
-CREATE FUNCTION gtxtidx_in(opaque)
-RETURNS opaque
+CREATE FUNCTION gtxtidx_in(cstring)
+RETURNS gtxtidx
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION gtxtidx_out(opaque)
-RETURNS opaque
+CREATE FUNCTION gtxtidx_out(gtxtidx)
+RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict);
);
-- support functions
-CREATE FUNCTION gtxtidx_consistent(gtxtidx,opaque,int4) RETURNS bool
+CREATE FUNCTION gtxtidx_consistent(gtxtidx,internal,int4) RETURNS bool
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION gtxtidx_compress(opaque) RETURNS opaque
+CREATE FUNCTION gtxtidx_compress(internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION gtxtidx_decompress(opaque) RETURNS opaque
+CREATE FUNCTION gtxtidx_decompress(internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION gtxtidx_penalty(opaque,opaque,opaque) RETURNS opaque
+CREATE FUNCTION gtxtidx_penalty(internal,internal,internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c' with (isstrict);
-CREATE FUNCTION gtxtidx_picksplit(opaque, opaque) RETURNS opaque
+CREATE FUNCTION gtxtidx_picksplit(internal, internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION gtxtidx_union(bytea, opaque) RETURNS _int4
+CREATE FUNCTION gtxtidx_union(bytea, internal) RETURNS _int4
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-CREATE FUNCTION gtxtidx_same(gtxtidx, gtxtidx, opaque) RETURNS opaque
+CREATE FUNCTION gtxtidx_same(gtxtidx, gtxtidx, internal) RETURNS internal
AS 'MODULE_PATHNAME' LANGUAGE 'c';
-- create the operator class
DEFAULT FOR TYPE txtidx USING gist AS
OPERATOR 1 @@ (txtidx, query_txt) RECHECK ,
OPERATOR 2 ## (txtidx, mquery_txt) RECHECK ,
- FUNCTION 1 gtxtidx_consistent (gtxtidx, opaque, int4),
- FUNCTION 2 gtxtidx_union (bytea, opaque),
- FUNCTION 3 gtxtidx_compress (opaque),
- FUNCTION 4 gtxtidx_decompress (opaque),
- FUNCTION 5 gtxtidx_penalty (opaque, opaque, opaque),
- FUNCTION 6 gtxtidx_picksplit (opaque, opaque),
- FUNCTION 7 gtxtidx_same (gtxtidx, gtxtidx, opaque),
+ FUNCTION 1 gtxtidx_consistent (gtxtidx, internal, int4),
+ FUNCTION 2 gtxtidx_union (bytea, internal),
+ FUNCTION 3 gtxtidx_compress (internal),
+ FUNCTION 4 gtxtidx_decompress (internal),
+ FUNCTION 5 gtxtidx_penalty (internal, internal, internal),
+ FUNCTION 6 gtxtidx_picksplit (internal, internal),
+ FUNCTION 7 gtxtidx_same (gtxtidx, gtxtidx, internal),
STORAGE gtxtidx;
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.99 2002/08/19 19:33:33 tgl Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.100 2002/08/22 00:01:40 tgl Exp $
-->
<chapter id="datatype">
</sect1>
+ <sect1 id="datatype-pseudo">
+ <title>Pseudo-Types</title>
+
+ <indexterm zone="datatype-pseudo">
+ <primary>record</primary>
+ </indexterm>
+
+ <indexterm zone="datatype-pseudo">
+ <primary>any</primary>
+ </indexterm>
+
+ <indexterm zone="datatype-pseudo">
+ <primary>anyarray</primary>
+ </indexterm>
+
+ <indexterm zone="datatype-pseudo">
+ <primary>void</primary>
+ </indexterm>
+
+ <indexterm zone="datatype-pseudo">
+ <primary>trigger</primary>
+ </indexterm>
+
+ <indexterm zone="datatype-pseudo">
+ <primary>language_handler</primary>
+ </indexterm>
+
+ <indexterm zone="datatype-pseudo">
+ <primary>cstring</primary>
+ </indexterm>
+
+ <indexterm zone="datatype-pseudo">
+ <primary>internal</primary>
+ </indexterm>
+
+ <indexterm zone="datatype-pseudo">
+ <primary>opaque</primary>
+ </indexterm>
+
+ <para>
+ The <productname>PostgreSQL</productname> type system contains a number
+ of special-purpose entries that are collectively called
+ <firstterm>pseudo-types</>. A pseudo-type cannot be used as a column
+ datatype, but it can be used to declare a function's argument or result
+ type. Each of the available pseudo-types is useful in situations where
+ a function's behavior does not correspond to simply taking or returning
+ a value of a specific SQL datatype.
+ </para>
+
+ <para>
+ <table tocentry="1">
+ <title>Pseudo-Types</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Type name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry><type>record</></entry>
+ <entry>Identifies a function returning an unspecified tuple type</entry>
+ </row>
+
+ <row>
+ <entry><type>any</></entry>
+ <entry>Indicates that a function accepts any input datatype whatever</entry>
+ </row>
+
+ <row>
+ <entry><type>anyarray</></entry>
+ <entry>Indicates that a function accepts any array datatype</entry>
+ </row>
+
+ <row>
+ <entry><type>void</></entry>
+ <entry>Indicates that a function returns no value</entry>
+ </row>
+
+ <row>
+ <entry><type>trigger</></entry>
+ <entry>A trigger function is declared to return <type>trigger</></entry>
+ </row>
+
+ <row>
+ <entry><type>language_handler</></entry>
+ <entry>A procedural language call handler is declared to return <type>language_handler</></entry>
+ </row>
+
+ <row>
+ <entry><type>cstring</></entry>
+ <entry>Indicates a function takes or returns a null-terminated C string</entry>
+ </row>
+
+ <row>
+ <entry><type>internal</></entry>
+ <entry>Indicates that a function accepts or returns a server-internal
+ data type</entry>
+ </row>
+
+ <row>
+ <entry><type>opaque</></entry>
+ <entry>An obsolete type name that formerly served all the above purposes</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+
+ <para>
+ Functions coded in C (whether built-in or dynamically loaded) may be
+ declared to take or return any of these pseudo datatypes. It is up to
+ the function author to ensure that the function will behave safely
+ when a pseudo-type is used as an argument type.
+ </para>
+
+ <para>
+ Functions coded in procedural languages may use pseudo-types only as
+ allowed by their implementation languages. At present the procedural
+ languages all forbid use of a pseudo-type as argument type, and allow
+ only <type>void</> as a result type (plus <type>trigger</> when the
+ function is used as a trigger).
+ </para>
+
+ <para>
+ The <type>internal</> pseudo-type is used to declare functions that are
+ meant only to be called internally by the database system, and not by
+ direct invocation in a SQL query. If a function has at least one
+ <type>internal</>-type argument then it cannot be called from SQL.
+ To preserve the type safety of this restriction it is important to
+ follow this coding rule: do not create any function that is declared
+ to return <type>internal</> unless it has at least one <type>internal</>
+ argument.
+ </para>
+
+ </sect1>
+
&array;
</chapter>
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/Attic/indexcost.sgml,v 2.11 2002/03/22 19:20:10 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/Attic/indexcost.sgml,v 2.12 2002/08/22 00:01:40 tgl Exp $
-->
<chapter id="indexcost">
<para>
By convention, the <literal>pg_proc</literal> entry for an
<literal>amcostestimate</literal> function should show
-
- <programlisting>
-prorettype = 0
-pronargs = 8
-proargtypes = 0 0 0 0 0 0 0 0
- </programlisting>
-
- We use zero ("opaque") for all the arguments since none of them have types
- that are known in pg_type.
+ eight arguments all declared as <type>internal</> (since none of them have
+ types that are known to SQL), and the return type is <type>void</>.
</para>
</chapter>
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/plpgsql.sgml,v 1.2 2002/08/20 05:28:23 momjian Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/plpgsql.sgml,v 1.3 2002/08/22 00:01:40 tgl Exp $
-->
<chapter id="plpgsql">
<application>PL/pgSQL</application> can be used to define trigger
procedures. A trigger procedure is created with the <command>CREATE
FUNCTION</command> command as a function with no arguments and a return
- type of <type>OPAQUE</type>. Note that the function must be declared
+ type of <type>TRIGGER</type>. Note that the function must be declared
with no arguments even if it expects to receive arguments specified
in <command>CREATE TRIGGER</> --- trigger arguments are passed via
<varname>TG_ARGV</>, as described below.
last_user text
);
-CREATE FUNCTION emp_stamp () RETURNS OPAQUE AS '
+CREATE FUNCTION emp_stamp () RETURNS TRIGGER AS '
BEGIN
-- Check that empname and salary are given
IF NEW.empname ISNULL THEN
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/pltcl.sgml,v 2.20 2002/03/22 19:20:21 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/pltcl.sgml,v 2.21 2002/08/22 00:01:40 tgl Exp $
-->
<chapter id="pltcl">
Trigger procedures can be written in PL/Tcl. As is customary in
<productname>PostgreSQL</productname>, a procedure that's to be called
as a trigger must be declared as a function with no arguments
- and a return type of <literal>opaque</>.
+ and a return type of <literal>trigger</>.
</para>
<para>
The information from the trigger manager is passed to the procedure body
incremented on every update operation:
<programlisting>
-CREATE FUNCTION trigfunc_modcount() RETURNS OPAQUE AS '
+CREATE FUNCTION trigfunc_modcount() RETURNS TRIGGER AS '
switch $TG_op {
INSERT {
set NEW($1) 0
-<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_conversion.sgml,v 1.2 2002/07/22 13:00:00 ishii Exp $ -->
+<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_conversion.sgml,v 1.3 2002/08/22 00:01:40 tgl Exp $ -->
<refentry id="SQL-CREATECONVERSION">
<refmeta>
conv_proc(
INTEGER, -- source encoding id
INTEGER, -- destination encoding id
- OPAQUE, -- source string (null terminated C string)
- OPAQUE, -- destination string (null terminated C string)
+ CSTRING, -- source string (null terminated C string)
+ CSTRING, -- destination string (null terminated C string)
INTEGER -- source string length
- ) returns INTEGER; -- dummy. returns nothing, actually.
+ ) returns VOID;
</programlisting>
</para>
</listitem>
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.41 2002/07/24 19:11:07 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.42 2002/08/22 00:01:40 tgl Exp $
-->
<refentry id="SQL-CREATEFUNCTION">
<listitem>
<para>
The data type(s) of the function's arguments, if any. The
- input types may be base or complex types,
- <literal>opaque</literal>, or the same as the type of an
- existing column. <literal>Opaque</literal> indicates
- that the function accepts arguments of a non-SQL type such as
- <type>char *</type>.
- The type of a column is indicated using <replaceable
+ input types may be base, complex, or domain types,
+ or the same as the type of an existing column.
+ The type of a column is referenced by writing <replaceable
class="parameter">tablename</replaceable>.<replaceable
class="parameter">columnname</replaceable><literal>%TYPE</literal>;
using this can sometimes help make a function independent from
changes to the definition of a table.
+ Depending on the implementation language it may also be allowed
+ to specify <quote>pseudo-types</> such as <type>cstring</>.
+ Pseudo-types indicate that the actual argument type is either
+ incompletely specified, or outside the set of ordinary SQL datatypes.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
The return data type. The return type may be specified as a
- base type, complex type, <literal>setof</literal> type,
- <literal>opaque</literal>, or the same as the type of an
+ base, complex, or domain type, or the same as the type of an
existing column.
+ Depending on the implementation language it may also be allowed
+ to specify <quote>pseudo-types</> such as <type>cstring</>.
The <literal>setof</literal>
modifier indicates that the function will return a set of
- items, rather than a single item. Functions with a declared
- return type of <literal>opaque</literal> do not return a value.
- These cannot be called directly; trigger functions make use of
- this feature.
+ items, rather than a single item.
</para>
</listitem>
</varlistentry>
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_language.sgml,v 1.26 2002/07/24 19:11:07 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_language.sgml,v 1.27 2002/08/22 00:01:40 tgl Exp $
PostgreSQL documentation
-->
language such as C with version 1 call convention and
registered with <productname>PostgreSQL</productname> as a
function taking no arguments and returning the
- <type>opaque</type> type, a placeholder for unspecified or
- undefined types.
+ <type>language_handler</type> type, a placeholder type that is
+ simply used to identify the function as a call handler.
</para>
</listitem>
</varlistentry>
<replaceable class="parameter">valfunction</replaceable> is the
name of a previously registered function that will be called
when a new function in the language is created, to validate the
- new function. The validator function must take one argument of
- type <type>oid</type>, which will be the OID of the
- to-be-created function, and can have any return type. If no
+ new function.
+ If no
validator function is specified, then a new function will not
be checked when it is created.
+ The validator function must take one argument of
+ type <type>oid</type>, which will be the OID of the
+ to-be-created function, and will typically return <type>void</>.
</para>
<para>
The following two commands executed in sequence will register a new
procedural language and the associated call handler.
<programlisting>
-CREATE FUNCTION plsample_call_handler () RETURNS opaque
+CREATE FUNCTION plsample_call_handler () RETURNS language_handler
AS '$libdir/plsample'
LANGUAGE C;
CREATE LANGUAGE plsample
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_opclass.sgml,v 1.1 2002/07/29 22:14:10 tgl Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_opclass.sgml,v 1.2 2002/08/22 00:01:40 tgl Exp $
PostgreSQL documentation
-->
OPERATOR 7 @,
OPERATOR 8 ~,
OPERATOR 20 @@ (_int4, query_int),
- FUNCTION 1 g_int_consistent (opaque, _int4, int4),
- FUNCTION 2 g_int_union (bytea, opaque),
- FUNCTION 3 g_int_compress (opaque),
- FUNCTION 4 g_int_decompress (opaque),
- FUNCTION 5 g_int_penalty (opaque, opaque, opaque),
- FUNCTION 6 g_int_picksplit (opaque, opaque),
- FUNCTION 7 g_int_same (_int4, _int4, opaque);
+ FUNCTION 1 g_int_consistent (internal, _int4, int4),
+ FUNCTION 2 g_int_union (bytea, internal),
+ FUNCTION 3 g_int_compress (internal),
+ FUNCTION 4 g_int_decompress (internal),
+ FUNCTION 5 g_int_penalty (internal, internal, internal),
+ FUNCTION 6 g_int_picksplit (internal, internal),
+ FUNCTION 7 g_int_same (_int4, _int4, internal);
</programlisting>
<para>
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_trigger.sgml,v 1.26 2002/05/18 15:44:47 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_trigger.sgml,v 1.27 2002/08/22 00:01:40 tgl Exp $
PostgreSQL documentation
-->
<listitem>
<para>
A user-supplied function that is declared as taking no arguments
- and returning type <literal>opaque</>.
+ and returning type <literal>trigger</>.
</para>
</listitem>
</varlistentry>
</para>
<para>
+ In <productname>PostgreSQL</productname> versions before 7.3, it was
+ necessary to declare trigger functions as returning the placeholder
+ type <type>opaque</>, rather than <type>trigger</>. This is still
+ supported, but is deprecated because it is obscure and causes loss of
+ type safety.
+ </para>
+
+ <para>
As of the current release, <literal>STATEMENT</literal> triggers are not implemented.
</para>
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.31 2002/08/15 16:36:00 momjian Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.32 2002/08/22 00:01:40 tgl Exp $
PostgreSQL documentation
-->
operators and functions defined for the type. Naturally,
<replaceable class="parameter">output_function</replaceable>
performs the reverse transformation. The input function may be
- declared as taking one argument of type <type>opaque</type>,
+ declared as taking one argument of type <type>cstring</type>,
or as taking three arguments of types
- <type>opaque</type>, <type>OID</type>, <type>int4</type>.
+ <type>cstring</type>, <type>OID</type>, <type>int4</type>.
(The first argument is the input text as a C string, the second
argument is the element type in case this is an array type,
and the third is the typmod of the destination column, if known.)
+ It should return a value of the datatype itself.
The output function may be
- declared as taking one argument of type <type>opaque</type>,
- or as taking two arguments of types
- <type>opaque</type>, <type>OID</type>.
- (The first argument is actually of the data type itself, but since the
- output function must be declared first, it's easier to declare it as
- accepting type <type>opaque</type>. The second argument is again
- the array element type for array types.)
+ declared as taking one argument of the new datatype, or as taking
+ two arguments of which the second is type <type>OID</type>.
+ (The second argument is again the array element type for array types.)
+ The output function should return type <type>cstring</type>.
</para>
<para>
+ You should at this point be wondering how the input and output functions
+ can be declared to have results or inputs of the new type, when they have
+ to be created before the new type can be created. The answer is that the
+ input function must be created first, then the output function, then the
+ datatype.
+ <productname>PostgreSQL</productname> will first see the name of the new
+ datatype as the return type of the input function. It will create a
+ <quote>shell</> type, which is simply a placeholder entry in
+ <literal>pg_type</>, and link the input function definition to the shell
+ type. Similarly the output function will be linked to the (now already
+ existing) shell type. Finally, <command>CREATE TYPE</> replaces the
+ shell entry with a complete type definition, and the new type can be used.
+ </para>
+
+ <note>
+ <para>
+ In <productname>PostgreSQL</productname> versions before 7.3, it was
+ customary to avoid creating a shell type by replacing the functions'
+ forward references to the type name with the placeholder pseudo-type
+ <type>OPAQUE</>. The <type>cstring</> inputs and
+ results also had to be declared as <type>OPAQUE</> before 7.3.
+ Use of <type>OPAQUE</> for this purpose is still supported, but it is
+ deprecated because it causes loss of type safety.
+ </para>
+ </note>
+
+ <para>
New base data types can be fixed length, in which case
<replaceable class="parameter">internallength</replaceable> is a
positive integer, or variable length, indicated by setting
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.149 2002/08/20 17:54:44 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.150 2002/08/22 00:01:40 tgl Exp $
-->
<appendix id="release">
worries about funny characters.
-->
<literallayout><![CDATA[
+Type OPAQUE is now deprecated in favor of pseudo-types cstring, trigger, etc
Files larger than 2 GB are now supported (if supported by the operating system)
SERIAL no longer implies UNIQUE; specify explicitly if index is wanted
pg_dump -n and -N options have been removed. The new behavior is like -n but knows about key words.
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/trigger.sgml,v 1.23 2002/04/19 16:36:08 tgl Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/trigger.sgml,v 1.24 2002/08/22 00:01:40 tgl Exp $
-->
<chapter id="triggers">
<para>
The trigger function must be defined before the trigger itself can be
created. The trigger function must be declared as a
- function taking no arguments and returning type <literal>opaque</>.
+ function taking no arguments and returning type <literal>trigger</>.
(The trigger function receives its input through a TriggerData
structure, not in the form of ordinary function arguments.)
If the function is written in C, it must use the <quote>version 1</>
Now, compile and create the trigger function:
<programlisting>
-CREATE FUNCTION trigf () RETURNS OPAQUE AS
+CREATE FUNCTION trigf () RETURNS TRIGGER AS
'...path_to_so' LANGUAGE 'C';
CREATE TABLE ttest (x int4);
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.54 2002/07/30 16:20:03 momjian Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.55 2002/08/22 00:01:40 tgl Exp $
-->
<chapter id="xfunc">
<quote>normal</quote> function, which must be written in a
compiled language such as C and registered with
<productname>PostgreSQL</productname> as taking no arguments and
- returning the <type>opaque</type> type, a placeholder for
- unspecified or undefined types. This prevents the call handler
- from being called directly as a function from queries. (However,
- arguments may be supplied in the actual call to the handler when a
- function in the language offered by the handler is to be
- executed.)
+ returning the <type>language_handler</type> type.
+ This special pseudo-type identifies the handler as a call handler
+ and prevents it from being called directly in queries.
</para>
<note>
The following commands then register the sample procedural
language:
<programlisting>
-CREATE FUNCTION plsample_call_handler () RETURNS opaque
+CREATE FUNCTION plsample_call_handler () RETURNS language_handler
AS '/usr/local/pgsql/lib/plsample'
LANGUAGE C;
CREATE LANGUAGE plsample
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/xplang.sgml,v 1.17 2002/01/07 02:29:14 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/xplang.sgml,v 1.18 2002/08/22 00:01:40 tgl Exp $
-->
<chapter id="xplang">
The handler must be declared with the command
<synopsis>
CREATE FUNCTION <replaceable>handler_function_name</replaceable> ()
- RETURNS OPAQUE AS
+ RETURNS LANGUAGE_HANDLER AS
'<replaceable>path-to-shared-object</replaceable>' LANGUAGE C;
</synopsis>
- The special return type of <type>OPAQUE</type> tells
+ The special return type of <type>LANGUAGE_HANDLER</type> tells
the database that this function does not return one of
the defined <acronym>SQL</acronym> data types and is not directly usable
in <acronym>SQL</acronym> statements.
shared object for the <application>PL/pgSQL</application> language's call handler function.
<programlisting>
-CREATE FUNCTION plpgsql_call_handler () RETURNS OPAQUE AS
+CREATE FUNCTION plpgsql_call_handler () RETURNS LANGUAGE_HANDLER AS
'$libdir/plpgsql' LANGUAGE C;
</programlisting>
</para>
<function>complex_out</function> before creating the type:
<programlisting>
-CREATE FUNCTION complex_in(opaque)
+CREATE FUNCTION complex_in(cstring)
RETURNS complex
AS '<replaceable>PGROOT</replaceable>/tutorial/complex'
LANGUAGE C;
-CREATE FUNCTION complex_out(opaque)
- RETURNS opaque
+CREATE FUNCTION complex_out(complex)
+ RETURNS cstring
AS '<replaceable>PGROOT</replaceable>/tutorial/complex'
LANGUAGE C;
</programlisting>
output = complex_out
);
</programlisting>
+
+ Notice that the declarations of the input and output functions must
+ reference the not-yet-defined type. This is allowed, but will draw
+ warning messages that may be ignored.
</para>
<para>
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.62 2002/06/20 20:29:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.63 2002/08/22 00:01:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "access/heapam.h"
#include "access/printtup.h"
-#include "catalog/pg_type.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
-#include "utils/syscache.h"
+#include "utils/lsyscache.h"
+
static void printtup_setup(DestReceiver *self, int operation,
const char *portalName, TupleDesc typeinfo);
*/
/* ----------------
- * getTypeOutputInfo -- get info needed for printing values of a type
- * ----------------
- */
-bool
-getTypeOutputInfo(Oid type, Oid *typOutput, Oid *typElem,
- bool *typIsVarlena)
-{
- HeapTuple typeTuple;
- Form_pg_type pt;
-
- typeTuple = SearchSysCache(TYPEOID,
- ObjectIdGetDatum(type),
- 0, 0, 0);
- if (!HeapTupleIsValid(typeTuple))
- elog(ERROR, "getTypeOutputInfo: Cache lookup of type %u failed", type);
- pt = (Form_pg_type) GETSTRUCT(typeTuple);
-
- *typOutput = pt->typoutput;
- *typElem = pt->typelem;
- *typIsVarlena = (!pt->typbyval) && (pt->typlen == -1);
- ReleaseSysCache(typeTuple);
- return OidIsValid(*typOutput);
-}
-
-/* ----------------
* Private state for a printtup destination object
* ----------------
*/
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.74 2002/08/07 21:45:01 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.75 2002/08/22 00:01:41 tgl Exp $
*
* NOTES
* See acl.h.
char replaces[Natts_pg_proc];
oid = LookupFuncNameTypeNames(func->funcname, func->funcargs,
- true, stmt->is_grant ? "GRANT" : "REVOKE");
+ stmt->is_grant ? "GRANT" : "REVOKE");
relation = heap_openr(ProcedureRelationName, RowExclusiveLock);
tuple = SearchSysCache(PROCOID,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.53 2002/08/05 03:29:16 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.54 2002/08/22 00:01:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/* handle transfn */
MemSet(fnArgs, 0, FUNC_MAX_ARGS * sizeof(Oid));
fnArgs[0] = aggTransType;
- if (OidIsValid(aggBaseType))
+ if (aggBaseType == ANYOID)
+ nargs = 1;
+ else
{
fnArgs[1] = aggBaseType;
nargs = 2;
}
- else
- nargs = 1;
transfn = LookupFuncName(aggtransfnName, nargs, fnArgs);
if (!OidIsValid(transfn))
func_error("AggregateCreate", aggtransfnName, nargs, fnArgs, NULL);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.75 2002/08/05 03:29:16 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.76 2002/08/22 00:01:41 tgl Exp $
*
* NOTES
* these routines moved here from commands/define.c and somewhat cleaned up.
if (restrictionName)
{
MemSet(typeId, 0, FUNC_MAX_ARGS * sizeof(Oid));
- typeId[0] = 0; /* Query (opaque type) */
+ typeId[0] = INTERNALOID; /* Query */
typeId[1] = OIDOID; /* operator OID */
- typeId[2] = 0; /* args list (opaque type) */
+ typeId[2] = INTERNALOID; /* args list */
typeId[3] = INT4OID; /* varRelid */
restOid = LookupFuncName(restrictionName, 4, typeId);
if (joinName)
{
MemSet(typeId, 0, FUNC_MAX_ARGS * sizeof(Oid));
- typeId[0] = 0; /* Query (opaque type) */
+ typeId[0] = INTERNALOID; /* Query */
typeId[1] = OIDOID; /* operator OID */
- typeId[2] = 0; /* args list (opaque type) */
+ typeId[2] = INTERNALOID; /* args list */
joinOid = LookupFuncName(joinName, 3, typeId);
if (!OidIsValid(joinOid))
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.88 2002/08/05 03:29:16 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.89 2002/08/22 00:01:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
elog(ERROR, "there is no built-in function named \"%s\"", prosrc);
ReleaseSysCache(tuple);
- PG_RETURN_BOOL(true);
+
+ PG_RETURN_VOID();
}
(void) fetch_finfo_record(libraryhandle, prosrc);
ReleaseSysCache(tuple);
- PG_RETURN_BOOL(true);
-}
+ PG_RETURN_VOID();
+}
/*
Datum tmp;
char *prosrc;
char functyptype;
+ int i;
tuple = SearchSysCache(PROCOID, funcoid, 0, 0, 0);
if (!HeapTupleIsValid(tuple))
proc = (Form_pg_proc) GETSTRUCT(tuple);
- if (!OidIsValid(proc->prorettype))
- elog(ERROR, "SQL functions cannot return type \"opaque\"");
+ /* Disallow pseudotypes in arguments and result */
+ /* except that return type can be RECORD */
+ if (get_typtype(proc->prorettype) == 'p' &&
+ proc->prorettype != RECORDOID)
+ elog(ERROR, "SQL functions cannot return type %s",
+ format_type_be(proc->prorettype));
+
+ for (i = 0; i < proc->pronargs; i++)
+ {
+ if (get_typtype(proc->proargtypes[i]) == 'p')
+ elog(ERROR, "SQL functions cannot have arguments of type %s",
+ format_type_be(proc->proargtypes[i]));
+ }
tmp = SysCacheGetAttr(PROCOID, tuple, Anum_pg_proc_prosrc, &isnull);
if (isnull)
checkretval(proc->prorettype, functyptype, querytree_list);
ReleaseSysCache(tuple);
- PG_RETURN_BOOL(true);
+
+ PG_RETURN_VOID();
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/aggregatecmds.c,v 1.3 2002/07/12 18:43:15 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/aggregatecmds.c,v 1.4 2002/08/22 00:01:41 tgl Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
#include "catalog/namespace.h"
#include "catalog/pg_aggregate.h"
#include "catalog/pg_proc.h"
+#include "catalog/pg_type.h"
#include "commands/defrem.h"
#include "miscadmin.h"
#include "parser/parse_func.h"
elog(ERROR, "Define: \"sfunc\" unspecified");
/*
- * Handle the aggregate's base type (input data type). This can be
- * specified as 'ANY' for a data-independent transition function, such
- * as COUNT(*).
+ * look up the aggregate's base type (input datatype) and transtype.
+ *
+ * We have historically allowed the command to look like basetype = 'ANY'
+ * so we must do a case-insensitive comparison for the name ANY. Ugh.
+ *
+ * basetype can be a pseudo-type, but transtype can't, since we need
+ * to be able to store values of the transtype.
*/
- baseTypeId = LookupTypeName(baseType);
- if (OidIsValid(baseTypeId))
- {
- /* no need to allow aggregates on as-yet-undefined types */
- if (!get_typisdefined(baseTypeId))
- elog(ERROR, "Type \"%s\" is only a shell",
- TypeNameToString(baseType));
- }
+ if (strcasecmp(TypeNameToString(baseType), "ANY") == 0)
+ baseTypeId = ANYOID;
else
- {
- char *typnam = TypeNameToString(baseType);
-
- if (strcasecmp(typnam, "ANY") != 0)
- elog(ERROR, "Type \"%s\" does not exist", typnam);
- baseTypeId = InvalidOid;
- }
+ baseTypeId = typenameTypeId(baseType);
- /* handle transtype --- no special cases here */
transTypeId = typenameTypeId(transType);
+ if (get_typtype(transTypeId) == 'p')
+ elog(ERROR, "Aggregate transition datatype cannot be %s",
+ format_type_be(transTypeId));
/*
* Most of the argument-checking is done inside of AggregateCreate
* if a basetype is passed in, then attempt to find an aggregate for
* that specific type.
*
- * else if the basetype is blank, then attempt to find an aggregate with
- * a basetype of zero. This is valid. It means that the aggregate is
- * to apply to all basetypes (eg, COUNT).
+ * else attempt to find an aggregate with a basetype of ANYOID.
+ * This means that the aggregate is to apply to all basetypes (eg, COUNT).
*/
if (aggType)
basetypeID = typenameTypeId(aggType);
else
- basetypeID = InvalidOid;
+ basetypeID = ANYOID;
procOid = find_aggregate_func("RemoveAggregate", aggName, basetypeID);
* Copyright (c) 1996-2001, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/comment.c,v 1.56 2002/08/09 16:45:14 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/comment.c,v 1.57 2002/08/22 00:01:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "catalog/pg_operator.h"
#include "catalog/pg_rewrite.h"
#include "catalog/pg_trigger.h"
+#include "catalog/pg_type.h"
#include "commands/comment.h"
#include "commands/dbcommands.h"
#include "miscadmin.h"
if (aggtype)
baseoid = typenameTypeId(aggtype);
else
- baseoid = InvalidOid;
+ baseoid = ANYOID;
/* Now, attempt to find the actual tuple in pg_proc */
/* Look up the procedure */
oid = LookupFuncNameTypeNames(function, arguments,
- true, "CommentProc");
+ "CommentProc");
/* Now, validate the user's ability to comment on this function */
/*-------------------------------------------------------------------------
*
- * conversionmacmds.c
+ * conversioncmds.c
* conversion creation command support code
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/conversioncmds.c,v 1.2 2002/07/25 10:07:11 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/conversioncmds.c,v 1.3 2002/08/22 00:01:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
const char *to_encoding_name = stmt->to_encoding_name;
List *func_name = stmt->func_name;
- static Oid funcargs[] = {INT4OID, INT4OID, 0, 0, INT4OID};
+ static Oid funcargs[] = {INT4OID, INT4OID, CSTRINGOID, CSTRINGOID, INT4OID};
/* Convert list of names to a name and namespace */
namespaceId = QualifiedNameGetCreationNamespace(stmt->conversion_name, &conversion_name);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.165 2002/08/19 15:08:46 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.166 2002/08/22 00:01:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/relcache.h"
+#include "utils/lsyscache.h"
#include "utils/syscache.h"
#ifdef MULTIBYTE
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.17 2002/08/11 17:44:12 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.18 2002/08/22 00:01:42 tgl Exp $
*
* DESCRIPTION
* These routines take the parse tree and pick out the
* allow a shell type to be used, or even created if the specified return type
* doesn't exist yet. (Without this, there's no way to define the I/O procs
* for a new type.) But SQL function creation won't cope, so error out if
- * the target language is SQL.
+ * the target language is SQL. (We do this here, not in the SQL-function
+ * validator, so as not to produce a WARNING and then an ERROR for the same
+ * condition.)
*/
static void
compute_return_type(TypeName *returnType, Oid languageOid,
if (!get_typisdefined(rettype))
{
if (languageOid == SQLlanguageId)
- elog(ERROR, "SQL functions cannot return shell types");
+ elog(ERROR, "SQL function cannot return shell type \"%s\"",
+ TypeNameToString(returnType));
else
elog(WARNING, "Return type \"%s\" is only a shell",
TypeNameToString(returnType));
else
{
char *typnam = TypeNameToString(returnType);
+ Oid namespaceId;
+ AclResult aclresult;
+ char *typname;
- if (strcmp(typnam, "opaque") == 0)
- rettype = InvalidOid;
- else
- {
- Oid namespaceId;
- AclResult aclresult;
- char *typname;
-
- if (languageOid == SQLlanguageId)
- elog(ERROR, "Type \"%s\" does not exist", typnam);
- elog(WARNING, "ProcedureCreate: type %s is not yet defined",
- typnam);
- namespaceId = QualifiedNameGetCreationNamespace(returnType->names,
- &typname);
- aclresult = pg_namespace_aclcheck(namespaceId, GetUserId(),
- ACL_CREATE);
- if (aclresult != ACLCHECK_OK)
- aclcheck_error(aclresult, get_namespace_name(namespaceId));
- rettype = TypeShellMake(typname, namespaceId);
- if (!OidIsValid(rettype))
- elog(ERROR, "could not create type %s", typnam);
- }
+ /*
+ * Only C-coded functions can be I/O functions. We enforce this
+ * restriction here mainly to prevent littering the catalogs with
+ * shell types due to simple typos in user-defined function
+ * definitions.
+ */
+ if (languageOid != INTERNALlanguageId &&
+ languageOid != ClanguageId)
+ elog(ERROR, "Type \"%s\" does not exist", typnam);
+
+ /* Otherwise, go ahead and make a shell type */
+ elog(WARNING, "ProcedureCreate: type %s is not yet defined",
+ typnam);
+ namespaceId = QualifiedNameGetCreationNamespace(returnType->names,
+ &typname);
+ aclresult = pg_namespace_aclcheck(namespaceId, GetUserId(),
+ ACL_CREATE);
+ if (aclresult != ACLCHECK_OK)
+ aclcheck_error(aclresult, get_namespace_name(namespaceId));
+ rettype = TypeShellMake(typname, namespaceId);
+ if (!OidIsValid(rettype))
+ elog(ERROR, "could not create type %s", typnam);
}
*prorettype_p = rettype;
if (OidIsValid(toid))
{
if (!get_typisdefined(toid))
- elog(WARNING, "Argument type \"%s\" is only a shell",
- TypeNameToString(t));
- }
- else
- {
- char *typnam = TypeNameToString(t);
-
- if (strcmp(typnam, "opaque") == 0)
{
+ /* As above, hard error if language is SQL */
if (languageOid == SQLlanguageId)
- elog(ERROR, "SQL functions cannot have arguments of type \"opaque\"");
- toid = InvalidOid;
+ elog(ERROR, "SQL function cannot accept shell type \"%s\"",
+ TypeNameToString(t));
+ else
+ elog(WARNING, "Argument type \"%s\" is only a shell",
+ TypeNameToString(t));
}
- else
- elog(ERROR, "Type \"%s\" does not exist", typnam);
+ }
+ else
+ {
+ elog(ERROR, "Type \"%s\" does not exist",
+ TypeNameToString(t));
}
if (t->setof)
- elog(ERROR, "functions cannot accept set arguments");
+ elog(ERROR, "Functions cannot accept set arguments");
parameterTypes[parameterCount++] = toid;
}
* Find the function, do permissions and validity checks
*/
funcOid = LookupFuncNameTypeNames(functionName, argTypes,
- true, "RemoveFunction");
+ "RemoveFunction");
tup = SearchSysCache(PROCOID,
ObjectIdGetDatum(funcOid),
if (sourcetypeid == targettypeid)
elog(ERROR, "source data type and target data type are the same");
+ /* No shells, no pseudo-types allowed */
+ if (!get_typisdefined(sourcetypeid))
+ elog(ERROR, "source data type %s is only a shell",
+ TypeNameToString(stmt->sourcetype));
+
+ if (!get_typisdefined(targettypeid))
+ elog(ERROR, "target data type %s is only a shell",
+ TypeNameToString(stmt->targettype));
+
+ if (get_typtype(sourcetypeid) == 'p')
+ elog(ERROR, "source data type %s is a pseudo-type",
+ TypeNameToString(stmt->sourcetype));
+
+ if (get_typtype(targettypeid) == 'p')
+ elog(ERROR, "target data type %s is a pseudo-type",
+ TypeNameToString(stmt->targettype));
+
if (!pg_type_ownercheck(sourcetypeid, GetUserId())
&& !pg_type_ownercheck(targettypeid, GetUserId()))
elog(ERROR, "must be owner of type %s or type %s",
{
funcid = LookupFuncNameTypeNames(stmt->func->funcname,
stmt->func->funcargs,
- false,
"CreateCast");
tuple = SearchSysCache(PROCOID, ObjectIdGetDatum(funcid), 0, 0, 0);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/opclasscmds.c,v 1.3 2002/08/05 03:29:16 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/opclasscmds.c,v 1.4 2002/08/22 00:01:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
elog(ERROR, "DefineOpClass: procedure number %d appears more than once",
item->number);
funcOid = LookupFuncNameTypeNames(item->name, item->args,
- true, "DefineOpClass");
+ "DefineOpClass");
/* Caller must have execute permission on functions */
aclresult = pg_proc_aclcheck(funcOid, GetUserId(),
ACL_EXECUTE);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.40 2002/08/13 17:22:08 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.41 2002/08/22 00:01:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
elog(ERROR, "Language %s already exists", languageName);
/*
- * Lookup the PL handler function and check that it is of return type
- * Opaque
+ * Lookup the PL handler function and check that it is of the expected
+ * return type
*/
MemSet(typev, 0, sizeof(typev));
procOid = LookupFuncName(stmt->plhandler, 0, typev);
if (!OidIsValid(procOid))
elog(ERROR, "function %s() doesn't exist",
NameListToString(stmt->plhandler));
- if (get_func_rettype(procOid) != InvalidOid)
- elog(ERROR, "function %s() does not return type \"opaque\"",
- NameListToString(stmt->plhandler));
+ if (get_func_rettype(procOid) != LANGUAGE_HANDLEROID)
+ elog(ERROR, "function %s() does not return type %s",
+ NameListToString(stmt->plhandler),
+ format_type_be(LANGUAGE_HANDLEROID));
/* validate the validator function */
if (stmt->plvalidator)
if (!OidIsValid(valProcOid))
elog(ERROR, "function %s(oid) doesn't exist",
NameListToString(stmt->plvalidator));
+ /* return value is ignored, so we don't check the type */
}
else
valProcOid = InvalidOid;
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.127 2002/08/18 11:20:05 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.128 2002/08/22 00:01:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "catalog/pg_language.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_trigger.h"
+#include "catalog/pg_type.h"
#include "commands/trigger.h"
#include "executor/executor.h"
#include "miscadmin.h"
if (!HeapTupleIsValid(tuple))
elog(ERROR, "CreateTrigger: function %s() does not exist",
NameListToString(stmt->funcname));
- if (((Form_pg_proc) GETSTRUCT(tuple))->prorettype != 0)
- elog(ERROR, "CreateTrigger: function %s() must return OPAQUE",
- NameListToString(stmt->funcname));
+ if (((Form_pg_proc) GETSTRUCT(tuple))->prorettype != TRIGGEROID)
+ {
+ /* OPAQUE is deprecated, but allowed for backwards compatibility */
+ if (((Form_pg_proc) GETSTRUCT(tuple))->prorettype == OPAQUEOID)
+ elog(NOTICE, "CreateTrigger: OPAQUE is deprecated, use type TRIGGER instead to define trigger functions");
+ else
+ elog(ERROR, "CreateTrigger: function %s() must return TRIGGER",
+ NameListToString(stmt->funcname));
+ }
ReleaseSysCache(tuple);
/*
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.9 2002/08/15 16:36:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.10 2002/08/22 00:01:42 tgl Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
#include "utils/syscache.h"
-static Oid findTypeIOFunction(List *procname, bool isOutput);
+static Oid findTypeIOFunction(List *procname, Oid typeOid, bool isOutput);
/*
* DefineType
char *shadow_type;
List *pl;
Oid typoid;
+ Oid resulttype;
/* Convert list of names to a name and namespace */
typeNamespace = QualifiedNameGetCreationNamespace(names, &typeName);
delimiter = p[0];
}
else if (strcasecmp(defel->defname, "element") == 0)
+ {
elemType = typenameTypeId(defGetTypeName(defel));
+ /* disallow arrays of pseudotypes */
+ if (get_typtype(elemType) == 'p')
+ elog(ERROR, "Array element type cannot be %s",
+ format_type_be(elemType));
+ }
else if (strcasecmp(defel->defname, "default") == 0)
defaultValue = defGetString(defel);
else if (strcasecmp(defel->defname, "passedbyvalue") == 0)
if (outputName == NIL)
elog(ERROR, "Define: \"output\" unspecified");
- /* Convert I/O proc names to OIDs */
- inputOid = findTypeIOFunction(inputName, false);
- outputOid = findTypeIOFunction(outputName, true);
+ /*
+ * Look to see if type already exists (presumably as a shell; if not,
+ * TypeCreate will complain). If it does then the declarations of the
+ * I/O functions might use it.
+ */
+ typoid = GetSysCacheOid(TYPENAMENSP,
+ CStringGetDatum(typeName),
+ ObjectIdGetDatum(typeNamespace),
+ 0, 0);
+
+ /*
+ * Convert I/O proc names to OIDs
+ */
+ inputOid = findTypeIOFunction(inputName, typoid, false);
+ outputOid = findTypeIOFunction(outputName, typoid, true);
+
+ /*
+ * Verify that I/O procs return the expected thing. OPAQUE is an allowed
+ * (but deprecated) alternative to the fully type-safe choices.
+ */
+ resulttype = get_func_rettype(inputOid);
+ if (!((OidIsValid(typoid) && resulttype == typoid) ||
+ resulttype == OPAQUEOID))
+ elog(ERROR, "Type input function %s must return %s or OPAQUE",
+ NameListToString(inputName), typeName);
+ resulttype = get_func_rettype(outputOid);
+ if (!(resulttype == CSTRINGOID ||
+ resulttype == OPAQUEOID))
+ elog(ERROR, "Type output function %s must return CSTRING or OPAQUE",
+ NameListToString(outputName));
/*
* now have TypeCreate do all the real work.
basetypeoid = HeapTupleGetOid(typeTup);
/*
- * What we really don't want is domains of domains. This could cause all sorts
- * of neat issues if we allow that.
- *
- * With testing, we may determine complex types should be allowed
+ * Base type must be a plain base type. Domains over pseudo types would
+ * create a security hole. Domains of domains might be made to work in
+ * the future, but not today. Ditto for domains over complex types.
*/
typtype = baseType->typtype;
if (typtype != 'b')
/*
* Find a suitable I/O function for a type.
+ *
+ * typeOid is the type's OID, if it already exists as a shell type,
+ * otherwise InvalidOid.
*/
static Oid
-findTypeIOFunction(List *procname, bool isOutput)
+findTypeIOFunction(List *procname, Oid typeOid, bool isOutput)
{
Oid argList[FUNC_MAX_ARGS];
- int nargs;
Oid procOid;
- /*
- * First look for a 1-argument func with all argtypes 0. This is
- * valid for all kinds of procedure.
- */
- MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid));
-
- procOid = LookupFuncName(procname, 1, argList);
-
- if (!OidIsValid(procOid))
+ if (isOutput)
{
/*
- * Alternatively, input procedures may take 3 args (data
- * value, element OID, atttypmod); the pg_proc argtype
- * signature is 0,OIDOID,INT4OID. Output procedures may
- * take 2 args (data value, element OID).
+ * Output functions can take a single argument of the type,
+ * or two arguments (data value, element OID). The signature
+ * may use OPAQUE in place of the actual type name; this is the
+ * only possibility if the type doesn't yet exist as a shell.
*/
- if (isOutput)
- {
- /* output proc */
- nargs = 2;
- argList[1] = OIDOID;
- }
- else
+ if (OidIsValid(typeOid))
{
- /* input proc */
- nargs = 3;
+ MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid));
+
+ argList[0] = typeOid;
+
+ procOid = LookupFuncName(procname, 1, argList);
+ if (OidIsValid(procOid))
+ return procOid;
+
argList[1] = OIDOID;
- argList[2] = INT4OID;
+
+ procOid = LookupFuncName(procname, 2, argList);
+ if (OidIsValid(procOid))
+ return procOid;
+
}
- procOid = LookupFuncName(procname, nargs, argList);
- if (!OidIsValid(procOid))
- func_error("TypeCreate", procname, 1, argList, NULL);
+ MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid));
+
+ argList[0] = OPAQUEOID;
+
+ procOid = LookupFuncName(procname, 1, argList);
+ if (OidIsValid(procOid))
+ return procOid;
+
+ argList[1] = OIDOID;
+
+ procOid = LookupFuncName(procname, 2, argList);
+ if (OidIsValid(procOid))
+ return procOid;
+
+ /* Prefer type name over OPAQUE in the failure message. */
+ if (OidIsValid(typeOid))
+ argList[0] = typeOid;
+
+ func_error("TypeCreate", procname, 1, argList, NULL);
}
+ else
+ {
+ /*
+ * Input functions can take a single argument of type CSTRING,
+ * or three arguments (string, element OID, typmod). The signature
+ * may use OPAQUE in place of CSTRING.
+ */
+ MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid));
+
+ argList[0] = CSTRINGOID;
+
+ procOid = LookupFuncName(procname, 1, argList);
+ if (OidIsValid(procOid))
+ return procOid;
- return procOid;
+ argList[1] = OIDOID;
+ argList[2] = INT4OID;
+
+ procOid = LookupFuncName(procname, 3, argList);
+ if (OidIsValid(procOid))
+ return procOid;
+
+ MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid));
+
+ argList[0] = OPAQUEOID;
+
+ procOid = LookupFuncName(procname, 1, argList);
+ if (OidIsValid(procOid))
+ return procOid;
+
+ argList[1] = OIDOID;
+ argList[2] = INT4OID;
+
+ procOid = LookupFuncName(procname, 3, argList);
+ if (OidIsValid(procOid))
+ return procOid;
+
+ /* Use CSTRING (preferred) in the error message */
+ argList[0] = CSTRINGOID;
+
+ func_error("TypeCreate", procname, 1, argList, NULL);
+ }
+
+ return InvalidOid; /* keep compiler quiet */
}
+
/*-------------------------------------------------------------------
* DefineCompositeType
*
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.79 2002/07/20 05:29:01 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.80 2002/08/22 00:01:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
Node *result;
if (targetTypeId == inputTypeId ||
- targetTypeId == InvalidOid ||
node == NULL)
{
/* no conversion needed, but constraints may need to be applied */
if (targetTypeId != baseTypeId)
result = (Node *) TypeConstraints(result, targetTypeId);
}
+ else if (targetTypeId == ANYOID ||
+ targetTypeId == ANYARRAYOID)
+ {
+ /* assume can_coerce_type verified that implicit coercion is okay */
+ result = node;
+ }
else if (IsBinaryCompatible(inputTypeId, targetTypeId))
{
/*
if (inputTypeId == targetTypeId)
continue;
- /*
- * one of the known-good transparent conversions? then drop
- * through...
- */
- if (IsBinaryCompatible(inputTypeId, targetTypeId))
- continue;
-
- /* don't know what to do for the output type? then quit... */
- if (targetTypeId == InvalidOid)
+ /* don't choke on references to no-longer-existing types */
+ if (!typeidIsValid(inputTypeId))
return false;
- /* don't know what to do for the input type? then quit... */
- if (inputTypeId == InvalidOid)
+ if (!typeidIsValid(targetTypeId))
return false;
/*
continue;
}
+ /* accept if target is ANY */
+ if (targetTypeId == ANYOID)
+ continue;
+
+ /* if target is ANYARRAY and source is a varlena array type, accept */
+ if (targetTypeId == ANYARRAYOID)
+ {
+ Oid typOutput;
+ Oid typElem;
+ bool typIsVarlena;
+
+ if (getTypeOutputInfo(inputTypeId, &typOutput, &typElem,
+ &typIsVarlena))
+ {
+ if (OidIsValid(typElem) && typIsVarlena)
+ continue;
+ }
+ /*
+ * Otherwise reject; this assumes there are no explicit coercions
+ * to ANYARRAY. If we don't reject then parse_coerce would have
+ * to repeat the above test.
+ */
+ return false;
+ }
+
+ /*
+ * one of the known-good transparent conversions? then drop
+ * through...
+ */
+ if (IsBinaryCompatible(inputTypeId, targetTypeId))
+ continue;
+
/*
* If input is a class type that inherits from target, no problem
*/
if (typeInheritsFrom(inputTypeId, targetTypeId))
continue;
- /* don't choke on references to no-longer-existing types */
- if (!typeidIsValid(inputTypeId))
- return false;
- if (!typeidIsValid(targetTypeId))
- return false;
-
/*
* Else, try for run-time conversion using functions: look for a
* single-argument function named with the target type name and
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.134 2002/08/08 01:44:30 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.135 2002/08/22 00:01:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
{
if (i)
appendStringInfo(&argbuf, ", ");
- if (OidIsValid(argtypes[i]))
- appendStringInfo(&argbuf, format_type_be(argtypes[i]));
- else
- appendStringInfo(&argbuf, "opaque");
+ appendStringInfo(&argbuf, format_type_be(argtypes[i]));
}
if (caller == NULL)
* Convenience routine to check that a function exists and is an
* aggregate.
*
- * Note: basetype is InvalidOid if we are looking for an aggregate on
+ * Note: basetype is ANYOID if we are looking for an aggregate on
* all types.
*/
Oid
if (!OidIsValid(oid))
{
- if (basetype == InvalidOid)
+ if (basetype == ANYOID)
elog(ERROR, "%s: aggregate %s(*) does not exist",
caller, NameListToString(aggname));
else
if (!pform->proisagg)
{
- if (basetype == InvalidOid)
+ if (basetype == ANYOID)
elog(ERROR, "%s: function %s(*) is not an aggregate",
caller, NameListToString(aggname));
else
* Like LookupFuncName, but the argument types are specified by a
* list of TypeName nodes. Also, if we fail to find the function
* and caller is not NULL, then an error is reported via func_error.
- *
- * "opaque" is accepted as a typename only if opaqueOK is true.
*/
Oid
-LookupFuncNameTypeNames(List *funcname, List *argtypes, bool opaqueOK,
- const char *caller)
+LookupFuncNameTypeNames(List *funcname, List *argtypes, const char *caller)
{
Oid funcoid;
Oid argoids[FUNC_MAX_ARGS];
TypeName *t = (TypeName *) lfirst(argtypes);
argoids[i] = LookupTypeName(t);
- if (!OidIsValid(argoids[i]))
- {
- char *typnam = TypeNameToString(t);
- if (opaqueOK && strcmp(typnam, "opaque") == 0)
- argoids[i] = InvalidOid;
- else
- elog(ERROR, "Type \"%s\" does not exist", typnam);
- }
+ if (!OidIsValid(argoids[i]))
+ elog(ERROR, "Type \"%s\" does not exist",
+ TypeNameToString(t));
argtypes = lnext(argtypes);
}
#
# Makefile for utils/adt
#
-# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.52 2002/08/17 13:04:15 momjian Exp $
+# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.53 2002/08/22 00:01:43 tgl Exp $
#
subdir = src/backend/utils/adt
date.o datetime.o datum.o float.o format_type.o \
geo_ops.o geo_selfuncs.o int.o int8.o like.o lockfuncs.o \
misc.o nabstime.o name.o not_in.o numeric.o numutils.o \
- oid.o oracle_compat.o \
+ oid.o oracle_compat.o pseudotypes.o \
regexp.o regproc.o ruleutils.o selfuncs.o sets.o \
tid.o timestamp.o varbit.o varchar.o varlena.o version.o \
network.o mac.o inet_net_ntop.o inet_net_pton.o \
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.51 2002/06/20 20:29:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.52 2002/08/22 00:01:43 tgl Exp $
*
*-------------------------------------------------------------------------
*/
PG_RETURN_BOOL(memcmp(arg1, arg2, INDEX_MAX_KEYS * sizeof(int16)) == 0);
}
-/*
- * Type int44 has no real-world use, but the regression tests use it.
- * It's a four-element vector of int4's.
- */
-
-/*
- * int44in - converts "num num ..." to internal form
- *
- * Note: Fills any missing positions with zeroes.
- */
-Datum
-int44in(PG_FUNCTION_ARGS)
-{
- char *input_string = PG_GETARG_CSTRING(0);
- int32 *result = (int32 *) palloc(4 * sizeof(int32));
- int i;
-
- i = sscanf(input_string,
- "%d, %d, %d, %d",
- &result[0],
- &result[1],
- &result[2],
- &result[3]);
- while (i < 4)
- result[i++] = 0;
-
- PG_RETURN_POINTER(result);
-}
-
-/*
- * int44out - converts internal form to "num num ..."
- */
-Datum
-int44out(PG_FUNCTION_ARGS)
-{
- int32 *an_array = (int32 *) PG_GETARG_POINTER(0);
- char *result = (char *) palloc(16 * 4); /* Allow 14 digits +
- * sign */
- int i;
- char *walk;
-
- walk = result;
- for (i = 0; i < 4; i++)
- {
- pg_ltoa(an_array[i], walk);
- while (*++walk != '\0')
- ;
- *walk++ = ' ';
- }
- *--walk = '\0';
- PG_RETURN_CSTRING(result);
-}
-
/*****************************************************************************
* PUBLIC ROUTINES *
--- /dev/null
+/*-------------------------------------------------------------------------
+ *
+ * pseudotypes.c
+ * Functions for the system pseudo-types.
+ *
+ * A pseudo-type isn't really a type and never has any operations, but
+ * we do need to supply input and output functions to satisfy the links
+ * in the pseudo-type's entry in pg_type. In most cases the functions
+ * just throw an error if invoked. (XXX the error messages here cover
+ * the most common case, but might be confusing in some contexts. Can
+ * we do better?)
+ *
+ *
+ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/pseudotypes.c,v 1.1 2002/08/22 00:01:43 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#include "postgres.h"
+
+#include "utils/builtins.h"
+
+
+/*
+ * record_in - input routine for pseudo-type RECORD.
+ */
+Datum
+record_in(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot accept a constant of type %s", "RECORD");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+/*
+ * record_out - output routine for pseudo-type RECORD.
+ */
+Datum
+record_out(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot display a value of type %s", "RECORD");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+
+/*
+ * cstring_in - input routine for pseudo-type CSTRING.
+ */
+Datum
+cstring_in(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot accept a constant of type %s", "CSTRING");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+/*
+ * cstring_out - output routine for pseudo-type CSTRING.
+ */
+Datum
+cstring_out(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot display a value of type %s", "CSTRING");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+
+/*
+ * any_in - input routine for pseudo-type ANY.
+ */
+Datum
+any_in(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot accept a constant of type %s", "ANY");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+/*
+ * any_out - output routine for pseudo-type ANY.
+ */
+Datum
+any_out(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot display a value of type %s", "ANY");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+
+/*
+ * anyarray_in - input routine for pseudo-type ANYARRAY.
+ */
+Datum
+anyarray_in(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot accept a constant of type %s", "ANYARRAY");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+/*
+ * anyarray_out - output routine for pseudo-type ANYARRAY.
+ */
+Datum
+anyarray_out(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot display a value of type %s", "ANYARRAY");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+
+/*
+ * void_in - input routine for pseudo-type VOID.
+ *
+ * We allow this so that PL functions can return VOID without any special
+ * hack in the PL handler. Whatever value the PL thinks it's returning
+ * will just be ignored.
+ */
+Datum
+void_in(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_VOID(); /* you were expecting something different? */
+}
+
+/*
+ * void_out - output routine for pseudo-type VOID.
+ *
+ * We allow this so that "SELECT function_returning_void(...)" works.
+ */
+Datum
+void_out(PG_FUNCTION_ARGS)
+{
+ PG_RETURN_CSTRING(pstrdup(""));
+}
+
+
+/*
+ * trigger_in - input routine for pseudo-type TRIGGER.
+ */
+Datum
+trigger_in(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot accept a constant of type %s", "TRIGGER");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+/*
+ * trigger_out - output routine for pseudo-type TRIGGER.
+ */
+Datum
+trigger_out(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot display a value of type %s", "TRIGGER");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+
+/*
+ * language_handler_in - input routine for pseudo-type LANGUAGE_HANDLER.
+ */
+Datum
+language_handler_in(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot accept a constant of type %s", "LANGUAGE_HANDLER");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+/*
+ * language_handler_out - output routine for pseudo-type LANGUAGE_HANDLER.
+ */
+Datum
+language_handler_out(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot display a value of type %s", "LANGUAGE_HANDLER");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+
+/*
+ * internal_in - input routine for pseudo-type INTERNAL.
+ */
+Datum
+internal_in(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot accept a constant of type %s", "INTERNAL");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+/*
+ * internal_out - output routine for pseudo-type INTERNAL.
+ */
+Datum
+internal_out(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot display a value of type %s", "INTERNAL");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+
+/*
+ * opaque_in - input routine for pseudo-type OPAQUE.
+ */
+Datum
+opaque_in(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot accept a constant of type %s", "OPAQUE");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
+
+/*
+ * opaque_out - output routine for pseudo-type OPAQUE.
+ */
+Datum
+opaque_out(PG_FUNCTION_ARGS)
+{
+ elog(ERROR, "Cannot display a value of type %s", "OPAQUE");
+
+ PG_RETURN_VOID(); /* keep compiler quiet */
+}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.72 2002/07/29 22:14:11 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.73 2002/08/22 00:01:43 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "utils/syscache.h"
static void parseNameAndArgTypes(const char *string, const char *caller,
- const char *type0_spelling,
+ bool allowNone,
List **names, int *nargs, Oid *argtypes);
* datatype cannot be used for any system column that needs to receive
* data during bootstrap.
*/
- parseNameAndArgTypes(pro_name_or_oid, "regprocedurein", "opaque",
+ parseNameAndArgTypes(pro_name_or_oid, "regprocedurein", false,
&names, &nargs, argtypes);
clist = FuncnameGetCandidates(names, nargs);
if (i > 0)
appendStringInfoChar(&buf, ',');
- if (OidIsValid(thisargtype))
- appendStringInfo(&buf, "%s", format_type_be(thisargtype));
- else
- appendStringInfo(&buf, "opaque");
+ appendStringInfo(&buf, "%s", format_type_be(thisargtype));
}
appendStringInfoChar(&buf, ')');
* datatype cannot be used for any system column that needs to receive
* data during bootstrap.
*/
- parseNameAndArgTypes(opr_name_or_oid, "regoperatorin", "none",
+ parseNameAndArgTypes(opr_name_or_oid, "regoperatorin", true,
&names, &nargs, argtypes);
if (nargs == 1)
elog(ERROR, "regoperatorin: use NONE to denote the missing argument of a unary operator");
* the argtypes array should be of size FUNC_MAX_ARGS). The function or
* operator name is returned to *names as a List of Strings.
*
- * If type0_spelling is not NULL, it is a name to be accepted as a
- * placeholder for OID 0.
+ * If allowNone is TRUE, accept "NONE" and return it as InvalidOid (this is
+ * for unary operators).
*/
static void
parseNameAndArgTypes(const char *string, const char *caller,
- const char *type0_spelling,
+ bool allowNone,
List **names, int *nargs, Oid *argtypes)
{
char *rawname;
*ptr2 = '\0';
}
- if (type0_spelling && strcasecmp(typename, type0_spelling) == 0)
+ if (allowNone && strcasecmp(typename, "none") == 0)
{
- /* Special case for OPAQUE or NONE */
+ /* Special case for NONE */
typeid = InvalidOid;
typmod = -1;
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.112 2002/06/20 20:29:38 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.113 2002/08/22 00:01:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*
* This is represented at the SQL level (in pg_proc) as
*
- * float8 oprrest (opaque, oid, opaque, int4);
+ * float8 oprrest (internal, oid, internal, int4);
*
* The call convention for a join estimator (oprjoin function) is similar
* except that varRelid is not needed:
* Oid operator,
* List *args);
*
- * float8 oprjoin (opaque, oid, opaque);
+ * float8 oprjoin (internal, oid, internal);
*----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.78 2002/08/05 02:30:50 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.79 2002/08/22 00:01:44 tgl Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
return '\0';
}
+/*
+ * getTypeOutputInfo
+ *
+ * Get info needed for printing values of a type
+ *
+ * Returns true if data valid (a false result probably means it's a shell type)
+ */
+bool
+getTypeOutputInfo(Oid type, Oid *typOutput, Oid *typElem,
+ bool *typIsVarlena)
+{
+ HeapTuple typeTuple;
+ Form_pg_type pt;
+
+ typeTuple = SearchSysCache(TYPEOID,
+ ObjectIdGetDatum(type),
+ 0, 0, 0);
+ if (!HeapTupleIsValid(typeTuple))
+ elog(ERROR, "getTypeOutputInfo: Cache lookup of type %u failed", type);
+ pt = (Form_pg_type) GETSTRUCT(typeTuple);
+
+ *typOutput = pt->typoutput;
+ *typElem = pt->typelem;
+ *typIsVarlena = (!pt->typbyval) && (pt->typlen == -1);
+ ReleaseSysCache(typeTuple);
+ return OidIsValid(*typOutput);
+}
+
/* ---------- STATISTICS CACHE ---------- */
# Makefile for utils/mb/conversion_procs
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.4 2002/08/14 02:45:10 ishii Exp $
+# $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.5 2002/08/22 00:01:44 tgl Exp $
#
#-------------------------------------------------------------------------
func=$$1; shift; \
obj=$$1; shift; \
echo "-- $$se --> $$de"; \
- echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, OPAQUE, OPAQUE, INTEGER) RETURNS INTEGER AS '$$"libdir"/$$obj', '$$func' LANGUAGE 'c';"; \
+ echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, CSTRING, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE 'c';"; \
echo "DROP CONVERSION pg_catalog.$$name;"; \
echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
done > $@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/ascii_and_mic/ascii_and_mic.c,v 1.1 2002/08/14 02:45:10 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/ascii_and_mic/ascii_and_mic.c,v 1.2 2002/08/22 00:01:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c,v 1.1 2002/08/14 02:45:10 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c,v 1.2 2002/08/22 00:01:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c,v 1.1 2002/08/14 02:45:10 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c,v 1.2 2002/08/22 00:01:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c,v 1.1 2002/07/16 09:25:05 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c,v 1.2 2002/08/22 00:01:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c,v 1.1 2002/08/14 02:45:10 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c,v 1.2 2002/08/22 00:01:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c,v 1.1 2002/07/16 09:25:05 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c,v 1.2 2002/08/22 00:01:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c,v 1.1 2002/08/14 02:45:10 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c,v 1.2 2002/08/22 00:01:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c,v 1.1 2002/08/14 02:45:10 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c,v 1.1 2002/07/16 09:25:05 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c,v 1.1 2002/07/16 09:25:05 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
Datum
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c,v 1.1 2002/08/14 02:45:10 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c,v 1.1 2002/07/16 09:25:05 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
Datum
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c,v 1.1 2002/07/16 09:25:05 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
Datum
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c,v 1.1 2002/07/16 09:25:05 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
Datum
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c,v 1.1 2002/07/16 09:25:05 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
Datum
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c,v 1.1 2002/07/16 09:25:05 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
Datum
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c,v 1.1 2002/07/16 09:25:05 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
Datum
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c,v 1.1 2002/07/16 09:25:05 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c,v 1.1 2002/07/16 09:25:05 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c,v 1.1 2002/07/16 09:25:06 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
Datum
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c,v 1.1 2002/07/16 09:25:06 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
Datum
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/Attic/utf8_and_tcvn.c,v 1.1 2002/07/16 09:25:06 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/Attic/utf8_and_tcvn.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
Datum
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c,v 1.1 2002/07/16 09:25:06 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
Datum
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1250/Attic/utf8_and_win1250.c,v 1.1 2002/08/14 02:45:10 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1250/Attic/utf8_and_win1250.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1256/Attic/utf8_and_win1256.c,v 1.1 2002/08/14 02:45:10 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1256/Attic/utf8_and_win1256.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win874/Attic/utf8_and_win874.c,v 1.1 2002/08/14 02:45:10 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win874/Attic/utf8_and_win874.c,v 1.2 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* conv_proc(
* INTEGER, -- source encoding id
* INTEGER, -- destination encoding id
- * OPAQUE, -- source string (null terminated C string)
- * OPAQUE, -- destination string (null terminated C string)
+ * CSTRING, -- source string (null terminated C string)
+ * CSTRING, -- destination string (null terminated C string)
* INTEGER -- source string length
- * ) returns INTEGER; -- dummy. returns nothing, actually.
+ * ) returns VOID;
* ----------
*/
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.288 2002/08/20 17:54:44 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.289 2002/08/22 00:01:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
write_msg(NULL, "WARNING: owner of aggregate function \"%s\" appears to be invalid\n",
agginfo[i].aggname);
agginfo[i].aggacl = strdup(PQgetvalue(res, i, i_aggacl));
+ agginfo[i].anybasetype = false; /* computed when it's dumped */
agginfo[i].fmtbasetype = NULL; /* computed when it's dumped */
}
/* DROP must be fully qualified in case same name appears in pg_catalog */
appendPQExpBuffer(delq, "DROP TYPE %s.",
fmtId(tinfo->typnamespace->nspname));
- appendPQExpBuffer(delq, "%s;\n",
+ appendPQExpBuffer(delq, "%s CASCADE;\n",
fmtId(tinfo->typname));
appendPQExpBuffer(q,
format_aggregate_signature(AggInfo *agginfo, Archive *fout, bool honor_quotes)
{
PQExpBufferData buf;
- bool anybasetype;
initPQExpBuffer(&buf);
if (honor_quotes)
else
appendPQExpBuffer(&buf, "%s", agginfo->aggname);
- anybasetype = (strcmp(agginfo->aggbasetype, "0") == 0);
-
/* If using regtype or format_type, fmtbasetype is already quoted */
if (fout->remoteVersion >= 70100)
{
- if (anybasetype)
+ if (agginfo->anybasetype)
appendPQExpBuffer(&buf, "(*)");
else
appendPQExpBuffer(&buf, "(%s)", agginfo->fmtbasetype);
}
else
{
- if (anybasetype)
+ if (agginfo->anybasetype)
appendPQExpBuffer(&buf, "(*)");
else
appendPQExpBuffer(&buf, "(%s)",
int i_aggfinalfn;
int i_aggtranstype;
int i_agginitval;
+ int i_anybasetype;
int i_fmtbasetype;
int i_convertok;
const char *aggtransfn;
const char *aggtranstype;
const char *agginitval;
bool convertok;
- bool anybasetype;
/* Make sure we are in proper schema */
selectSourceSchema(agginfo->aggnamespace->nspname);
appendPQExpBuffer(query, "SELECT aggtransfn, "
"aggfinalfn, aggtranstype::pg_catalog.regtype, "
"agginitval, "
+ "proargtypes[0] = 'pg_catalog.\"any\"'::pg_catalog.regtype as anybasetype, "
"proargtypes[0]::pg_catalog.regtype as fmtbasetype, "
"'t'::boolean as convertok "
"from pg_catalog.pg_aggregate a, pg_catalog.pg_proc p "
appendPQExpBuffer(query, "SELECT aggtransfn, aggfinalfn, "
"format_type(aggtranstype, NULL) as aggtranstype, "
"agginitval, "
+ "aggbasetype = 0 as anybasetype, "
"CASE WHEN aggbasetype = 0 THEN '-' "
"ELSE format_type(aggbasetype, NULL) END as fmtbasetype, "
"'t'::boolean as convertok "
"aggfinalfn, "
"(select typname from pg_type where oid = aggtranstype1) as aggtranstype, "
"agginitval1 as agginitval, "
+ "aggbasetype = 0 as anybasetype, "
"(select typname from pg_type where oid = aggbasetype) as fmtbasetype, "
"(aggtransfn2 = 0 and aggtranstype2 = 0 and agginitval2 is null) as convertok "
"from pg_aggregate "
i_aggfinalfn = PQfnumber(res, "aggfinalfn");
i_aggtranstype = PQfnumber(res, "aggtranstype");
i_agginitval = PQfnumber(res, "agginitval");
+ i_anybasetype = PQfnumber(res, "anybasetype");
i_fmtbasetype = PQfnumber(res, "fmtbasetype");
i_convertok = PQfnumber(res, "convertok");
aggfinalfn = PQgetvalue(res, 0, i_aggfinalfn);
aggtranstype = PQgetvalue(res, 0, i_aggtranstype);
agginitval = PQgetvalue(res, 0, i_agginitval);
+ /* we save anybasetype so that dumpAggACL can use it later */
+ agginfo->anybasetype = (PQgetvalue(res, 0, i_anybasetype)[0] == 't');
/* we save fmtbasetype so that dumpAggACL can use it later */
agginfo->fmtbasetype = strdup(PQgetvalue(res, 0, i_fmtbasetype));
convertok = (PQgetvalue(res, 0, i_convertok)[0] == 't');
return;
}
- anybasetype = (strcmp(agginfo->aggbasetype, "0") == 0);
-
if (g_fout->remoteVersion >= 70300)
{
/* If using 7.3's regproc or regtype, data is already quoted */
appendPQExpBuffer(details, " BASETYPE = %s,\n SFUNC = %s,\n STYPE = %s",
- anybasetype ? "'any'" : agginfo->fmtbasetype,
+ agginfo->anybasetype ? "'any'" :
+ agginfo->fmtbasetype,
aggtransfn,
aggtranstype);
}
{
/* format_type quotes, regproc does not */
appendPQExpBuffer(details, " BASETYPE = %s,\n SFUNC = %s,\n STYPE = %s",
- anybasetype ? "'any'" : agginfo->fmtbasetype,
+ agginfo->anybasetype ? "'any'" :
+ agginfo->fmtbasetype,
fmtId(aggtransfn),
aggtranstype);
}
{
/* need quotes all around */
appendPQExpBuffer(details, " BASETYPE = %s,\n",
- anybasetype ? "'any'" :
+ agginfo->anybasetype ? "'any'" :
fmtId(agginfo->fmtbasetype));
appendPQExpBuffer(details, " SFUNC = %s,\n",
fmtId(aggtransfn));
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_dump.h,v 1.97 2002/08/19 19:33:35 tgl Exp $
+ * $Id: pg_dump.h,v 1.98 2002/08/22 00:01:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
NamespaceInfo *aggnamespace; /* link to containing namespace */
char *usename;
char *aggacl;
+ bool anybasetype; /* is the basetype "any"? */
char *fmtbasetype; /* formatted type name */
} AggInfo;
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.62 2002/08/16 23:01:19 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.63 2002/08/22 00:01:47 tgl Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
/*
* There are two kinds of aggregates: ones that work on particular
- * types and ones that work on all (denoted by input type = 0)
+ * types and ones that work on all (denoted by input type = "any")
*/
printfPQExpBuffer(&buf,
"SELECT n.nspname as \"%s\",\n"
" p.proname AS \"%s\",\n"
" CASE p.proargtypes[0]\n"
- " WHEN 0 THEN CAST('%s' AS pg_catalog.text)\n"
+ " WHEN 'pg_catalog.\"any\"'::pg_catalog.regtype\n"
+ " THEN CAST('%s' AS pg_catalog.text)\n"
" ELSE pg_catalog.format_type(p.proargtypes[0], NULL)\n"
" END AS \"%s\",\n"
" pg_catalog.obj_description(p.oid, 'pg_proc') as \"%s\"\n"
"\n LEFT JOIN pg_catalog.pg_user u ON u.usesysid = p.proowner\n");
/*
- * we skip in/out funcs by excluding functions that take some
- * arguments, but have no types defined for those arguments
+ * we skip in/out funcs by excluding functions that take or return cstring
*/
appendPQExpBuffer(&buf,
- "WHERE p.prorettype <> 0\n"
- " AND (p.pronargs = 0 OR pg_catalog.oidvectortypes(p.proargtypes) <> '')\n"
+ "WHERE p.prorettype <> 'pg_catalog.cstring'::pg_catalog.regtype\n"
+ " AND p.proargtypes[0] <> 'pg_catalog.cstring'::pg_catalog.regtype\n"
" AND NOT p.proisagg\n");
processNamePattern(&buf, pattern, true, false,
" CAST('%s' AS pg_catalog.text) as object\n"
" FROM pg_catalog.pg_proc p\n"
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n"
- " WHERE (p.pronargs = 0 or pg_catalog.oidvectortypes(p.proargtypes) <> '') AND NOT p.proisagg\n",
+
+ " WHERE p.prorettype <> 'pg_catalog.cstring'::pg_catalog.regtype\n"
+ " AND p.proargtypes[0] <> 'pg_catalog.cstring'::pg_catalog.regtype\n"
+ " AND NOT p.proisagg\n",
_("function"));
processNamePattern(&buf, pattern, true, false,
"n.nspname", "p.proname", NULL,
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.37 2002/08/10 16:57:32 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.38 2002/08/22 00:01:47 tgl Exp $
#
#-------------------------------------------------------------------------
# Create the call handler and the language
# ----------
if [ "$handlerexists" = no ]; then
- sqlcmd="CREATE FUNCTION \"$handler\" () RETURNS OPAQUE AS '$PGLIB/${object}' LANGUAGE C;"
+ sqlcmd="CREATE FUNCTION \"$handler\" () RETURNS LANGUAGE_HANDLER AS '$PGLIB/${object}' LANGUAGE C;"
if [ "$showsql" = yes ]; then
echo "$sqlcmd"
fi
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: printtup.h,v 1.20 2002/06/20 20:29:43 momjian Exp $
+ * $Id: printtup.h,v 1.21 2002/08/22 00:01:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern void spi_printtup(HeapTuple tuple, TupleDesc tupdesc,
DestReceiver *self);
-extern bool getTypeOutputInfo(Oid type, Oid *typOutput, Oid *typElem,
- bool *typIsVarlena);
-
#endif /* PRINTTUP_H */
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: catversion.h,v 1.150 2002/08/17 13:04:15 momjian Exp $
+ * $Id: catversion.h,v 1.151 2002/08/22 00:01:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200208171
+#define CATALOG_VERSION_NO 200208201
#endif
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_proc.h,v 1.259 2002/08/20 19:23:07 tgl Exp $
+ * $Id: pg_proc.h,v 1.260 2002/08/22 00:01:47 tgl Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
/* OIDS 1 - 99 */
-DATA(insert OID = 1242 ( boolin PGNSP PGUID 12 f f t f i 1 16 "0" boolin - _null_ ));
+DATA(insert OID = 1242 ( boolin PGNSP PGUID 12 f f t f i 1 16 "2275" boolin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1243 ( boolout PGNSP PGUID 12 f f t f i 1 23 "0" boolout - _null_ ));
+DATA(insert OID = 1243 ( boolout PGNSP PGUID 12 f f t f i 1 2275 "16" boolout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1244 ( byteain PGNSP PGUID 12 f f t f i 1 17 "0" byteain - _null_ ));
+DATA(insert OID = 1244 ( byteain PGNSP PGUID 12 f f t f i 1 17 "2275" byteain - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 31 ( byteaout PGNSP PGUID 12 f f t f i 1 23 "0" byteaout - _null_ ));
+DATA(insert OID = 31 ( byteaout PGNSP PGUID 12 f f t f i 1 2275 "17" byteaout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1245 ( charin PGNSP PGUID 12 f f t f i 1 18 "0" charin - _null_ ));
+DATA(insert OID = 1245 ( charin PGNSP PGUID 12 f f t f i 1 18 "2275" charin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 33 ( charout PGNSP PGUID 12 f f t f i 1 23 "0" charout - _null_ ));
+DATA(insert OID = 33 ( charout PGNSP PGUID 12 f f t f i 1 2275 "18" charout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 34 ( namein PGNSP PGUID 12 f f t f i 1 19 "0" namein - _null_ ));
+DATA(insert OID = 34 ( namein PGNSP PGUID 12 f f t f i 1 19 "2275" namein - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 35 ( nameout PGNSP PGUID 12 f f t f i 1 23 "0" nameout - _null_ ));
+DATA(insert OID = 35 ( nameout PGNSP PGUID 12 f f t f i 1 2275 "19" nameout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 38 ( int2in PGNSP PGUID 12 f f t f i 1 21 "0" int2in - _null_ ));
+DATA(insert OID = 38 ( int2in PGNSP PGUID 12 f f t f i 1 21 "2275" int2in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 39 ( int2out PGNSP PGUID 12 f f t f i 1 23 "0" int2out - _null_ ));
+DATA(insert OID = 39 ( int2out PGNSP PGUID 12 f f t f i 1 2275 "21" int2out - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 40 ( int2vectorin PGNSP PGUID 12 f f t f i 1 22 "0" int2vectorin - _null_ ));
+DATA(insert OID = 40 ( int2vectorin PGNSP PGUID 12 f f t f i 1 22 "2275" int2vectorin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 41 ( int2vectorout PGNSP PGUID 12 f f t f i 1 23 "0" int2vectorout - _null_ ));
+DATA(insert OID = 41 ( int2vectorout PGNSP PGUID 12 f f t f i 1 2275 "22" int2vectorout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 42 ( int4in PGNSP PGUID 12 f f t f i 1 23 "0" int4in - _null_ ));
+DATA(insert OID = 42 ( int4in PGNSP PGUID 12 f f t f i 1 23 "2275" int4in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 43 ( int4out PGNSP PGUID 12 f f t f i 1 23 "0" int4out - _null_ ));
+DATA(insert OID = 43 ( int4out PGNSP PGUID 12 f f t f i 1 2275 "23" int4out - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 44 ( regprocin PGNSP PGUID 12 f f t f s 1 24 "0" regprocin - _null_ ));
+DATA(insert OID = 44 ( regprocin PGNSP PGUID 12 f f t f s 1 24 "2275" regprocin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 45 ( regprocout PGNSP PGUID 12 f f t f s 1 23 "0" regprocout - _null_ ));
+DATA(insert OID = 45 ( regprocout PGNSP PGUID 12 f f t f s 1 2275 "24" regprocout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 46 ( textin PGNSP PGUID 12 f f t f i 1 25 "0" textin - _null_ ));
+DATA(insert OID = 46 ( textin PGNSP PGUID 12 f f t f i 1 25 "2275" textin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 47 ( textout PGNSP PGUID 12 f f t f i 1 23 "0" textout - _null_ ));
+DATA(insert OID = 47 ( textout PGNSP PGUID 12 f f t f i 1 2275 "25" textout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 48 ( tidin PGNSP PGUID 12 f f t f i 1 27 "0" tidin - _null_ ));
+DATA(insert OID = 48 ( tidin PGNSP PGUID 12 f f t f i 1 27 "2275" tidin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 49 ( tidout PGNSP PGUID 12 f f t f i 1 23 "0" tidout - _null_ ));
+DATA(insert OID = 49 ( tidout PGNSP PGUID 12 f f t f i 1 2275 "27" tidout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 50 ( xidin PGNSP PGUID 12 f f t f i 1 28 "0" xidin - _null_ ));
+DATA(insert OID = 50 ( xidin PGNSP PGUID 12 f f t f i 1 28 "2275" xidin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 51 ( xidout PGNSP PGUID 12 f f t f i 1 23 "0" xidout - _null_ ));
+DATA(insert OID = 51 ( xidout PGNSP PGUID 12 f f t f i 1 2275 "28" xidout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 52 ( cidin PGNSP PGUID 12 f f t f i 1 29 "0" cidin - _null_ ));
+DATA(insert OID = 52 ( cidin PGNSP PGUID 12 f f t f i 1 29 "2275" cidin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 53 ( cidout PGNSP PGUID 12 f f t f i 1 23 "0" cidout - _null_ ));
+DATA(insert OID = 53 ( cidout PGNSP PGUID 12 f f t f i 1 2275 "29" cidout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 54 ( oidvectorin PGNSP PGUID 12 f f t f i 1 30 "0" oidvectorin - _null_ ));
+DATA(insert OID = 54 ( oidvectorin PGNSP PGUID 12 f f t f i 1 30 "2275" oidvectorin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 55 ( oidvectorout PGNSP PGUID 12 f f t f i 1 23 "0" oidvectorout - _null_ ));
+DATA(insert OID = 55 ( oidvectorout PGNSP PGUID 12 f f t f i 1 2275 "30" oidvectorout - _null_ ));
DESCR("(internal)");
DATA(insert OID = 56 ( boollt PGNSP PGUID 12 f f t f i 2 16 "16 16" boollt - _null_ ));
DESCR("less-than");
DATA(insert OID = 100 ( int8fac PGNSP PGUID 12 f f t f i 1 20 "20" int8fac - _null_ ));
DESCR("factorial");
-DATA(insert OID = 101 ( eqsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" eqsel - _null_ ));
+DATA(insert OID = 101 ( eqsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" eqsel - _null_ ));
DESCR("restriction selectivity of = and related operators");
-DATA(insert OID = 102 ( neqsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" neqsel - _null_ ));
+DATA(insert OID = 102 ( neqsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" neqsel - _null_ ));
DESCR("restriction selectivity of <> and related operators");
-DATA(insert OID = 103 ( scalarltsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" scalarltsel - _null_ ));
+DATA(insert OID = 103 ( scalarltsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" scalarltsel - _null_ ));
DESCR("restriction selectivity of < and related operators on scalar datatypes");
-DATA(insert OID = 104 ( scalargtsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" scalargtsel - _null_ ));
+DATA(insert OID = 104 ( scalargtsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" scalargtsel - _null_ ));
DESCR("restriction selectivity of > and related operators on scalar datatypes");
-DATA(insert OID = 105 ( eqjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" eqjoinsel - _null_ ));
+DATA(insert OID = 105 ( eqjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" eqjoinsel - _null_ ));
DESCR("join selectivity of = and related operators");
-DATA(insert OID = 106 ( neqjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" neqjoinsel - _null_ ));
+DATA(insert OID = 106 ( neqjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" neqjoinsel - _null_ ));
DESCR("join selectivity of <> and related operators");
-DATA(insert OID = 107 ( scalarltjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" scalarltjoinsel - _null_ ));
+DATA(insert OID = 107 ( scalarltjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" scalarltjoinsel - _null_ ));
DESCR("join selectivity of < and related operators on scalar datatypes");
-DATA(insert OID = 108 ( scalargtjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" scalargtjoinsel - _null_ ));
+DATA(insert OID = 108 ( scalargtjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" scalargtjoinsel - _null_ ));
DESCR("join selectivity of > and related operators on scalar datatypes");
-DATA(insert OID = 109 ( unknownin PGNSP PGUID 12 f f t f i 1 705 "0" unknownin - _null_ ));
+DATA(insert OID = 109 ( unknownin PGNSP PGUID 12 f f t f i 1 705 "2275" unknownin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 110 ( unknownout PGNSP PGUID 12 f f t f i 1 23 "0" unknownout - _null_ ));
+DATA(insert OID = 110 ( unknownout PGNSP PGUID 12 f f t f i 1 2275 "705" unknownout - _null_ ));
DESCR("(internal)");
DATA(insert OID = 112 ( text PGNSP PGUID 12 f f t f i 1 25 "23" int4_text - _null_ ));
DATA(insert OID = 116 ( box_below PGNSP PGUID 12 f f t f i 2 16 "603 603" box_below - _null_ ));
DESCR("is below");
-DATA(insert OID = 117 ( point_in PGNSP PGUID 12 f f t f i 1 600 "0" point_in - _null_ ));
+DATA(insert OID = 117 ( point_in PGNSP PGUID 12 f f t f i 1 600 "2275" point_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 118 ( point_out PGNSP PGUID 12 f f t f i 1 23 "600" point_out - _null_ ));
+DATA(insert OID = 118 ( point_out PGNSP PGUID 12 f f t f i 1 2275 "600" point_out - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 119 ( lseg_in PGNSP PGUID 12 f f t f i 1 601 "0" lseg_in - _null_ ));
+DATA(insert OID = 119 ( lseg_in PGNSP PGUID 12 f f t f i 1 601 "2275" lseg_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 120 ( lseg_out PGNSP PGUID 12 f f t f i 1 23 "0" lseg_out - _null_ ));
+DATA(insert OID = 120 ( lseg_out PGNSP PGUID 12 f f t f i 1 2275 "601" lseg_out - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 121 ( path_in PGNSP PGUID 12 f f t f i 1 602 "0" path_in - _null_ ));
+DATA(insert OID = 121 ( path_in PGNSP PGUID 12 f f t f i 1 602 "2275" path_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 122 ( path_out PGNSP PGUID 12 f f t f i 1 23 "0" path_out - _null_ ));
+DATA(insert OID = 122 ( path_out PGNSP PGUID 12 f f t f i 1 2275 "602" path_out - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 123 ( box_in PGNSP PGUID 12 f f t f i 1 603 "0" box_in - _null_ ));
+DATA(insert OID = 123 ( box_in PGNSP PGUID 12 f f t f i 1 603 "2275" box_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 124 ( box_out PGNSP PGUID 12 f f t f i 1 23 "0" box_out - _null_ ));
+DATA(insert OID = 124 ( box_out PGNSP PGUID 12 f f t f i 1 2275 "603" box_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 125 ( box_overlap PGNSP PGUID 12 f f t f i 2 16 "603 603" box_overlap - _null_ ));
DESCR("overlaps");
DESCR("contained in");
DATA(insert OID = 138 ( box_center PGNSP PGUID 12 f f t f i 1 600 "603" box_center - _null_ ));
DESCR("center of");
-DATA(insert OID = 139 ( areasel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" areasel - _null_ ));
+DATA(insert OID = 139 ( areasel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" areasel - _null_ ));
DESCR("restriction selectivity for area-comparison operators");
-DATA(insert OID = 140 ( areajoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" areajoinsel - _null_ ));
+DATA(insert OID = 140 ( areajoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" areajoinsel - _null_ ));
DESCR("join selectivity for area-comparison operators");
DATA(insert OID = 141 ( int4mul PGNSP PGUID 12 f f t f i 2 23 "23 23" int4mul - _null_ ));
DESCR("multiply");
/* OIDS 200 - 299 */
-DATA(insert OID = 200 ( float4in PGNSP PGUID 12 f f t f i 1 700 "0" float4in - _null_ ));
+DATA(insert OID = 200 ( float4in PGNSP PGUID 12 f f t f i 1 700 "2275" float4in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 201 ( float4out PGNSP PGUID 12 f f t f i 1 23 "700" float4out - _null_ ));
+DATA(insert OID = 201 ( float4out PGNSP PGUID 12 f f t f i 1 2275 "700" float4out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 202 ( float4mul PGNSP PGUID 12 f f t f i 2 700 "700 700" float4mul - _null_ ));
DESCR("multiply");
DATA(insert OID = 213 ( int2um PGNSP PGUID 12 f f t f i 1 21 "21" int2um - _null_ ));
DESCR("negate");
-DATA(insert OID = 214 ( float8in PGNSP PGUID 12 f f t f i 1 701 "0" float8in - _null_ ));
+DATA(insert OID = 214 ( float8in PGNSP PGUID 12 f f t f i 1 701 "2275" float8in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 215 ( float8out PGNSP PGUID 12 f f t f i 1 23 "701" float8out - _null_ ));
+DATA(insert OID = 215 ( float8out PGNSP PGUID 12 f f t f i 1 2275 "701" float8out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 216 ( float8mul PGNSP PGUID 12 f f t f i 2 701 "701 701" float8mul - _null_ ));
DESCR("multiply");
DATA(insert OID = 239 ( line_distance PGNSP PGUID 12 f f t f i 2 701 "628 628" line_distance - _null_ ));
DESCR("distance between");
-DATA(insert OID = 240 ( nabstimein PGNSP PGUID 12 f f t f s 1 702 "0" nabstimein - _null_ ));
+DATA(insert OID = 240 ( nabstimein PGNSP PGUID 12 f f t f s 1 702 "2275" nabstimein - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 241 ( nabstimeout PGNSP PGUID 12 f f t f s 1 23 "0" nabstimeout - _null_ ));
+DATA(insert OID = 241 ( nabstimeout PGNSP PGUID 12 f f t f s 1 2275 "702" nabstimeout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 242 ( reltimein PGNSP PGUID 12 f f t f s 1 703 "0" reltimein - _null_ ));
+DATA(insert OID = 242 ( reltimein PGNSP PGUID 12 f f t f s 1 703 "2275" reltimein - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 243 ( reltimeout PGNSP PGUID 12 f f t f s 1 23 "0" reltimeout - _null_ ));
+DATA(insert OID = 243 ( reltimeout PGNSP PGUID 12 f f t f s 1 2275 "703" reltimeout - _null_ ));
DESCR("(internal)");
DATA(insert OID = 244 ( timepl PGNSP PGUID 12 f f t f i 2 702 "702 703" timepl - _null_ ));
DESCR("add");
DATA(insert OID = 245 ( timemi PGNSP PGUID 12 f f t f i 2 702 "702 703" timemi - _null_ ));
DESCR("subtract");
-DATA(insert OID = 246 ( tintervalin PGNSP PGUID 12 f f t f s 1 704 "0" tintervalin - _null_ ));
+DATA(insert OID = 246 ( tintervalin PGNSP PGUID 12 f f t f s 1 704 "2275" tintervalin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 247 ( tintervalout PGNSP PGUID 12 f f t f s 1 23 "0" tintervalout - _null_ ));
+DATA(insert OID = 247 ( tintervalout PGNSP PGUID 12 f f t f s 1 2275 "704" tintervalout - _null_ ));
DESCR("(internal)");
DATA(insert OID = 248 ( intinterval PGNSP PGUID 12 f f t f i 2 16 "702 704" intinterval - _null_ ));
DESCR("abstime in tinterval");
DATA(insert OID = 249 ( tintervalrel PGNSP PGUID 12 f f t f i 1 703 "704" tintervalrel - _null_ ));
DESCR("");
-DATA(insert OID = 250 ( timenow PGNSP PGUID 12 f f t f s 0 702 "0" timenow - _null_ ));
+DATA(insert OID = 250 ( timenow PGNSP PGUID 12 f f t f s 0 702 "" timenow - _null_ ));
DESCR("Current date and time (abstime)");
DATA(insert OID = 251 ( abstimeeq PGNSP PGUID 12 f f t f i 2 16 "702 702" abstimeeq - _null_ ));
DESCR("equal");
DESCR("start of interval");
DATA(insert OID = 273 ( tintervalend PGNSP PGUID 12 f f t f i 1 702 "704" tintervalend - _null_ ));
DESCR("");
-DATA(insert OID = 274 ( timeofday PGNSP PGUID 12 f f t f v 0 25 "0" timeofday - _null_ ));
+DATA(insert OID = 274 ( timeofday PGNSP PGUID 12 f f t f v 0 25 "" timeofday - _null_ ));
DESCR("Current date and time - increments during transactions");
DATA(insert OID = 275 ( isfinite PGNSP PGUID 12 f f t f i 1 16 "702" abstime_finite - _null_ ));
DESCR("");
DATA(insert OID = 319 ( int4 PGNSP PGUID 12 f f t f i 1 23 "700" ftoi4 - _null_ ));
DESCR("convert float4 to int4");
-DATA(insert OID = 320 ( rtinsert PGNSP PGUID 12 f f t f v 6 23 "0 0 0 0 0 0" rtinsert - _null_ ));
+DATA(insert OID = 320 ( rtinsert PGNSP PGUID 12 f f t f v 6 23 "2281 2281 2281 2281 2281 2281" rtinsert - _null_ ));
DESCR("r-tree(internal)");
-DATA(insert OID = 322 ( rtgettuple PGNSP PGUID 12 f f t f v 2 23 "0 0" rtgettuple - _null_ ));
+DATA(insert OID = 322 ( rtgettuple PGNSP PGUID 12 f f t f v 2 23 "2281 2281" rtgettuple - _null_ ));
DESCR("r-tree(internal)");
-DATA(insert OID = 323 ( rtbuild PGNSP PGUID 12 f f t f v 3 23 "0 0 0" rtbuild - _null_ ));
+DATA(insert OID = 323 ( rtbuild PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" rtbuild - _null_ ));
DESCR("r-tree(internal)");
-DATA(insert OID = 324 ( rtbeginscan PGNSP PGUID 12 f f t f v 3 23 "0 0 0" rtbeginscan - _null_ ));
+DATA(insert OID = 324 ( rtbeginscan PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" rtbeginscan - _null_ ));
DESCR("r-tree(internal)");
-DATA(insert OID = 325 ( rtendscan PGNSP PGUID 12 f f t f v 1 23 "0" rtendscan - _null_ ));
+DATA(insert OID = 325 ( rtendscan PGNSP PGUID 12 f f t f v 1 23 "2281" rtendscan - _null_ ));
DESCR("r-tree(internal)");
-DATA(insert OID = 326 ( rtmarkpos PGNSP PGUID 12 f f t f v 1 23 "0" rtmarkpos - _null_ ));
+DATA(insert OID = 326 ( rtmarkpos PGNSP PGUID 12 f f t f v 1 23 "2281" rtmarkpos - _null_ ));
DESCR("r-tree(internal)");
-DATA(insert OID = 327 ( rtrestrpos PGNSP PGUID 12 f f t f v 1 23 "0" rtrestrpos - _null_ ));
+DATA(insert OID = 327 ( rtrestrpos PGNSP PGUID 12 f f t f v 1 23 "2281" rtrestrpos - _null_ ));
DESCR("r-tree(internal)");
-DATA(insert OID = 328 ( rtrescan PGNSP PGUID 12 f f t f v 2 23 "0 0" rtrescan - _null_ ));
+DATA(insert OID = 328 ( rtrescan PGNSP PGUID 12 f f t f v 2 23 "2281 2281" rtrescan - _null_ ));
DESCR("r-tree(internal)");
-DATA(insert OID = 321 ( rtbulkdelete PGNSP PGUID 12 f f t f v 3 23 "0 0 0" rtbulkdelete - _null_ ));
+DATA(insert OID = 321 ( rtbulkdelete PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" rtbulkdelete - _null_ ));
DESCR("r-tree(internal)");
-DATA(insert OID = 1265 ( rtcostestimate PGNSP PGUID 12 f f t f v 8 0 "0 0 0 0 0 0 0 0" rtcostestimate - _null_ ));
+DATA(insert OID = 1265 ( rtcostestimate PGNSP PGUID 12 f f t f v 8 2278 "2281 2281 2281 2281 2281 2281 2281 2281" rtcostestimate - _null_ ));
DESCR("r-tree(internal)");
-DATA(insert OID = 330 ( btgettuple PGNSP PGUID 12 f f t f v 2 23 "0 0" btgettuple - _null_ ));
+DATA(insert OID = 330 ( btgettuple PGNSP PGUID 12 f f t f v 2 23 "2281 2281" btgettuple - _null_ ));
DESCR("btree(internal)");
-DATA(insert OID = 331 ( btinsert PGNSP PGUID 12 f f t f v 6 23 "0 0 0 0 0 0" btinsert - _null_ ));
+DATA(insert OID = 331 ( btinsert PGNSP PGUID 12 f f t f v 6 23 "2281 2281 2281 2281 2281 2281" btinsert - _null_ ));
DESCR("btree(internal)");
-DATA(insert OID = 333 ( btbeginscan PGNSP PGUID 12 f f t f v 3 23 "0 0 0" btbeginscan - _null_ ));
+DATA(insert OID = 333 ( btbeginscan PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" btbeginscan - _null_ ));
DESCR("btree(internal)");
-DATA(insert OID = 334 ( btrescan PGNSP PGUID 12 f f t f v 2 23 "0 0" btrescan - _null_ ));
+DATA(insert OID = 334 ( btrescan PGNSP PGUID 12 f f t f v 2 23 "2281 2281" btrescan - _null_ ));
DESCR("btree(internal)");
-DATA(insert OID = 335 ( btendscan PGNSP PGUID 12 f f t f v 1 23 "0" btendscan - _null_ ));
+DATA(insert OID = 335 ( btendscan PGNSP PGUID 12 f f t f v 1 23 "2281" btendscan - _null_ ));
DESCR("btree(internal)");
-DATA(insert OID = 336 ( btmarkpos PGNSP PGUID 12 f f t f v 1 23 "0" btmarkpos - _null_ ));
+DATA(insert OID = 336 ( btmarkpos PGNSP PGUID 12 f f t f v 1 23 "2281" btmarkpos - _null_ ));
DESCR("btree(internal)");
-DATA(insert OID = 337 ( btrestrpos PGNSP PGUID 12 f f t f v 1 23 "0" btrestrpos - _null_ ));
+DATA(insert OID = 337 ( btrestrpos PGNSP PGUID 12 f f t f v 1 23 "2281" btrestrpos - _null_ ));
DESCR("btree(internal)");
-DATA(insert OID = 338 ( btbuild PGNSP PGUID 12 f f t f v 3 23 "0 0 0" btbuild - _null_ ));
+DATA(insert OID = 338 ( btbuild PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" btbuild - _null_ ));
DESCR("btree(internal)");
-DATA(insert OID = 332 ( btbulkdelete PGNSP PGUID 12 f f t f v 3 23 "0 0 0" btbulkdelete - _null_ ));
+DATA(insert OID = 332 ( btbulkdelete PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" btbulkdelete - _null_ ));
DESCR("btree(internal)");
-DATA(insert OID = 1268 ( btcostestimate PGNSP PGUID 12 f f t f v 8 0 "0 0 0 0 0 0 0 0" btcostestimate - _null_ ));
+DATA(insert OID = 1268 ( btcostestimate PGNSP PGUID 12 f f t f v 8 2278 "2281 2281 2281 2281 2281 2281 2281 2281" btcostestimate - _null_ ));
DESCR("btree(internal)");
DATA(insert OID = 339 ( poly_same PGNSP PGUID 12 f f t f i 2 16 "604 604" poly_same - _null_ ));
DESCR("contained in");
DATA(insert OID = 346 ( poly_overlap PGNSP PGUID 12 f f t f i 2 16 "604 604" poly_overlap - _null_ ));
DESCR("overlaps");
-DATA(insert OID = 347 ( poly_in PGNSP PGUID 12 f f t f i 1 604 "0" poly_in - _null_ ));
+DATA(insert OID = 347 ( poly_in PGNSP PGUID 12 f f t f i 1 604 "2275" poly_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 348 ( poly_out PGNSP PGUID 12 f f t f i 1 23 "0" poly_out - _null_ ));
+DATA(insert OID = 348 ( poly_out PGNSP PGUID 12 f f t f i 1 2275 "604" poly_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 350 ( btint2cmp PGNSP PGUID 12 f f t f i 2 23 "21 21" btint2cmp - _null_ ));
DATA(insert OID = 409 ( name PGNSP PGUID 12 f f t f i 1 19 "1042" bpchar_name - _null_ ));
DESCR("convert char() to name");
-DATA(insert OID = 440 ( hashgettuple PGNSP PGUID 12 f f t f v 2 23 "0 0" hashgettuple - _null_ ));
+DATA(insert OID = 440 ( hashgettuple PGNSP PGUID 12 f f t f v 2 23 "2281 2281" hashgettuple - _null_ ));
DESCR("hash(internal)");
-DATA(insert OID = 441 ( hashinsert PGNSP PGUID 12 f f t f v 6 23 "0 0 0 0 0 0" hashinsert - _null_ ));
+DATA(insert OID = 441 ( hashinsert PGNSP PGUID 12 f f t f v 6 23 "2281 2281 2281 2281 2281 2281" hashinsert - _null_ ));
DESCR("hash(internal)");
-DATA(insert OID = 443 ( hashbeginscan PGNSP PGUID 12 f f t f v 3 23 "0 0 0" hashbeginscan - _null_ ));
+DATA(insert OID = 443 ( hashbeginscan PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" hashbeginscan - _null_ ));
DESCR("hash(internal)");
-DATA(insert OID = 444 ( hashrescan PGNSP PGUID 12 f f t f v 2 23 "0 0" hashrescan - _null_ ));
+DATA(insert OID = 444 ( hashrescan PGNSP PGUID 12 f f t f v 2 23 "2281 2281" hashrescan - _null_ ));
DESCR("hash(internal)");
-DATA(insert OID = 445 ( hashendscan PGNSP PGUID 12 f f t f v 1 23 "0" hashendscan - _null_ ));
+DATA(insert OID = 445 ( hashendscan PGNSP PGUID 12 f f t f v 1 23 "2281" hashendscan - _null_ ));
DESCR("hash(internal)");
-DATA(insert OID = 446 ( hashmarkpos PGNSP PGUID 12 f f t f v 1 23 "0" hashmarkpos - _null_ ));
+DATA(insert OID = 446 ( hashmarkpos PGNSP PGUID 12 f f t f v 1 23 "2281" hashmarkpos - _null_ ));
DESCR("hash(internal)");
-DATA(insert OID = 447 ( hashrestrpos PGNSP PGUID 12 f f t f v 1 23 "0" hashrestrpos - _null_ ));
+DATA(insert OID = 447 ( hashrestrpos PGNSP PGUID 12 f f t f v 1 23 "2281" hashrestrpos - _null_ ));
DESCR("hash(internal)");
-DATA(insert OID = 448 ( hashbuild PGNSP PGUID 12 f f t f v 3 23 "0 0 0" hashbuild - _null_ ));
+DATA(insert OID = 448 ( hashbuild PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" hashbuild - _null_ ));
DESCR("hash(internal)");
-DATA(insert OID = 442 ( hashbulkdelete PGNSP PGUID 12 f f t f v 3 23 "0 0 0" hashbulkdelete - _null_ ));
+DATA(insert OID = 442 ( hashbulkdelete PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" hashbulkdelete - _null_ ));
DESCR("hash(internal)");
-DATA(insert OID = 438 ( hashcostestimate PGNSP PGUID 12 f f t f v 8 0 "0 0 0 0 0 0 0 0" hashcostestimate - _null_ ));
+DATA(insert OID = 438 ( hashcostestimate PGNSP PGUID 12 f f t f v 8 2278 "2281 2281 2281 2281 2281 2281 2281 2281" hashcostestimate - _null_ ));
DESCR("hash(internal)");
DATA(insert OID = 449 ( hashint2 PGNSP PGUID 12 f f t f i 1 23 "21" hashint2 - _null_ ));
DESCR("hash");
DATA(insert OID = 455 ( hashname PGNSP PGUID 12 f f t f i 1 23 "19" hashname - _null_ ));
DESCR("hash");
-DATA(insert OID = 456 ( hashvarlena PGNSP PGUID 12 f f t f i 1 23 "0" hashvarlena - _null_ ));
+DATA(insert OID = 456 ( hashvarlena PGNSP PGUID 12 f f t f i 1 23 "2281" hashvarlena - _null_ ));
DESCR("hash any varlena type");
DATA(insert OID = 457 ( hashoidvector PGNSP PGUID 12 f f t f i 1 23 "30" hashoidvector - _null_ ));
DESCR("hash");
DATA(insert OID = 459 ( text_smaller PGNSP PGUID 12 f f t f i 2 25 "25 25" text_smaller - _null_ ));
DESCR("smaller of two");
-DATA(insert OID = 460 ( int8in PGNSP PGUID 12 f f t f i 1 20 "0" int8in - _null_ ));
+DATA(insert OID = 460 ( int8in PGNSP PGUID 12 f f t f i 1 20 "2275" int8in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 461 ( int8out PGNSP PGUID 12 f f t f i 1 23 "0" int8out - _null_ ));
+DATA(insert OID = 461 ( int8out PGNSP PGUID 12 f f t f i 1 2275 "20" int8out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 462 ( int8um PGNSP PGUID 12 f f t f i 1 20 "20" int8um - _null_ ));
DESCR("negate");
DESCR("not in");
DATA(insert OID = 1286 ( oidnotin PGNSP PGUID 12 f f t f s 2 16 "26 25" oidnotin - _null_ ));
DESCR("not in");
-DATA(insert OID = 1287 ( int44in PGNSP PGUID 12 f f t f i 1 22 "0" int44in - _null_ ));
-DESCR("(internal)");
-DATA(insert OID = 653 ( int44out PGNSP PGUID 12 f f t f i 1 23 "0" int44out - _null_ ));
-DESCR("(internal)");
DATA(insert OID = 655 ( namelt PGNSP PGUID 12 f f t f i 2 16 "19 19" namelt - _null_ ));
DESCR("less-than");
DATA(insert OID = 656 ( namele PGNSP PGUID 12 f f t f i 2 16 "19 19" namele - _null_ ));
DESCR("greater-than");
/* OIDS 700 - 799 */
-DATA(insert OID = 710 ( getpgusername PGNSP PGUID 12 f f t f s 0 19 "0" current_user - _null_ ));
+DATA(insert OID = 710 ( getpgusername PGNSP PGUID 12 f f t f s 0 19 "" current_user - _null_ ));
DESCR("deprecated -- use current_user");
DATA(insert OID = 711 ( userfntest PGNSP PGUID 12 f f t f i 1 23 "23" userfntest - _null_ ));
DESCR("");
DATA(insert OID = 743 ( text_ge PGNSP PGUID 12 f f t f i 2 16 "25 25" text_ge - _null_ ));
DESCR("greater-than-or-equal");
-DATA(insert OID = 744 ( array_eq PGNSP PGUID 12 f f t f i 2 16 "0 0" array_eq - _null_ ));
+DATA(insert OID = 744 ( array_eq PGNSP PGUID 12 f f t f i 2 16 "2277 2277" array_eq - _null_ ));
DESCR("array equal");
-DATA(insert OID = 745 ( current_user PGNSP PGUID 12 f f t f s 0 19 "0" current_user - _null_ ));
+DATA(insert OID = 745 ( current_user PGNSP PGUID 12 f f t f s 0 19 "" current_user - _null_ ));
DESCR("current user name");
-DATA(insert OID = 746 ( session_user PGNSP PGUID 12 f f t f s 0 19 "0" session_user - _null_ ));
+DATA(insert OID = 746 ( session_user PGNSP PGUID 12 f f t f s 0 19 "" session_user - _null_ ));
DESCR("session user name");
-DATA(insert OID = 747 ( array_dims PGNSP PGUID 12 f f t f i 1 25 "0" array_dims - _null_ ));
+DATA(insert OID = 747 ( array_dims PGNSP PGUID 12 f f t f i 1 25 "2277" array_dims - _null_ ));
DESCR("array dimensions");
-DATA(insert OID = 750 ( array_in PGNSP PGUID 12 f f t f i 3 23 "0 26 23" array_in - _null_ ));
+DATA(insert OID = 750 ( array_in PGNSP PGUID 12 f f t f i 3 2277 "2275 26 23" array_in - _null_ ));
DESCR("array");
-DATA(insert OID = 751 ( array_out PGNSP PGUID 12 f f t f i 2 23 "0 26" array_out - _null_ ));
+DATA(insert OID = 751 ( array_out PGNSP PGUID 12 f f t f i 2 2275 "2281 26" array_out - _null_ ));
DESCR("array");
-DATA(insert OID = 760 ( smgrin PGNSP PGUID 12 f f t f s 1 210 "0" smgrin - _null_ ));
+DATA(insert OID = 760 ( smgrin PGNSP PGUID 12 f f t f s 1 210 "2275" smgrin - _null_ ));
DESCR("storage manager(internal)");
-DATA(insert OID = 761 ( smgrout PGNSP PGUID 12 f f t f s 1 23 "0" smgrout - _null_ ));
+DATA(insert OID = 761 ( smgrout PGNSP PGUID 12 f f t f s 1 2275 "210" smgrout - _null_ ));
DESCR("storage manager(internal)");
DATA(insert OID = 762 ( smgreq PGNSP PGUID 12 f f t f i 2 16 "210 210" smgreq - _null_ ));
DESCR("storage manager");
DATA(insert OID = 771 ( int2smaller PGNSP PGUID 12 f f t f i 2 21 "21 21" int2smaller - _null_ ));
DESCR("smaller of two");
-DATA(insert OID = 774 ( gistgettuple PGNSP PGUID 12 f f t f v 2 23 "0 0" gistgettuple - _null_ ));
+DATA(insert OID = 774 ( gistgettuple PGNSP PGUID 12 f f t f v 2 23 "2281 2281" gistgettuple - _null_ ));
DESCR("gist(internal)");
-DATA(insert OID = 775 ( gistinsert PGNSP PGUID 12 f f t f v 6 23 "0 0 0 0 0 0" gistinsert - _null_ ));
+DATA(insert OID = 775 ( gistinsert PGNSP PGUID 12 f f t f v 6 23 "2281 2281 2281 2281 2281 2281" gistinsert - _null_ ));
DESCR("gist(internal)");
-DATA(insert OID = 777 ( gistbeginscan PGNSP PGUID 12 f f t f v 3 23 "0 0 0" gistbeginscan - _null_ ));
+DATA(insert OID = 777 ( gistbeginscan PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" gistbeginscan - _null_ ));
DESCR("gist(internal)");
-DATA(insert OID = 778 ( gistrescan PGNSP PGUID 12 f f t f v 2 23 "0 0" gistrescan - _null_ ));
+DATA(insert OID = 778 ( gistrescan PGNSP PGUID 12 f f t f v 2 23 "2281 2281" gistrescan - _null_ ));
DESCR("gist(internal)");
-DATA(insert OID = 779 ( gistendscan PGNSP PGUID 12 f f t f v 1 23 "0" gistendscan - _null_ ));
+DATA(insert OID = 779 ( gistendscan PGNSP PGUID 12 f f t f v 1 23 "2281" gistendscan - _null_ ));
DESCR("gist(internal)");
-DATA(insert OID = 780 ( gistmarkpos PGNSP PGUID 12 f f t f v 1 23 "0" gistmarkpos - _null_ ));
+DATA(insert OID = 780 ( gistmarkpos PGNSP PGUID 12 f f t f v 1 23 "2281" gistmarkpos - _null_ ));
DESCR("gist(internal)");
-DATA(insert OID = 781 ( gistrestrpos PGNSP PGUID 12 f f t f v 1 23 "0" gistrestrpos - _null_ ));
+DATA(insert OID = 781 ( gistrestrpos PGNSP PGUID 12 f f t f v 1 23 "2281" gistrestrpos - _null_ ));
DESCR("gist(internal)");
-DATA(insert OID = 782 ( gistbuild PGNSP PGUID 12 f f t f v 3 23 "0 0 0" gistbuild - _null_ ));
+DATA(insert OID = 782 ( gistbuild PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" gistbuild - _null_ ));
DESCR("gist(internal)");
-DATA(insert OID = 776 ( gistbulkdelete PGNSP PGUID 12 f f t f v 3 23 "0 0 0" gistbulkdelete - _null_ ));
+DATA(insert OID = 776 ( gistbulkdelete PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" gistbulkdelete - _null_ ));
DESCR("gist(internal)");
-DATA(insert OID = 772 ( gistcostestimate PGNSP PGUID 12 f f t f v 8 0 "0 0 0 0 0 0 0 0" gistcostestimate - _null_ ));
+DATA(insert OID = 772 ( gistcostestimate PGNSP PGUID 12 f f t f v 8 2278 "2281 2281 2281 2281 2281 2281 2281 2281" gistcostestimate - _null_ ));
DESCR("gist(internal)");
DATA(insert OID = 784 ( tintervaleq PGNSP PGUID 12 f f t f i 2 16 "704 704" tintervaleq - _null_ ));
DATA(insert OID = 860 ( bpchar PGNSP PGUID 12 f f t f i 1 1042 "18" char_bpchar - _null_ ));
DESCR("convert char to char()");
-DATA(insert OID = 861 ( current_database PGNSP PGUID 12 f f t f i 0 19 "0" current_database - _null_ ));
+DATA(insert OID = 861 ( current_database PGNSP PGUID 12 f f t f i 0 19 "" current_database - _null_ ));
DESCR("returns the current database");
DATA(insert OID = 862 ( int4_mul_cash PGNSP PGUID 12 f f t f i 2 790 "23 790" int4_mul_cash - _null_ ));
DATA(insert OID = 867 ( cash_div_int2 PGNSP PGUID 12 f f t f i 2 790 "790 21" cash_div_int2 - _null_ ));
DESCR("divide");
-DATA(insert OID = 886 ( cash_in PGNSP PGUID 12 f f t f i 1 790 "0" cash_in - _null_ ));
+DATA(insert OID = 886 ( cash_in PGNSP PGUID 12 f f t f i 1 790 "2275" cash_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 887 ( cash_out PGNSP PGUID 12 f f t f i 1 23 "0" cash_out - _null_ ));
+DATA(insert OID = 887 ( cash_out PGNSP PGUID 12 f f t f i 1 2275 "790" cash_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 888 ( cash_eq PGNSP PGUID 12 f f t f i 2 16 "790 790" cash_eq - _null_ ));
DESCR("equal");
DATA(insert OID = 1026 ( timezone PGNSP PGUID 12 f f t f s 2 1186 "1186 1184" timestamptz_izone - _null_ ));
DESCR("time zone");
-DATA(insert OID = 1029 ( nullvalue PGNSP PGUID 12 f f f f i 1 16 "0" nullvalue - _null_ ));
+DATA(insert OID = 1029 ( nullvalue PGNSP PGUID 12 f f f f i 1 16 "2276" nullvalue - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1030 ( nonnullvalue PGNSP PGUID 12 f f f f i 1 16 "0" nonnullvalue - _null_ ));
+DATA(insert OID = 1030 ( nonnullvalue PGNSP PGUID 12 f f f f i 1 16 "2276" nonnullvalue - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1031 ( aclitemin PGNSP PGUID 12 f f t f s 1 1033 "0" aclitemin - _null_ ));
+DATA(insert OID = 1031 ( aclitemin PGNSP PGUID 12 f f t f s 1 1033 "2275" aclitemin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1032 ( aclitemout PGNSP PGUID 12 f f t f s 1 23 "1033" aclitemout - _null_ ));
+DATA(insert OID = 1032 ( aclitemout PGNSP PGUID 12 f f t f s 1 2275 "1033" aclitemout - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1035 ( aclinsert PGNSP PGUID 12 f f t f s 2 1034 "1034 1033" aclinsert - _null_ ));
DESCR("add/update ACL item");
DESCR("does ACL contain item?");
DATA(insert OID = 1038 ( seteval PGNSP PGUID 12 f f t t v 1 23 "26" seteval - _null_ ));
DESCR("internal function supporting PostQuel-style sets");
-DATA(insert OID = 1044 ( bpcharin PGNSP PGUID 12 f f t f i 3 1042 "0 26 23" bpcharin - _null_ ));
+DATA(insert OID = 1044 ( bpcharin PGNSP PGUID 12 f f t f i 3 1042 "2275 26 23" bpcharin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1045 ( bpcharout PGNSP PGUID 12 f f t f i 1 23 "0" bpcharout - _null_ ));
+DATA(insert OID = 1045 ( bpcharout PGNSP PGUID 12 f f t f i 1 2275 "1042" bpcharout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1046 ( varcharin PGNSP PGUID 12 f f t f i 3 1043 "0 26 23" varcharin - _null_ ));
+DATA(insert OID = 1046 ( varcharin PGNSP PGUID 12 f f t f i 3 1043 "2275 26 23" varcharin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1047 ( varcharout PGNSP PGUID 12 f f t f i 1 23 "0" varcharout - _null_ ));
+DATA(insert OID = 1047 ( varcharout PGNSP PGUID 12 f f t f i 1 2275 "1043" varcharout - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1048 ( bpchareq PGNSP PGUID 12 f f t f i 2 16 "1042 1042" bpchareq - _null_ ));
DESCR("equal");
DESCR("hash");
DATA(insert OID = 1081 ( format_type PGNSP PGUID 12 f f f f s 2 25 "26 23" format_type - _null_ ));
DESCR("format a type oid and atttypmod to canonical SQL");
-DATA(insert OID = 1084 ( date_in PGNSP PGUID 12 f f t f s 1 1082 "0" date_in - _null_ ));
+DATA(insert OID = 1084 ( date_in PGNSP PGUID 12 f f t f s 1 1082 "2275" date_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1085 ( date_out PGNSP PGUID 12 f f t f s 1 23 "0" date_out - _null_ ));
+DATA(insert OID = 1085 ( date_out PGNSP PGUID 12 f f t f s 1 2275 "1082" date_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1086 ( date_eq PGNSP PGUID 12 f f t f i 2 16 "1082 1082" date_eq - _null_ ));
DESCR("equal");
DESCR("add");
DATA(insert OID = 1142 ( date_mii PGNSP PGUID 12 f f t f i 2 1082 "1082 23" date_mii - _null_ ));
DESCR("subtract");
-DATA(insert OID = 1143 ( time_in PGNSP PGUID 12 f f t f s 1 1083 "0" time_in - _null_ ));
+DATA(insert OID = 1143 ( time_in PGNSP PGUID 12 f f t f s 1 1083 "2275" time_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1144 ( time_out PGNSP PGUID 12 f f t f i 1 23 "0" time_out - _null_ ));
+DATA(insert OID = 1144 ( time_out PGNSP PGUID 12 f f t f i 1 2275 "1083" time_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1145 ( time_eq PGNSP PGUID 12 f f t f i 2 16 "1083 1083" time_eq - _null_ ));
DESCR("equal");
DATA(insert OID = 1149 ( circle_div_pt PGNSP PGUID 12 f f t f i 2 718 "718 600" circle_div_pt - _null_ ));
DESCR("divide");
-DATA(insert OID = 1150 ( timestamptz_in PGNSP PGUID 12 f f t f s 1 1184 "0" timestamptz_in - _null_ ));
+DATA(insert OID = 1150 ( timestamptz_in PGNSP PGUID 12 f f t f s 1 1184 "2275" timestamptz_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1151 ( timestamptz_out PGNSP PGUID 12 f f t f s 1 23 "0" timestamptz_out - _null_ ));
+DATA(insert OID = 1151 ( timestamptz_out PGNSP PGUID 12 f f t f s 1 2275 "1184" timestamptz_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1152 ( timestamptz_eq PGNSP PGUID 12 f f t f i 2 16 "1184 1184" timestamp_eq - _null_ ));
DESCR("equal");
DATA(insert OID = 1159 ( timezone PGNSP PGUID 12 f f t f s 2 1114 "25 1184" timestamptz_zone - _null_ ));
DESCR("timestamp at a specified time zone");
-DATA(insert OID = 1160 ( interval_in PGNSP PGUID 12 f f t f s 1 1186 "0" interval_in - _null_ ));
+DATA(insert OID = 1160 ( interval_in PGNSP PGUID 12 f f t f s 1 1186 "2275" interval_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1161 ( interval_out PGNSP PGUID 12 f f t f i 1 23 "0" interval_out - _null_ ));
+DATA(insert OID = 1161 ( interval_out PGNSP PGUID 12 f f t f i 1 2275 "1186" interval_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1162 ( interval_eq PGNSP PGUID 12 f f t f i 2 16 "1186 1186" interval_eq - _null_ ));
DESCR("equal");
DESCR("convert date and time with time zone to timestamp with time zone");
DATA(insert OID = 1298 ( timetzdate_pl PGNSP PGUID 14 f f t f i 2 1184 "1266 1082" "select ($2 + $1)" - _null_ ));
DESCR("convert time with time zone and date to timestamp");
-DATA(insert OID = 1299 ( now PGNSP PGUID 12 f f t f s 0 1184 "0" now - _null_ ));
+DATA(insert OID = 1299 ( now PGNSP PGUID 12 f f t f s 0 1184 "" now - _null_ ));
DESCR("current transaction time");
/* OIDS 1300 - 1399 */
-DATA(insert OID = 1300 ( positionsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" positionsel - _null_ ));
+DATA(insert OID = 1300 ( positionsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" positionsel - _null_ ));
DESCR("restriction selectivity for position-comparison operators");
-DATA(insert OID = 1301 ( positionjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" positionjoinsel - _null_ ));
+DATA(insert OID = 1301 ( positionjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" positionjoinsel - _null_ ));
DESCR("join selectivity for position-comparison operators");
-DATA(insert OID = 1302 ( contsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" contsel - _null_ ));
+DATA(insert OID = 1302 ( contsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" contsel - _null_ ));
DESCR("restriction selectivity for containment comparison operators");
-DATA(insert OID = 1303 ( contjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" contjoinsel - _null_ ));
+DATA(insert OID = 1303 ( contjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" contjoinsel - _null_ ));
DESCR("join selectivity for containment comparison operators");
DATA(insert OID = 1304 ( overlaps PGNSP PGUID 12 f f f f i 4 16 "1184 1184 1184 1184" overlaps_timestamp - _null_ ));
DATA(insert OID = 1311 ( overlaps PGNSP PGUID 14 f f f f i 4 16 "1083 1186 1083 1083" "select ($1, ($1 + $2)) overlaps ($3, $4)" - _null_ ));
DESCR("SQL92 interval comparison");
-DATA(insert OID = 1312 ( timestamp_in PGNSP PGUID 12 f f t f s 1 1114 "0" timestamp_in - _null_ ));
+DATA(insert OID = 1312 ( timestamp_in PGNSP PGUID 12 f f t f s 1 1114 "2275" timestamp_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1313 ( timestamp_out PGNSP PGUID 12 f f t f s 1 23 "0" timestamp_out - _null_ ));
+DATA(insert OID = 1313 ( timestamp_out PGNSP PGUID 12 f f t f s 1 2275 "1114" timestamp_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1314 ( timestamptz_cmp PGNSP PGUID 12 f f t f i 2 23 "1184 1184" timestamp_cmp - _null_ ));
DESCR("less-equal-greater");
DESCR("print type names of oidvector field");
-DATA(insert OID = 1350 ( timetz_in PGNSP PGUID 12 f f t f s 1 1266 "0" timetz_in - _null_ ));
+DATA(insert OID = 1350 ( timetz_in PGNSP PGUID 12 f f t f s 1 1266 "2275" timetz_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1351 ( timetz_out PGNSP PGUID 12 f f t f i 1 23 "0" timetz_out - _null_ ));
+DATA(insert OID = 1351 ( timetz_out PGNSP PGUID 12 f f t f i 1 2275 "1266" timetz_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1352 ( timetz_eq PGNSP PGUID 12 f f t f i 2 16 "1266 1266" timetz_eq - _null_ ));
DESCR("equal");
DATA(insert OID = 1401 ( varchar PGNSP PGUID 12 f f t f i 1 1043 "19" name_text - _null_ ));
DESCR("convert name to varchar");
-DATA(insert OID = 1402 ( current_schema PGNSP PGUID 12 f f t f s 0 19 "0" current_schema - _null_ ));
+DATA(insert OID = 1402 ( current_schema PGNSP PGUID 12 f f t f s 0 19 "" current_schema - _null_ ));
DESCR("current schema name");
DATA(insert OID = 1403 ( current_schemas PGNSP PGUID 12 f f t f s 1 1003 "16" current_schemas - _null_ ));
DESCR("current schema search list");
DATA(insert OID = 1449 ( polygon PGNSP PGUID 12 f f t f i 1 604 "602" path_poly - _null_ ));
DESCR("convert path to polygon");
-DATA(insert OID = 1450 ( circle_in PGNSP PGUID 12 f f t f i 1 718 "0" circle_in - _null_ ));
+DATA(insert OID = 1450 ( circle_in PGNSP PGUID 12 f f t f i 1 718 "2275" circle_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1451 ( circle_out PGNSP PGUID 12 f f t f i 1 23 "718" circle_out - _null_ ));
+DATA(insert OID = 1451 ( circle_out PGNSP PGUID 12 f f t f i 1 2275 "718" circle_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1452 ( circle_same PGNSP PGUID 12 f f t f i 2 16 "718 718" circle_same - _null_ ));
DESCR("same as");
DATA(insert OID = 1489 ( close_lseg PGNSP PGUID 12 f f t f i 2 600 "601 601" close_lseg - _null_ ));
DESCR("closest point to line segment on line segment");
-DATA(insert OID = 1490 ( line_in PGNSP PGUID 12 f f t f i 1 628 "0" line_in - _null_ ));
+DATA(insert OID = 1490 ( line_in PGNSP PGUID 12 f f t f i 1 628 "2275" line_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1491 ( line_out PGNSP PGUID 12 f f t f i 1 23 "628" line_out - _null_ ));
+DATA(insert OID = 1491 ( line_out PGNSP PGUID 12 f f t f i 1 2275 "628" line_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1492 ( line_eq PGNSP PGUID 12 f f t f i 2 16 "628 628" line_eq - _null_ ));
DESCR("lines equal?");
DATA(insert OID = 1556 ( npoints PGNSP PGUID 12 f f t f i 1 23 "604" poly_npoints - _null_ ));
DESCR("number of points in polygon");
-DATA(insert OID = 1564 ( bit_in PGNSP PGUID 12 f f t f i 1 1560 "0" bit_in - _null_ ));
+DATA(insert OID = 1564 ( bit_in PGNSP PGUID 12 f f t f i 1 1560 "2275" bit_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1565 ( bit_out PGNSP PGUID 12 f f t f i 1 23 "0" bit_out - _null_ ));
+DATA(insert OID = 1565 ( bit_out PGNSP PGUID 12 f f t f i 1 2275 "1560" bit_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1569 ( like PGNSP PGUID 12 f f t f i 2 16 "25 25" textlike - _null_ ));
DATA(insert OID = 1765 ( setval PGNSP PGUID 12 f f t f v 3 20 "25 20 16" setval_and_iscalled - _null_ ));
DESCR("set sequence value and iscalled status");
-DATA(insert OID = 1579 ( varbit_in PGNSP PGUID 12 f f t f i 1 1562 "0" varbit_in - _null_ ));
+DATA(insert OID = 1579 ( varbit_in PGNSP PGUID 12 f f t f i 1 1562 "2275" varbit_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1580 ( varbit_out PGNSP PGUID 12 f f t f i 1 23 "0" varbit_out - _null_ ));
+DATA(insert OID = 1580 ( varbit_out PGNSP PGUID 12 f f t f i 1 2275 "1562" varbit_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1581 ( biteq PGNSP PGUID 12 f f t f i 2 16 "1560 1560" biteq - _null_ ));
DATA(insert OID = 1596 ( bitcmp PGNSP PGUID 12 f f t f i 2 23 "1560 1560" bitcmp - _null_ ));
DESCR("compare");
-DATA(insert OID = 1598 ( random PGNSP PGUID 12 f f t f v 0 701 "0" drandom - _null_ ));
+DATA(insert OID = 1598 ( random PGNSP PGUID 12 f f t f v 0 701 "" drandom - _null_ ));
DESCR("random value");
DATA(insert OID = 1599 ( setseed PGNSP PGUID 12 f f t f v 1 23 "701" setseed - _null_ ));
DESCR("set random seed");
DESCR("radians to degrees");
DATA(insert OID = 1609 ( radians PGNSP PGUID 12 f f t f i 1 701 "701" radians - _null_ ));
DESCR("degrees to radians");
-DATA(insert OID = 1610 ( pi PGNSP PGUID 12 f f t f i 0 701 "0" dpi - _null_ ));
+DATA(insert OID = 1610 ( pi PGNSP PGUID 12 f f t f i 0 701 "" dpi - _null_ ));
DESCR("PI");
DATA(insert OID = 1618 ( interval_mul PGNSP PGUID 12 f f t f i 2 1186 "1186 701" interval_mul - _null_ ));
DATA(insert OID = 1637 ( like_escape PGNSP PGUID 12 f f t f i 2 25 "25 25" like_escape - _null_ ));
DESCR("convert match pattern to use backslash escapes");
-DATA(insert OID = 1689 ( update_pg_pwd_and_pg_group PGNSP PGUID 12 f f t f v 0 0 "" update_pg_pwd_and_pg_group - _null_ ));
+DATA(insert OID = 1689 ( update_pg_pwd_and_pg_group PGNSP PGUID 12 f f t f v 0 2279 "" update_pg_pwd_and_pg_group - _null_ ));
DESCR("update pg_pwd and pg_group files");
/* Oracle Compatibility Related Functions - By Edmund Mergl <E.Mergl@bawue.de> */
/* for multi-byte support */
/* return database encoding name */
-DATA(insert OID = 1039 ( getdatabaseencoding PGNSP PGUID 12 f f t f s 0 19 "0" getdatabaseencoding - _null_ ));
+DATA(insert OID = 1039 ( getdatabaseencoding PGNSP PGUID 12 f f t f s 0 19 "" getdatabaseencoding - _null_ ));
DESCR("encoding name of current database");
/* return client encoding name i.e. session encoding */
-DATA(insert OID = 810 ( pg_client_encoding PGNSP PGUID 12 f f t f s 0 19 "0" pg_client_encoding - _null_ ));
+DATA(insert OID = 810 ( pg_client_encoding PGNSP PGUID 12 f f t f s 0 19 "" pg_client_encoding - _null_ ));
DESCR("encoding name of current database");
DATA(insert OID = 1717 ( convert PGNSP PGUID 12 f f t f s 2 25 "25 19" pg_convert - _null_ ));
/* Generic referential integrity constraint triggers */
-DATA(insert OID = 1644 ( RI_FKey_check_ins PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_check_ins - _null_ ));
+DATA(insert OID = 1644 ( RI_FKey_check_ins PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_check_ins - _null_ ));
DESCR("referential integrity FOREIGN KEY ... REFERENCES");
-DATA(insert OID = 1645 ( RI_FKey_check_upd PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_check_upd - _null_ ));
+DATA(insert OID = 1645 ( RI_FKey_check_upd PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_check_upd - _null_ ));
DESCR("referential integrity FOREIGN KEY ... REFERENCES");
-DATA(insert OID = 1646 ( RI_FKey_cascade_del PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_cascade_del - _null_ ));
+DATA(insert OID = 1646 ( RI_FKey_cascade_del PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_cascade_del - _null_ ));
DESCR("referential integrity ON DELETE CASCADE");
-DATA(insert OID = 1647 ( RI_FKey_cascade_upd PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_cascade_upd - _null_ ));
+DATA(insert OID = 1647 ( RI_FKey_cascade_upd PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_cascade_upd - _null_ ));
DESCR("referential integrity ON UPDATE CASCADE");
-DATA(insert OID = 1648 ( RI_FKey_restrict_del PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_restrict_del - _null_ ));
+DATA(insert OID = 1648 ( RI_FKey_restrict_del PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_restrict_del - _null_ ));
DESCR("referential integrity ON DELETE RESTRICT");
-DATA(insert OID = 1649 ( RI_FKey_restrict_upd PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_restrict_upd - _null_ ));
+DATA(insert OID = 1649 ( RI_FKey_restrict_upd PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_restrict_upd - _null_ ));
DESCR("referential integrity ON UPDATE RESTRICT");
-DATA(insert OID = 1650 ( RI_FKey_setnull_del PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_setnull_del - _null_ ));
+DATA(insert OID = 1650 ( RI_FKey_setnull_del PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_setnull_del - _null_ ));
DESCR("referential integrity ON DELETE SET NULL");
-DATA(insert OID = 1651 ( RI_FKey_setnull_upd PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_setnull_upd - _null_ ));
+DATA(insert OID = 1651 ( RI_FKey_setnull_upd PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_setnull_upd - _null_ ));
DESCR("referential integrity ON UPDATE SET NULL");
-DATA(insert OID = 1652 ( RI_FKey_setdefault_del PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_setdefault_del - _null_ ));
+DATA(insert OID = 1652 ( RI_FKey_setdefault_del PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_setdefault_del - _null_ ));
DESCR("referential integrity ON DELETE SET DEFAULT");
-DATA(insert OID = 1653 ( RI_FKey_setdefault_upd PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_setdefault_upd - _null_ ));
+DATA(insert OID = 1653 ( RI_FKey_setdefault_upd PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_setdefault_upd - _null_ ));
DESCR("referential integrity ON UPDATE SET DEFAULT");
-DATA(insert OID = 1654 ( RI_FKey_noaction_del PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_noaction_del - _null_ ));
+DATA(insert OID = 1654 ( RI_FKey_noaction_del PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_noaction_del - _null_ ));
DESCR("referential integrity ON DELETE NO ACTION");
-DATA(insert OID = 1655 ( RI_FKey_noaction_upd PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_noaction_upd - _null_ ));
+DATA(insert OID = 1655 ( RI_FKey_noaction_upd PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_noaction_upd - _null_ ));
DESCR("referential integrity ON UPDATE NO ACTION");
DATA(insert OID = 1666 ( varbiteq PGNSP PGUID 12 f f t f i 2 16 "1562 1562" biteq - _null_ ));
/* for mac type support */
-DATA(insert OID = 436 ( macaddr_in PGNSP PGUID 12 f f t f i 1 829 "0" macaddr_in - _null_ ));
+DATA(insert OID = 436 ( macaddr_in PGNSP PGUID 12 f f t f i 1 829 "2275" macaddr_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 437 ( macaddr_out PGNSP PGUID 12 f f t f i 1 23 "0" macaddr_out - _null_ ));
+DATA(insert OID = 437 ( macaddr_out PGNSP PGUID 12 f f t f i 1 2275 "829" macaddr_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 752 ( text PGNSP PGUID 12 f f t f i 1 25 "829" macaddr_text - _null_ ));
DESCR("less-equal-greater");
/* for inet type support */
-DATA(insert OID = 910 ( inet_in PGNSP PGUID 12 f f t f i 1 869 "0" inet_in - _null_ ));
+DATA(insert OID = 910 ( inet_in PGNSP PGUID 12 f f t f i 1 869 "2275" inet_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 911 ( inet_out PGNSP PGUID 12 f f t f i 1 23 "0" inet_out - _null_ ));
+DATA(insert OID = 911 ( inet_out PGNSP PGUID 12 f f t f i 1 2275 "869" inet_out - _null_ ));
DESCR("(internal)");
/* for cidr type support */
-DATA(insert OID = 1267 ( cidr_in PGNSP PGUID 12 f f t f i 1 650 "0" cidr_in - _null_ ));
+DATA(insert OID = 1267 ( cidr_in PGNSP PGUID 12 f f t f i 1 650 "2275" cidr_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1427 ( cidr_out PGNSP PGUID 12 f f t f i 1 23 "0" cidr_out - _null_ ));
+DATA(insert OID = 1427 ( cidr_out PGNSP PGUID 12 f f t f i 1 2275 "650" cidr_out - _null_ ));
DESCR("(internal)");
/* these are used for both inet and cidr */
/* OID's 1700 - 1799 NUMERIC data type */
-DATA(insert OID = 1701 ( numeric_in PGNSP PGUID 12 f f t f i 3 1700 "0 26 23" numeric_in - _null_ ));
+DATA(insert OID = 1701 ( numeric_in PGNSP PGUID 12 f f t f i 3 1700 "2275 26 23" numeric_in - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1702 ( numeric_out PGNSP PGUID 12 f f t f i 1 23 "0" numeric_out - _null_ ));
+DATA(insert OID = 1702 ( numeric_out PGNSP PGUID 12 f f t f i 1 2275 "1700" numeric_out - _null_ ));
DESCR("(internal)");
DATA(insert OID = 1703 ( numeric PGNSP PGUID 12 f f t f i 2 1700 "1700 23" numeric - _null_ ));
DESCR("adjust numeric to typmod precision/scale");
DATA(insert OID = 1283 ( quote_literal PGNSP PGUID 12 f f t f i 1 25 "25" quote_literal - _null_ ));
DESCR("quote a literal for usage in a querystring");
-DATA(insert OID = 1798 ( oidin PGNSP PGUID 12 f f t f i 1 26 "0" oidin - _null_ ));
+DATA(insert OID = 1798 ( oidin PGNSP PGUID 12 f f t f i 1 26 "2275" oidin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 1799 ( oidout PGNSP PGUID 12 f f t f i 1 23 "0" oidout - _null_ ));
+DATA(insert OID = 1799 ( oidout PGNSP PGUID 12 f f t f i 1 2275 "26" oidout - _null_ ));
DESCR("(internal)");
DESCR("length in bits");
/* Selectivity estimators for LIKE and related operators */
-DATA(insert OID = 1814 ( iclikesel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" iclikesel - _null_ ));
+DATA(insert OID = 1814 ( iclikesel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" iclikesel - _null_ ));
DESCR("restriction selectivity of ILIKE");
-DATA(insert OID = 1815 ( icnlikesel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" icnlikesel - _null_ ));
+DATA(insert OID = 1815 ( icnlikesel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" icnlikesel - _null_ ));
DESCR("restriction selectivity of NOT ILIKE");
-DATA(insert OID = 1816 ( iclikejoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" iclikejoinsel - _null_ ));
+DATA(insert OID = 1816 ( iclikejoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" iclikejoinsel - _null_ ));
DESCR("join selectivity of ILIKE");
-DATA(insert OID = 1817 ( icnlikejoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" icnlikejoinsel - _null_ ));
+DATA(insert OID = 1817 ( icnlikejoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" icnlikejoinsel - _null_ ));
DESCR("join selectivity of NOT ILIKE");
-DATA(insert OID = 1818 ( regexeqsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" regexeqsel - _null_ ));
+DATA(insert OID = 1818 ( regexeqsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" regexeqsel - _null_ ));
DESCR("restriction selectivity of regex match");
-DATA(insert OID = 1819 ( likesel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" likesel - _null_ ));
+DATA(insert OID = 1819 ( likesel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" likesel - _null_ ));
DESCR("restriction selectivity of LIKE");
-DATA(insert OID = 1820 ( icregexeqsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" icregexeqsel - _null_ ));
+DATA(insert OID = 1820 ( icregexeqsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" icregexeqsel - _null_ ));
DESCR("restriction selectivity of case-insensitive regex match");
-DATA(insert OID = 1821 ( regexnesel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" regexnesel - _null_ ));
+DATA(insert OID = 1821 ( regexnesel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" regexnesel - _null_ ));
DESCR("restriction selectivity of regex non-match");
-DATA(insert OID = 1822 ( nlikesel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" nlikesel - _null_ ));
+DATA(insert OID = 1822 ( nlikesel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" nlikesel - _null_ ));
DESCR("restriction selectivity of NOT LIKE");
-DATA(insert OID = 1823 ( icregexnesel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" icregexnesel - _null_ ));
+DATA(insert OID = 1823 ( icregexnesel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" icregexnesel - _null_ ));
DESCR("restriction selectivity of case-insensitive regex non-match");
-DATA(insert OID = 1824 ( regexeqjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" regexeqjoinsel - _null_ ));
+DATA(insert OID = 1824 ( regexeqjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" regexeqjoinsel - _null_ ));
DESCR("join selectivity of regex match");
-DATA(insert OID = 1825 ( likejoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" likejoinsel - _null_ ));
+DATA(insert OID = 1825 ( likejoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" likejoinsel - _null_ ));
DESCR("join selectivity of LIKE");
-DATA(insert OID = 1826 ( icregexeqjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" icregexeqjoinsel - _null_ ));
+DATA(insert OID = 1826 ( icregexeqjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" icregexeqjoinsel - _null_ ));
DESCR("join selectivity of case-insensitive regex match");
-DATA(insert OID = 1827 ( regexnejoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" regexnejoinsel - _null_ ));
+DATA(insert OID = 1827 ( regexnejoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" regexnejoinsel - _null_ ));
DESCR("join selectivity of regex non-match");
-DATA(insert OID = 1828 ( nlikejoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" nlikejoinsel - _null_ ));
+DATA(insert OID = 1828 ( nlikejoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" nlikejoinsel - _null_ ));
DESCR("join selectivity of NOT LIKE");
-DATA(insert OID = 1829 ( icregexnejoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" icregexnejoinsel - _null_ ));
+DATA(insert OID = 1829 ( icregexnejoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" icregexnejoinsel - _null_ ));
DESCR("join selectivity of case-insensitive regex non-match");
/* Aggregate-related functions */
DATA(insert OID = 2145 ( min PGNSP PGUID 12 t f f f i 1 25 "25" aggregate_dummy - _null_ ));
DATA(insert OID = 2146 ( min PGNSP PGUID 12 t f f f i 1 1700 "1700" aggregate_dummy - _null_ ));
-DATA(insert OID = 2147 ( count PGNSP PGUID 12 t f f f i 1 20 "0" aggregate_dummy - _null_ ));
+DATA(insert OID = 2147 ( count PGNSP PGUID 12 t f f f i 1 20 "2276" aggregate_dummy - _null_ ));
DATA(insert OID = 2148 ( variance PGNSP PGUID 12 t f f f i 1 1700 "20" aggregate_dummy - _null_ ));
DATA(insert OID = 2149 ( variance PGNSP PGUID 12 t f f f i 1 1700 "23" aggregate_dummy - _null_ ));
DATA(insert OID = 2159 ( stddev PGNSP PGUID 12 t f f f i 1 1700 "1700" aggregate_dummy - _null_ ));
-DATA(insert OID = 2212 ( regprocedurein PGNSP PGUID 12 f f t f s 1 2202 "0" regprocedurein - _null_ ));
+DATA(insert OID = 2212 ( regprocedurein PGNSP PGUID 12 f f t f s 1 2202 "2275" regprocedurein - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 2213 ( regprocedureout PGNSP PGUID 12 f f t f s 1 23 "0" regprocedureout - _null_ ));
+DATA(insert OID = 2213 ( regprocedureout PGNSP PGUID 12 f f t f s 1 2275 "2202" regprocedureout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 2214 ( regoperin PGNSP PGUID 12 f f t f s 1 2203 "0" regoperin - _null_ ));
+DATA(insert OID = 2214 ( regoperin PGNSP PGUID 12 f f t f s 1 2203 "2275" regoperin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 2215 ( regoperout PGNSP PGUID 12 f f t f s 1 23 "0" regoperout - _null_ ));
+DATA(insert OID = 2215 ( regoperout PGNSP PGUID 12 f f t f s 1 2275 "2203" regoperout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 2216 ( regoperatorin PGNSP PGUID 12 f f t f s 1 2204 "0" regoperatorin - _null_ ));
+DATA(insert OID = 2216 ( regoperatorin PGNSP PGUID 12 f f t f s 1 2204 "2275" regoperatorin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 2217 ( regoperatorout PGNSP PGUID 12 f f t f s 1 23 "0" regoperatorout - _null_ ));
+DATA(insert OID = 2217 ( regoperatorout PGNSP PGUID 12 f f t f s 1 2275 "2204" regoperatorout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 2218 ( regclassin PGNSP PGUID 12 f f t f s 1 2205 "0" regclassin - _null_ ));
+DATA(insert OID = 2218 ( regclassin PGNSP PGUID 12 f f t f s 1 2205 "2275" regclassin - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 2219 ( regclassout PGNSP PGUID 12 f f t f s 1 23 "0" regclassout - _null_ ));
+DATA(insert OID = 2219 ( regclassout PGNSP PGUID 12 f f t f s 1 2275 "2205" regclassout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 2220 ( regtypein PGNSP PGUID 12 f f t f s 1 2206 "0" regtypein - _null_ ));
+DATA(insert OID = 2220 ( regtypein PGNSP PGUID 12 f f t f s 1 2206 "2275" regtypein - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 2221 ( regtypeout PGNSP PGUID 12 f f t f s 1 23 "0" regtypeout - _null_ ));
+DATA(insert OID = 2221 ( regtypeout PGNSP PGUID 12 f f t f s 1 2275 "2206" regtypeout - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 2246 ( fmgr_internal_validator PGNSP PGUID 12 f f t f s 1 26 "23" fmgr_internal_validator - _null_ ));
+DATA(insert OID = 2246 ( fmgr_internal_validator PGNSP PGUID 12 f f t f s 1 2278 "26" fmgr_internal_validator - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 2247 ( fmgr_c_validator PGNSP PGUID 12 f f t f s 1 26 "23" fmgr_c_validator - _null_ ));
+DATA(insert OID = 2247 ( fmgr_c_validator PGNSP PGUID 12 f f t f s 1 2278 "26" fmgr_c_validator - _null_ ));
DESCR("(internal)");
-DATA(insert OID = 2248 ( fmgr_sql_validator PGNSP PGUID 12 f f t f s 1 26 "23" fmgr_sql_validator - _null_ ));
+DATA(insert OID = 2248 ( fmgr_sql_validator PGNSP PGUID 12 f f t f s 1 2278 "26" fmgr_sql_validator - _null_ ));
DESCR("(internal)");
DATA(insert OID = 2250 ( has_database_privilege PGNSP PGUID 12 f f t f s 3 16 "19 25 25" has_database_privilege_name_name - _null_ ));
DATA(insert OID = 2273 ( has_schema_privilege PGNSP PGUID 12 f f t f s 2 16 "26 25" has_schema_privilege_id - _null_ ));
DESCR("current user privilege on schema by schema oid");
+
+
+DATA(insert OID = 2290 ( record_in PGNSP PGUID 12 f f t f i 1 2249 "2275" record_in - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2291 ( record_out PGNSP PGUID 12 f f t f i 1 2275 "2249" record_out - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2292 ( cstring_in PGNSP PGUID 12 f f t f i 1 2275 "2275" cstring_in - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2293 ( cstring_out PGNSP PGUID 12 f f t f i 1 2275 "2275" cstring_out - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2294 ( any_in PGNSP PGUID 12 f f t f i 1 2276 "2275" any_in - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2295 ( any_out PGNSP PGUID 12 f f t f i 1 2275 "2276" any_out - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2296 ( anyarray_in PGNSP PGUID 12 f f t f i 1 2277 "2275" anyarray_in - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2297 ( anyarray_out PGNSP PGUID 12 f f t f i 1 2275 "2277" anyarray_out - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2298 ( void_in PGNSP PGUID 12 f f t f i 1 2278 "2275" void_in - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2299 ( void_out PGNSP PGUID 12 f f t f i 1 2275 "2278" void_out - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2300 ( trigger_in PGNSP PGUID 12 f f t f i 1 2279 "2275" trigger_in - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2301 ( trigger_out PGNSP PGUID 12 f f t f i 1 2275 "2279" trigger_out - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2302 ( language_handler_in PGNSP PGUID 12 f f t f i 1 2280 "2275" language_handler_in - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2303 ( language_handler_out PGNSP PGUID 12 f f t f i 1 2275 "2280" language_handler_out - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2304 ( internal_in PGNSP PGUID 12 f f t f i 1 2281 "2275" internal_in - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2305 ( internal_out PGNSP PGUID 12 f f t f i 1 2275 "2281" internal_out - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2306 ( opaque_in PGNSP PGUID 12 f f t f i 1 2282 "2275" opaque_in - _null_ ));
+DESCR("(internal)");
+DATA(insert OID = 2307 ( opaque_out PGNSP PGUID 12 f f t f i 1 2275 "2282" opaque_out - _null_ ));
+DESCR("(internal)");
+
+
/*
* Symbolic values for provolatile column: these indicate whether the result
* of a function is dependent *only* on the values of its explicit arguments,
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_type.h,v 1.127 2002/08/05 02:30:50 tgl Exp $
+ * $Id: pg_type.h,v 1.128 2002/08/22 00:01:48 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
/*
* pseudo-types
*
- * types with typtype='p' are special types that represent classes of types
- * that are not easily defined in advance. Currently there is only one pseudo
- * type -- record. The record type is used to specify that the value is a
- * tuple, but of unknown structure until runtime.
+ * types with typtype='p' represent various special cases in the type system.
+ *
+ * These cannot be used to define table columns, but are valid as function
+ * argument and result types (if supported by the function's implementation
+ * language).
*/
-DATA(insert OID = 2249 ( record PGNSP PGUID 4 t p t \054 0 0 oidin oidout i p f 0 -1 0 _null_ _null_ ));
+DATA(insert OID = 2249 ( record PGNSP PGUID 4 t p t \054 0 0 record_in record_out i p f 0 -1 0 _null_ _null_ ));
#define RECORDOID 2249
+DATA(insert OID = 2275 ( cstring PGNSP PGUID 4 t p t \054 0 0 cstring_in cstring_out i p f 0 -1 0 _null_ _null_ ));
+#define CSTRINGOID 2275
+DATA(insert OID = 2276 ( any PGNSP PGUID 4 t p t \054 0 0 any_in any_out i p f 0 -1 0 _null_ _null_ ));
+#define ANYOID 2276
+DATA(insert OID = 2277 ( anyarray PGNSP PGUID 4 t p t \054 0 0 anyarray_in anyarray_out i p f 0 -1 0 _null_ _null_ ));
+#define ANYARRAYOID 2277
+DATA(insert OID = 2278 ( void PGNSP PGUID 4 t p t \054 0 0 void_in void_out i p f 0 -1 0 _null_ _null_ ));
+#define VOIDOID 2278
+DATA(insert OID = 2279 ( trigger PGNSP PGUID 4 t p t \054 0 0 trigger_in trigger_out i p f 0 -1 0 _null_ _null_ ));
+#define TRIGGEROID 2279
+DATA(insert OID = 2280 ( language_handler PGNSP PGUID 4 t p t \054 0 0 language_handler_in language_handler_out i p f 0 -1 0 _null_ _null_ ));
+#define LANGUAGE_HANDLEROID 2280
+DATA(insert OID = 2281 ( internal PGNSP PGUID 4 t p t \054 0 0 internal_in internal_out i p f 0 -1 0 _null_ _null_ ));
+#define INTERNALOID 2281
+DATA(insert OID = 2282 ( opaque PGNSP PGUID 4 t p t \054 0 0 opaque_in opaque_out i p f 0 -1 0 _null_ _null_ ));
+#define OPAQUEOID 2282
/*
* prototypes for functions in pg_type.c
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: parse_func.h,v 1.41 2002/06/20 20:29:51 momjian Exp $
+ * $Id: parse_func.h,v 1.42 2002/08/22 00:01:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes);
extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes,
- bool opaqueOK, const char *caller);
+ const char *caller);
#endif /* PARSE_FUNC_H */
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: builtins.h,v 1.193 2002/08/20 04:46:00 momjian Exp $
+ * $Id: builtins.h,v 1.194 2002/08/22 00:01:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern Datum int2vectorin(PG_FUNCTION_ARGS);
extern Datum int2vectorout(PG_FUNCTION_ARGS);
extern Datum int2vectoreq(PG_FUNCTION_ARGS);
-extern Datum int44in(PG_FUNCTION_ARGS);
-extern Datum int44out(PG_FUNCTION_ARGS);
extern Datum int4in(PG_FUNCTION_ARGS);
extern Datum int4out(PG_FUNCTION_ARGS);
extern Datum i2toi4(PG_FUNCTION_ARGS);
extern Datum oidvectorge(PG_FUNCTION_ARGS);
extern Datum oidvectorgt(PG_FUNCTION_ARGS);
+/* pseudotypes.c */
+extern Datum record_in(PG_FUNCTION_ARGS);
+extern Datum record_out(PG_FUNCTION_ARGS);
+extern Datum cstring_in(PG_FUNCTION_ARGS);
+extern Datum cstring_out(PG_FUNCTION_ARGS);
+extern Datum any_in(PG_FUNCTION_ARGS);
+extern Datum any_out(PG_FUNCTION_ARGS);
+extern Datum anyarray_in(PG_FUNCTION_ARGS);
+extern Datum anyarray_out(PG_FUNCTION_ARGS);
+extern Datum void_in(PG_FUNCTION_ARGS);
+extern Datum void_out(PG_FUNCTION_ARGS);
+extern Datum trigger_in(PG_FUNCTION_ARGS);
+extern Datum trigger_out(PG_FUNCTION_ARGS);
+extern Datum language_handler_in(PG_FUNCTION_ARGS);
+extern Datum language_handler_out(PG_FUNCTION_ARGS);
+extern Datum internal_in(PG_FUNCTION_ARGS);
+extern Datum internal_out(PG_FUNCTION_ARGS);
+extern Datum opaque_in(PG_FUNCTION_ARGS);
+extern Datum opaque_out(PG_FUNCTION_ARGS);
+
/* regexp.c */
extern Datum nameregexeq(PG_FUNCTION_ARGS);
extern Datum nameregexne(PG_FUNCTION_ARGS);
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: lsyscache.h,v 1.57 2002/08/05 02:30:50 tgl Exp $
+ * $Id: lsyscache.h,v 1.58 2002/08/22 00:01:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern char get_typstorage(Oid typid);
extern Node *get_typdefault(Oid typid);
extern char get_typtype(Oid typid);
+extern bool getTypeOutputInfo(Oid type, Oid *typOutput, Oid *typElem,
+ bool *typIsVarlena);
extern Oid getBaseType(Oid typid);
extern Oid getBaseTypeTypeMod(Oid typid, int32 *typmod);
extern int32 get_typavgwidth(Oid typid, int32 typmod);
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.31 2002/06/15 19:54:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.32 2002/08/22 00:01:49 tgl Exp $
*
**********************************************************************/
{
free(prodesc->proname);
free(prodesc);
- if (!OidIsValid(procStruct->prorettype))
- elog(ERROR, "plperl functions cannot return type \"opaque\""
- "\n\texcept when used as triggers");
- else
- elog(ERROR, "plperl: cache lookup for return type %u failed",
- procStruct->prorettype);
+ elog(ERROR, "plperl: cache lookup for return type %u failed",
+ procStruct->prorettype);
}
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
+ /* Disallow pseudotype result, except VOID */
+ if (typeStruct->typtype == 'p')
+ {
+ if (procStruct->prorettype == VOIDOID)
+ /* okay */;
+ else if (procStruct->prorettype == TRIGGEROID ||
+ procStruct->prorettype == OPAQUEOID)
+ {
+ free(prodesc->proname);
+ free(prodesc);
+ elog(ERROR, "plperl functions cannot return type %s"
+ "\n\texcept when used as triggers",
+ format_type_be(procStruct->prorettype));
+ }
+ else
+ {
+ free(prodesc->proname);
+ free(prodesc);
+ elog(ERROR, "plperl functions cannot return type %s",
+ format_type_be(procStruct->prorettype));
+ }
+ }
+
if (typeStruct->typrelid != InvalidOid)
{
free(prodesc->proname);
{
free(prodesc->proname);
free(prodesc);
- if (!OidIsValid(procStruct->proargtypes[i]))
- elog(ERROR, "plperl functions cannot take type \"opaque\"");
- else
- elog(ERROR, "plperl: cache lookup for argument type %u failed",
- procStruct->proargtypes[i]);
+ elog(ERROR, "plperl: cache lookup for argument type %u failed",
+ procStruct->proargtypes[i]);
}
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
+ /* Disallow pseudotype argument */
+ if (typeStruct->typtype == 'p')
+ {
+ free(prodesc->proname);
+ free(prodesc);
+ elog(ERROR, "plperl functions cannot take type %s",
+ format_type_be(procStruct->proargtypes[i]));
+ }
+
if (typeStruct->typrelid != InvalidOid)
prodesc->arg_is_rel[i] = 1;
else
* procedural language
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.46 2002/08/15 16:36:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.47 2002/08/22 00:01:50 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
ObjectIdGetDatum(procStruct->prorettype),
0, 0, 0);
if (!HeapTupleIsValid(typeTup))
+ elog(ERROR, "cache lookup for return type %u failed",
+ procStruct->prorettype);
+ typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
+
+ /* Disallow pseudotype result, except VOID */
+ if (typeStruct->typtype == 'p')
{
- if (!OidIsValid(procStruct->prorettype))
- elog(ERROR, "plpgsql functions cannot return type \"opaque\""
- "\n\texcept when used as triggers");
+ if (procStruct->prorettype == VOIDOID)
+ /* okay */;
+ else if (procStruct->prorettype == TRIGGEROID ||
+ procStruct->prorettype == OPAQUEOID)
+ elog(ERROR, "plpgsql functions cannot return type %s"
+ "\n\texcept when used as triggers",
+ format_type_be(procStruct->prorettype));
else
- elog(ERROR, "cache lookup for return type %u failed",
- procStruct->prorettype);
+ elog(ERROR, "plpgsql functions cannot return type %s",
+ format_type_be(procStruct->prorettype));
}
- typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
+
if (typeStruct->typrelid != InvalidOid)
function->fn_retistuple = true;
else
ObjectIdGetDatum(procStruct->proargtypes[i]),
0, 0, 0);
if (!HeapTupleIsValid(typeTup))
- {
- if (!OidIsValid(procStruct->proargtypes[i]))
- elog(ERROR, "plpgsql functions cannot take type \"opaque\"");
- else
- elog(ERROR, "cache lookup for argument type %u failed",
- procStruct->proargtypes[i]);
- }
+ elog(ERROR, "cache lookup for argument type %u failed",
+ procStruct->proargtypes[i]);
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
+ /* Disallow pseudotype argument */
+ if (typeStruct->typtype == 'p')
+ elog(ERROR, "plpgsql functions cannot take type %s",
+ format_type_be(procStruct->proargtypes[i]));
+
if (typeStruct->typrelid != InvalidOid)
{
/*
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.19 2002/07/20 05:16:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.20 2002/08/22 00:01:50 tgl Exp $
*
*********************************************************************
*/
* this action. MODIFY means the tuple has been modified, so update
* tuple and perform action. SKIP and MODIFY assume the trigger fires
* BEFORE the event and is ROW level. postgres expects the function
- * to take no arguments and return an argument of type opaque.
+ * to take no arguments and return an argument of type trigger.
*/
HeapTuple
PLy_trigger_handler(FunctionCallInfo fcinfo, PLyProcedure * proc)
-- vigorously resisted all efforts at correction. they have
-- since gone bankrupt...
-CREATE FUNCTION users_insert() returns opaque
+CREATE FUNCTION users_insert() returns trigger
AS
'if TD["new"]["fname"] == None or TD["new"]["lname"] == None:
return "SKIP"
LANGUAGE 'plpython';
-CREATE FUNCTION users_update() returns opaque
+CREATE FUNCTION users_update() returns trigger
AS
'if TD["event"] == "UPDATE":
if TD["old"]["fname"] != TD["new"]["fname"] and TD["old"]["fname"] == TD["args"][0]:
LANGUAGE 'plpython';
-CREATE FUNCTION users_delete() RETURNS opaque
+CREATE FUNCTION users_delete() RETURNS trigger
AS
'if TD["old"]["fname"] == TD["args"][0]:
return "SKIP"
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.59 2002/07/20 05:16:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.60 2002/08/22 00:01:50 tgl Exp $
*
**********************************************************************/
{
free(prodesc->proname);
free(prodesc);
- if (!OidIsValid(procStruct->prorettype))
- elog(ERROR, "pltcl functions cannot return type \"opaque\""
- "\n\texcept when used as triggers");
- else
- elog(ERROR, "pltcl: cache lookup for return type %u failed",
- procStruct->prorettype);
+ elog(ERROR, "pltcl: cache lookup for return type %u failed",
+ procStruct->prorettype);
}
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
+ /* Disallow pseudotype result, except VOID */
+ if (typeStruct->typtype == 'p')
+ {
+ if (procStruct->prorettype == VOIDOID)
+ /* okay */;
+ else if (procStruct->prorettype == TRIGGEROID ||
+ procStruct->prorettype == OPAQUEOID)
+ {
+ free(prodesc->proname);
+ free(prodesc);
+ elog(ERROR, "pltcl functions cannot return type %s"
+ "\n\texcept when used as triggers",
+ format_type_be(procStruct->prorettype));
+ }
+ else
+ {
+ free(prodesc->proname);
+ free(prodesc);
+ elog(ERROR, "pltcl functions cannot return type %s",
+ format_type_be(procStruct->prorettype));
+ }
+ }
+
if (typeStruct->typrelid != InvalidOid)
{
free(prodesc->proname);
{
free(prodesc->proname);
free(prodesc);
- if (!OidIsValid(procStruct->proargtypes[i]))
- elog(ERROR, "pltcl functions cannot take type \"opaque\"");
- else
- elog(ERROR, "pltcl: cache lookup for argument type %u failed",
- procStruct->proargtypes[i]);
+ elog(ERROR, "pltcl: cache lookup for argument type %u failed",
+ procStruct->proargtypes[i]);
}
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
+ /* Disallow pseudotype argument */
+ if (typeStruct->typtype == 'p')
+ {
+ free(prodesc->proname);
+ free(prodesc);
+ elog(ERROR, "pltcl functions cannot take type %s",
+ format_type_be(procStruct->proargtypes[i]));
+ }
+
if (typeStruct->typrelid != InvalidOid)
{
prodesc->arg_is_rel[i] = 1;
--
-- Trigger function on every change to T_pkey1
--
-create function trig_pkey1_before() returns opaque as '
+create function trig_pkey1_before() returns trigger as '
#
# Create prepared plans on the first call
#
-- Trigger function to check for duplicate keys in T_pkey2
-- and to force key2 to be upper case only without leading whitespaces
--
-create function trig_pkey2_before() returns opaque as '
+create function trig_pkey2_before() returns trigger as '
#
# Prepare plan on first call
#
-- in T_pkey2 are done so the trigger for primkey check on T_dta2
-- fired on our updates will see the new key values in T_pkey2.
--
-create function trig_pkey2_after() returns opaque as '
+create function trig_pkey2_after() returns trigger as '
#
# Prepare plans on first call
#
--
-- Generic trigger function to check references in T_dta1 and T_dta2
--
-create function check_primkey() returns opaque as '
+create function check_primkey() returns trigger as '
#
# For every trigger/relation pair we create
# a saved plan and hold them in GD
e text
);
NOTICE: CREATE TABLE will create implicit sequence 'x_a_seq' for SERIAL column 'x.a'
-CREATE FUNCTION fn_x_before () RETURNS OPAQUE AS '
+CREATE FUNCTION fn_x_before () RETURNS TRIGGER AS '
BEGIN
NEW.e := ''before trigger fired''::text;
return NEW;
END;
' language 'plpgsql';
-CREATE FUNCTION fn_x_after () RETURNS OPAQUE AS '
+CREATE FUNCTION fn_x_after () RETURNS TRIGGER AS '
BEGIN
UPDATE x set e=''after trigger fired'' where c=''stuff'';
return NULL;
element = int4
);
-- Test type-related default values (broken in releases before PG 7.2)
+-- Make dummy I/O routines using the existing internal support for int4, text
+CREATE FUNCTION int42_in(cstring)
+ RETURNS int42
+ AS 'int4in'
+ LANGUAGE 'internal' WITH (isStrict);
+WARNING: ProcedureCreate: type int42 is not yet defined
+CREATE FUNCTION int42_out(int42)
+ RETURNS cstring
+ AS 'int4out'
+ LANGUAGE 'internal' WITH (isStrict);
+WARNING: Argument type "int42" is only a shell
+CREATE FUNCTION text_w_default_in(cstring)
+ RETURNS text_w_default
+ AS 'textin'
+ LANGUAGE 'internal' WITH (isStrict);
+WARNING: ProcedureCreate: type text_w_default is not yet defined
+CREATE FUNCTION text_w_default_out(text_w_default)
+ RETURNS cstring
+ AS 'textout'
+ LANGUAGE 'internal' WITH (isStrict);
+WARNING: Argument type "text_w_default" is only a shell
CREATE TYPE int42 (
internallength = 4,
- input = int4in,
- output = int4out,
+ input = int42_in,
+ output = int42_out,
alignment = int4,
default = 42,
passedbyvalue
);
CREATE TYPE text_w_default (
internallength = variable,
- input = textin,
- output = textout,
+ input = text_w_default_in,
+ output = text_w_default_out,
alignment = int4,
default = 'zippo'
);
-- that test creates some bogus operators...
-- **************** pg_proc ****************
-- Look for illegal values in pg_proc fields.
--- NOTE: currently there are a few pg_proc entries that have prorettype = 0.
--- Someday that ought to be cleaned up.
+-- NOTE: in reality pronargs could be more than 10, but I'm too lazy to put
+-- a larger number of proargtypes check clauses in here. If we ever have
+-- more-than-10-arg functions in the standard catalogs, extend this query.
SELECT p1.oid, p1.proname
FROM pg_proc as p1
-WHERE (p1.prolang = 0 OR p1.prorettype = 0 OR
- p1.pronargs < 0 OR p1.pronargs > 16)
- AND p1.proname !~ '^pl[^_]+_call_handler$'
- AND p1.proname !~ '^RI_FKey_'
- AND p1.proname !~ 'costestimate$'
- AND p1.proname != 'update_pg_pwd_and_pg_group';
+WHERE p1.prolang = 0 OR p1.prorettype = 0 OR
+ p1.pronargs < 0 OR p1.pronargs > 10 OR
+ (p1.proargtypes[0] = 0 AND p1.pronargs > 0) OR
+ (p1.proargtypes[1] = 0 AND p1.pronargs > 1) OR
+ (p1.proargtypes[2] = 0 AND p1.pronargs > 2) OR
+ (p1.proargtypes[3] = 0 AND p1.pronargs > 3) OR
+ (p1.proargtypes[4] = 0 AND p1.pronargs > 4) OR
+ (p1.proargtypes[5] = 0 AND p1.pronargs > 5) OR
+ (p1.proargtypes[6] = 0 AND p1.pronargs > 6) OR
+ (p1.proargtypes[7] = 0 AND p1.pronargs > 7) OR
+ (p1.proargtypes[8] = 0 AND p1.pronargs > 8) OR
+ (p1.proargtypes[9] = 0 AND p1.pronargs > 9);
oid | proname
-----+---------
(0 rows)
SELECT *
FROM pg_cast c
WHERE c.castfunc = 0 AND
- NOT EXISTS (SELECT * FROM pg_cast k
+ NOT EXISTS (SELECT 1 FROM pg_cast k
WHERE k.castfunc = 0 AND
k.castsource = c.casttarget AND
k.casttarget = c.castsource);
SELECT p1.oid, p1.oprname FROM pg_operator AS p1
WHERE p1.oprlsortop != 0 AND NOT
- EXISTS(SELECT * FROM pg_operator AS p2 WHERE
+ EXISTS(SELECT 1 FROM pg_operator AS p2 WHERE
p2.oprname = '<' AND
p2.oprleft = p1.oprleft AND
p2.oprright = p1.oprright AND
SELECT p1.oid, p1.oprname FROM pg_operator AS p1
WHERE p1.oprlsortop != 0 AND NOT
- EXISTS(SELECT * FROM pg_operator AS p2 WHERE
+ EXISTS(SELECT 1 FROM pg_operator AS p2 WHERE
p2.oprname = '>' AND
p2.oprleft = p1.oprleft AND
p2.oprright = p1.oprright AND
-- If oprrest is set, the operator must return boolean,
-- and it must link to a proc with the right signature
-- to be a restriction selectivity estimator.
--- The proc signature we want is: float8 proc(opaque, oid, opaque, int4)
+-- The proc signature we want is: float8 proc(internal, oid, internal, int4)
SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprrest = p2.oid AND
(p1.oprresult != 'bool'::regtype OR
p2.prorettype != 'float8'::regtype OR p2.proretset OR
p2.pronargs != 4 OR
- p2.proargtypes[0] != 0 OR p2.proargtypes[1] != 'oid'::regtype OR
- p2.proargtypes[2] != 0 OR p2.proargtypes[3] != 'int4'::regtype);
+ p2.proargtypes[0] != 'internal'::regtype OR
+ p2.proargtypes[1] != 'oid'::regtype OR
+ p2.proargtypes[2] != 'internal'::regtype OR
+ p2.proargtypes[3] != 'int4'::regtype);
oid | oprname | oid | proname
-----+---------+-----+---------
(0 rows)
-- If oprjoin is set, the operator must be a binary boolean op,
-- and it must link to a proc with the right signature
-- to be a join selectivity estimator.
--- The proc signature we want is: float8 proc(opaque, oid, opaque)
+-- The proc signature we want is: float8 proc(internal, oid, internal)
SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprjoin = p2.oid AND
(p1.oprkind != 'b' OR p1.oprresult != 'bool'::regtype OR
p2.prorettype != 'float8'::regtype OR p2.proretset OR
p2.pronargs != 3 OR
- p2.proargtypes[0] != 0 OR p2.proargtypes[1] != 'oid'::regtype OR
- p2.proargtypes[2] != 0);
+ p2.proargtypes[0] != 'internal'::regtype OR
+ p2.proargtypes[1] != 'oid'::regtype OR
+ p2.proargtypes[2] != 'internal'::regtype);
oid | oprname | oid | proname
-----+---------+-----+---------
(0 rows)
a.aggtranstype != p2.prorettype OR
a.aggtranstype != p2.proargtypes[0] OR
NOT ((p2.pronargs = 2 AND p.proargtypes[0] = p2.proargtypes[1]) OR
- (p2.pronargs = 1 AND p.proargtypes[0] = 0)));
+ (p2.pronargs = 1 AND p.proargtypes[0] = '"any"'::regtype)));
aggfnoid | proname | oid | proname
----------+---------+-----+-------------
2121 | max | 768 | int4larger
-- * AFTER UPDATE on Room
-- * - If room no changes let wall slots follow
-- ************************************************************
-create function tg_room_au() returns opaque as '
+create function tg_room_au() returns trigger as '
begin
if new.roomno != old.roomno then
update WSlot set roomno = new.roomno where roomno = old.roomno;
-- * AFTER DELETE on Room
-- * - delete wall slots in this room
-- ************************************************************
-create function tg_room_ad() returns opaque as '
+create function tg_room_ad() returns trigger as '
begin
delete from WSlot where roomno = old.roomno;
return old;
-- * BEFORE INSERT or UPDATE on WSlot
-- * - Check that room exists
-- ************************************************************
-create function tg_wslot_biu() returns opaque as '
+create function tg_wslot_biu() returns trigger as '
begin
if count(*) = 0 from Room where roomno = new.roomno then
raise exception ''Room % does not exist'', new.roomno;
-- * AFTER UPDATE on PField
-- * - Let PSlots of this field follow
-- ************************************************************
-create function tg_pfield_au() returns opaque as '
+create function tg_pfield_au() returns trigger as '
begin
if new.name != old.name then
update PSlot set pfname = new.name where pfname = old.name;
-- * AFTER DELETE on PField
-- * - Remove all slots of this patchfield
-- ************************************************************
-create function tg_pfield_ad() returns opaque as '
+create function tg_pfield_ad() returns trigger as '
begin
delete from PSlot where pfname = old.name;
return old;
-- * BEFORE INSERT or UPDATE on PSlot
-- * - Ensure that our patchfield does exist
-- ************************************************************
-create function tg_pslot_biu() returns opaque as '
+create function tg_pslot_biu() returns trigger as '
declare
pfrec record;
rename new to ps;
-- * AFTER UPDATE on System
-- * - If system name changes let interfaces follow
-- ************************************************************
-create function tg_system_au() returns opaque as '
+create function tg_system_au() returns trigger as '
begin
if new.name != old.name then
update IFace set sysname = new.name where sysname = old.name;
-- * BEFORE INSERT or UPDATE on IFace
-- * - set the slotname to IF.sysname.ifname
-- ************************************************************
-create function tg_iface_biu() returns opaque as '
+create function tg_iface_biu() returns trigger as '
declare
sname text;
sysrec record;
-- * AFTER INSERT or UPDATE or DELETE on Hub
-- * - insert/delete/rename slots as required
-- ************************************************************
-create function tg_hub_a() returns opaque as '
+create function tg_hub_a() returns trigger as '
declare
hname text;
dummy integer;
-- * - prevent from manual manipulation
-- * - set the slotname to HS.hubname.slotno
-- ************************************************************
-create function tg_hslot_biu() returns opaque as '
+create function tg_hslot_biu() returns trigger as '
declare
sname text;
xname HSlot.slotname%TYPE;
-- * BEFORE DELETE on HSlot
-- * - prevent from manual manipulation
-- ************************************************************
-create function tg_hslot_bd() returns opaque as '
+create function tg_hslot_bd() returns trigger as '
declare
hubrec record;
begin
-- * BEFORE INSERT on all slots
-- * - Check name prefix
-- ************************************************************
-create function tg_chkslotname() returns opaque as '
+create function tg_chkslotname() returns trigger as '
begin
if substr(new.slotname, 1, 2) != tg_argv[0] then
raise exception ''slotname must begin with %'', tg_argv[0];
-- * BEFORE INSERT or UPDATE on all slots with slotlink
-- * - Set slotlink to empty string if NULL value given
-- ************************************************************
-create function tg_chkslotlink() returns opaque as '
+create function tg_chkslotlink() returns trigger as '
begin
if new.slotlink isnull then
new.slotlink := '''';
-- * BEFORE INSERT or UPDATE on all slots with backlink
-- * - Set backlink to empty string if NULL value given
-- ************************************************************
-create function tg_chkbacklink() returns opaque as '
+create function tg_chkbacklink() returns trigger as '
begin
if new.backlink isnull then
new.backlink := '''';
-- * BEFORE UPDATE on PSlot
-- * - do delete/insert instead of update if name changes
-- ************************************************************
-create function tg_pslot_bu() returns opaque as '
+create function tg_pslot_bu() returns trigger as '
begin
if new.slotname != old.slotname then
delete from PSlot where slotname = old.slotname;
-- * BEFORE UPDATE on WSlot
-- * - do delete/insert instead of update if name changes
-- ************************************************************
-create function tg_wslot_bu() returns opaque as '
+create function tg_wslot_bu() returns trigger as '
begin
if new.slotname != old.slotname then
delete from WSlot where slotname = old.slotname;
-- * BEFORE UPDATE on PLine
-- * - do delete/insert instead of update if name changes
-- ************************************************************
-create function tg_pline_bu() returns opaque as '
+create function tg_pline_bu() returns trigger as '
begin
if new.slotname != old.slotname then
delete from PLine where slotname = old.slotname;
-- * BEFORE UPDATE on IFace
-- * - do delete/insert instead of update if name changes
-- ************************************************************
-create function tg_iface_bu() returns opaque as '
+create function tg_iface_bu() returns trigger as '
begin
if new.slotname != old.slotname then
delete from IFace where slotname = old.slotname;
-- * BEFORE UPDATE on HSlot
-- * - do delete/insert instead of update if name changes
-- ************************************************************
-create function tg_hslot_bu() returns opaque as '
+create function tg_hslot_bu() returns trigger as '
begin
if new.slotname != old.slotname or new.hubname != old.hubname then
delete from HSlot where slotname = old.slotname;
-- * BEFORE UPDATE on PHone
-- * - do delete/insert instead of update if name changes
-- ************************************************************
-create function tg_phone_bu() returns opaque as '
+create function tg_phone_bu() returns trigger as '
begin
if new.slotname != old.slotname then
delete from PHone where slotname = old.slotname;
-- * AFTER INSERT or UPDATE or DELETE on slot with backlink
-- * - Ensure that the opponent correctly points back to us
-- ************************************************************
-create function tg_backlink_a() returns opaque as '
+create function tg_backlink_a() returns trigger as '
declare
dummy integer;
begin
-- * AFTER INSERT or UPDATE or DELETE on slot with slotlink
-- * - Ensure that the opponent correctly points back to us
-- ************************************************************
-create function tg_slotlink_a() returns opaque as '
+create function tg_slotlink_a() returns trigger as '
declare
dummy integer;
begin
-- Look for illegal values in pg_type fields.
SELECT p1.oid, p1.typname
FROM pg_type as p1
-WHERE (p1.typlen <= 0 AND p1.typlen != -1) OR
- p1.typtype not in('b', 'c', 'd', 'p') OR
+WHERE p1.typnamespace = 0 OR
+ (p1.typlen <= 0 AND p1.typlen != -1) OR
+ (p1.typtype not in ('b', 'c', 'd', 'p')) OR
NOT p1.typisdefined OR
- (p1.typalign != 'c' AND p1.typalign != 's' AND
- p1.typalign != 'i' AND p1.typalign != 'd') OR
- (p1.typstorage != 'p' AND p1.typstorage != 'x' AND
- p1.typstorage != 'e' AND p1.typstorage != 'm');
+ (p1.typalign not in ('c', 's', 'i', 'd')) OR
+ (p1.typstorage not in ('p', 'x', 'e', 'm'));
oid | typname
-----+---------
(0 rows)
(0 rows)
-- Check for bogus typinput routines
--- FIXME: ought to check prorettype, but there are special cases that make it
--- hard: prorettype might be binary-compatible with the type but not the same,
--- and for array types array_in's result has nothing to do with anything.
SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2
-WHERE p1.typinput = p2.oid AND p1.typtype = 'b' AND
- (p2.pronargs != 1 OR p2.proretset) AND
- (p2.pronargs != 3 OR p2.proretset OR p2.proargtypes[2] != 'int4'::regtype);
+WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
+ ((p2.pronargs = 1 AND p2.proargtypes[0] = 'cstring'::regtype) OR
+ (p2.pronargs = 3 AND p2.proargtypes[0] = 'cstring'::regtype AND
+ p2.proargtypes[1] = 'oid'::regtype AND
+ p2.proargtypes[2] = 'int4'::regtype));
+ oid | typname | oid | proname
+-----+---------+-----+---------
+(0 rows)
+
+-- As of 7.3, this check finds SET and refcursor, which are borrowing
+-- other types' I/O routines
+SELECT p1.oid, p1.typname, p2.oid, p2.proname
+FROM pg_type AS p1, pg_proc AS p2
+WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
+ (p1.typelem != 0 AND p1.typlen < 0) AND NOT
+ (p2.prorettype = p1.oid AND NOT p2.proretset);
+ oid | typname | oid | proname
+------+-----------+-----+-----------
+ 32 | SET | 109 | unknownin
+ 1790 | refcursor | 46 | textin
+(2 rows)
+
+-- Varlena array types will point to array_in
+SELECT p1.oid, p1.typname, p2.oid, p2.proname
+FROM pg_type AS p1, pg_proc AS p2
+WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND
+ (p1.typelem != 0 AND p1.typlen < 0) AND NOT
+ (p2.oid = 'array_in'::regproc);
oid | typname | oid | proname
-----+---------+-----+---------
(0 rows)
-- Check for bogus typoutput routines
--- The first OR subclause detects bogus non-array cases,
--- the second one detects bogus array cases.
--- FIXME: ought to check prorettype, but not clear what it should be.
+-- As of 7.3, this check finds SET and refcursor, which are borrowing
+-- other types' I/O routines
+SELECT p1.oid, p1.typname, p2.oid, p2.proname
+FROM pg_type AS p1, pg_proc AS p2
+WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
+ ((p2.pronargs = 1 AND p2.proargtypes[0] = p1.oid) OR
+ (p2.oid = 'array_out'::regproc AND
+ p1.typelem != 0));
+ oid | typname | oid | proname
+------+-----------+-----+------------
+ 32 | SET | 110 | unknownout
+ 1790 | refcursor | 47 | textout
+(2 rows)
+
SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2
-WHERE p1.typoutput = p2.oid AND p1.typtype = 'b' AND
- (p2.pronargs != 1 OR p2.proretset) AND
- (p2.pronargs != 2 OR p2.proretset OR p1.typelem = 0);
+WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
+ (p2.prorettype = 'cstring'::regtype AND NOT p2.proretset);
oid | typname | oid | proname
-----+---------+-----+---------
(0 rows)
-- CREATE_FUNCTION_1
--
-CREATE FUNCTION widget_in(opaque)
+CREATE FUNCTION widget_in(cstring)
RETURNS widget
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
-CREATE FUNCTION widget_out(opaque)
- RETURNS opaque
+CREATE FUNCTION widget_out(widget)
+ RETURNS cstring
+ AS '@abs_builddir@/regress@DLSUFFIX@'
+ LANGUAGE 'c';
+
+CREATE FUNCTION int44in(cstring)
+ RETURNS city_budget
+ AS '@abs_builddir@/regress@DLSUFFIX@'
+ LANGUAGE 'c';
+
+CREATE FUNCTION int44out(city_budget)
+ RETURNS cstring
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
CREATE FUNCTION check_primary_key ()
- RETURNS opaque
+ RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION check_foreign_key ()
- RETURNS opaque
+ RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION autoinc ()
- RETURNS opaque
+ RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION funny_dup17 ()
- RETURNS opaque
+ RETURNS trigger
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION ttdummy ()
- RETURNS opaque
+ RETURNS trigger
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
--
-- CREATE_FUNCTION_1
--
-CREATE FUNCTION widget_in(opaque)
+CREATE FUNCTION widget_in(cstring)
RETURNS widget
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
WARNING: ProcedureCreate: type widget is not yet defined
-CREATE FUNCTION widget_out(opaque)
- RETURNS opaque
+CREATE FUNCTION widget_out(widget)
+ RETURNS cstring
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
+WARNING: Argument type "widget" is only a shell
+CREATE FUNCTION int44in(cstring)
+ RETURNS city_budget
+ AS '@abs_builddir@/regress@DLSUFFIX@'
+ LANGUAGE 'c';
+WARNING: ProcedureCreate: type city_budget is not yet defined
+CREATE FUNCTION int44out(city_budget)
+ RETURNS cstring
+ AS '@abs_builddir@/regress@DLSUFFIX@'
+ LANGUAGE 'c';
+WARNING: Argument type "city_budget" is only a shell
CREATE FUNCTION check_primary_key ()
- RETURNS opaque
+ RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION check_foreign_key ()
- RETURNS opaque
+ RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION autoinc ()
- RETURNS opaque
+ RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION funny_dup17 ()
- RETURNS opaque
+ RETURNS trigger
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION ttdummy ()
- RETURNS opaque
+ RETURNS trigger
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
CREATE FUNCTION set_ttdummy (int4)
/*
- * $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.50 2002/03/06 06:10:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.51 2002/08/22 00:01:51 tgl Exp $
*/
#include "postgres.h"
extern Datum boxarea(PG_FUNCTION_ARGS);
extern char *reverse_name(char *string);
extern int oldstyle_length(int n, text *t);
+extern Datum int44in(PG_FUNCTION_ARGS);
+extern Datum int44out(PG_FUNCTION_ARGS);
/*
** Distance from a point to a path
PG_RETURN_INT32(1);
}
+
+
+/*
+ * Type int44 has no real-world use, but the regression tests use it.
+ * It's a four-element vector of int4's.
+ */
+
+/*
+ * int44in - converts "num num ..." to internal form
+ *
+ * Note: Fills any missing positions with zeroes.
+ */
+PG_FUNCTION_INFO_V1(int44in);
+
+Datum
+int44in(PG_FUNCTION_ARGS)
+{
+ char *input_string = PG_GETARG_CSTRING(0);
+ int32 *result = (int32 *) palloc(4 * sizeof(int32));
+ int i;
+
+ i = sscanf(input_string,
+ "%d, %d, %d, %d",
+ &result[0],
+ &result[1],
+ &result[2],
+ &result[3]);
+ while (i < 4)
+ result[i++] = 0;
+
+ PG_RETURN_POINTER(result);
+}
+
+/*
+ * int44out - converts internal form to "num num ..."
+ */
+PG_FUNCTION_INFO_V1(int44out);
+
+Datum
+int44out(PG_FUNCTION_ARGS)
+{
+ int32 *an_array = (int32 *) PG_GETARG_POINTER(0);
+ char *result = (char *) palloc(16 * 4); /* Allow 14 digits +
+ * sign */
+ int i;
+ char *walk;
+
+ walk = result;
+ for (i = 0; i < 4; i++)
+ {
+ pg_ltoa(an_array[i], walk);
+ while (*++walk != '\0')
+ ;
+ *walk++ = ' ';
+ }
+ *--walk = '\0';
+ PG_RETURN_CSTRING(result);
+}
e text
);
-CREATE FUNCTION fn_x_before () RETURNS OPAQUE AS '
+CREATE FUNCTION fn_x_before () RETURNS TRIGGER AS '
BEGIN
NEW.e := ''before trigger fired''::text;
return NEW;
END;
' language 'plpgsql';
-CREATE FUNCTION fn_x_after () RETURNS OPAQUE AS '
+CREATE FUNCTION fn_x_after () RETURNS TRIGGER AS '
BEGIN
UPDATE x set e=''after trigger fired'' where c=''stuff'';
return NULL;
-- Test type-related default values (broken in releases before PG 7.2)
+-- Make dummy I/O routines using the existing internal support for int4, text
+CREATE FUNCTION int42_in(cstring)
+ RETURNS int42
+ AS 'int4in'
+ LANGUAGE 'internal' WITH (isStrict);
+CREATE FUNCTION int42_out(int42)
+ RETURNS cstring
+ AS 'int4out'
+ LANGUAGE 'internal' WITH (isStrict);
+CREATE FUNCTION text_w_default_in(cstring)
+ RETURNS text_w_default
+ AS 'textin'
+ LANGUAGE 'internal' WITH (isStrict);
+CREATE FUNCTION text_w_default_out(text_w_default)
+ RETURNS cstring
+ AS 'textout'
+ LANGUAGE 'internal' WITH (isStrict);
+
CREATE TYPE int42 (
internallength = 4,
- input = int4in,
- output = int4out,
+ input = int42_in,
+ output = int42_out,
alignment = int4,
default = 42,
passedbyvalue
CREATE TYPE text_w_default (
internallength = variable,
- input = textin,
- output = textout,
+ input = text_w_default_in,
+ output = text_w_default_out,
alignment = int4,
default = 'zippo'
);
DROP FUNCTION user_relns();
-DROP FUNCTION widget_in(opaque);
+DROP FUNCTION widget_in(cstring);
-DROP FUNCTION widget_out(opaque);
+DROP FUNCTION widget_out(widget);
DROP FUNCTION pt_in_widget(point,widget);
-- **************** pg_proc ****************
-- Look for illegal values in pg_proc fields.
--- NOTE: currently there are a few pg_proc entries that have prorettype = 0.
--- Someday that ought to be cleaned up.
+-- NOTE: in reality pronargs could be more than 10, but I'm too lazy to put
+-- a larger number of proargtypes check clauses in here. If we ever have
+-- more-than-10-arg functions in the standard catalogs, extend this query.
SELECT p1.oid, p1.proname
FROM pg_proc as p1
-WHERE (p1.prolang = 0 OR p1.prorettype = 0 OR
- p1.pronargs < 0 OR p1.pronargs > 16)
- AND p1.proname !~ '^pl[^_]+_call_handler$'
- AND p1.proname !~ '^RI_FKey_'
- AND p1.proname !~ 'costestimate$'
- AND p1.proname != 'update_pg_pwd_and_pg_group';
+WHERE p1.prolang = 0 OR p1.prorettype = 0 OR
+ p1.pronargs < 0 OR p1.pronargs > 10 OR
+ (p1.proargtypes[0] = 0 AND p1.pronargs > 0) OR
+ (p1.proargtypes[1] = 0 AND p1.pronargs > 1) OR
+ (p1.proargtypes[2] = 0 AND p1.pronargs > 2) OR
+ (p1.proargtypes[3] = 0 AND p1.pronargs > 3) OR
+ (p1.proargtypes[4] = 0 AND p1.pronargs > 4) OR
+ (p1.proargtypes[5] = 0 AND p1.pronargs > 5) OR
+ (p1.proargtypes[6] = 0 AND p1.pronargs > 6) OR
+ (p1.proargtypes[7] = 0 AND p1.pronargs > 7) OR
+ (p1.proargtypes[8] = 0 AND p1.pronargs > 8) OR
+ (p1.proargtypes[9] = 0 AND p1.pronargs > 9);
-- Look for conflicting proc definitions (same names and input datatypes).
-- (This test should be dead code now that we have the unique index
SELECT *
FROM pg_cast c
WHERE c.castfunc = 0 AND
- NOT EXISTS (SELECT * FROM pg_cast k
+ NOT EXISTS (SELECT 1 FROM pg_cast k
WHERE k.castfunc = 0 AND
k.castsource = c.casttarget AND
k.casttarget = c.castsource);
SELECT p1.oid, p1.oprname FROM pg_operator AS p1
WHERE p1.oprlsortop != 0 AND NOT
- EXISTS(SELECT * FROM pg_operator AS p2 WHERE
+ EXISTS(SELECT 1 FROM pg_operator AS p2 WHERE
p2.oprname = '<' AND
p2.oprleft = p1.oprleft AND
p2.oprright = p1.oprright AND
SELECT p1.oid, p1.oprname FROM pg_operator AS p1
WHERE p1.oprlsortop != 0 AND NOT
- EXISTS(SELECT * FROM pg_operator AS p2 WHERE
+ EXISTS(SELECT 1 FROM pg_operator AS p2 WHERE
p2.oprname = '>' AND
p2.oprleft = p1.oprleft AND
p2.oprright = p1.oprright AND
-- If oprrest is set, the operator must return boolean,
-- and it must link to a proc with the right signature
-- to be a restriction selectivity estimator.
--- The proc signature we want is: float8 proc(opaque, oid, opaque, int4)
+-- The proc signature we want is: float8 proc(internal, oid, internal, int4)
SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
(p1.oprresult != 'bool'::regtype OR
p2.prorettype != 'float8'::regtype OR p2.proretset OR
p2.pronargs != 4 OR
- p2.proargtypes[0] != 0 OR p2.proargtypes[1] != 'oid'::regtype OR
- p2.proargtypes[2] != 0 OR p2.proargtypes[3] != 'int4'::regtype);
+ p2.proargtypes[0] != 'internal'::regtype OR
+ p2.proargtypes[1] != 'oid'::regtype OR
+ p2.proargtypes[2] != 'internal'::regtype OR
+ p2.proargtypes[3] != 'int4'::regtype);
-- If oprjoin is set, the operator must be a binary boolean op,
-- and it must link to a proc with the right signature
-- to be a join selectivity estimator.
--- The proc signature we want is: float8 proc(opaque, oid, opaque)
+-- The proc signature we want is: float8 proc(internal, oid, internal)
SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
(p1.oprkind != 'b' OR p1.oprresult != 'bool'::regtype OR
p2.prorettype != 'float8'::regtype OR p2.proretset OR
p2.pronargs != 3 OR
- p2.proargtypes[0] != 0 OR p2.proargtypes[1] != 'oid'::regtype OR
- p2.proargtypes[2] != 0);
+ p2.proargtypes[0] != 'internal'::regtype OR
+ p2.proargtypes[1] != 'oid'::regtype OR
+ p2.proargtypes[2] != 'internal'::regtype);
-- **************** pg_aggregate ****************
a.aggtranstype != p2.prorettype OR
a.aggtranstype != p2.proargtypes[0] OR
NOT ((p2.pronargs = 2 AND p.proargtypes[0] = p2.proargtypes[1]) OR
- (p2.pronargs = 1 AND p.proargtypes[0] = 0)));
+ (p2.pronargs = 1 AND p.proargtypes[0] = '"any"'::regtype)));
-- Cross-check finalfn (if present) against its entry in pg_proc.
-- FIXME: what about binary-compatible types?
-- * AFTER UPDATE on Room
-- * - If room no changes let wall slots follow
-- ************************************************************
-create function tg_room_au() returns opaque as '
+create function tg_room_au() returns trigger as '
begin
if new.roomno != old.roomno then
update WSlot set roomno = new.roomno where roomno = old.roomno;
-- * AFTER DELETE on Room
-- * - delete wall slots in this room
-- ************************************************************
-create function tg_room_ad() returns opaque as '
+create function tg_room_ad() returns trigger as '
begin
delete from WSlot where roomno = old.roomno;
return old;
-- * BEFORE INSERT or UPDATE on WSlot
-- * - Check that room exists
-- ************************************************************
-create function tg_wslot_biu() returns opaque as '
+create function tg_wslot_biu() returns trigger as '
begin
if count(*) = 0 from Room where roomno = new.roomno then
raise exception ''Room % does not exist'', new.roomno;
-- * AFTER UPDATE on PField
-- * - Let PSlots of this field follow
-- ************************************************************
-create function tg_pfield_au() returns opaque as '
+create function tg_pfield_au() returns trigger as '
begin
if new.name != old.name then
update PSlot set pfname = new.name where pfname = old.name;
-- * AFTER DELETE on PField
-- * - Remove all slots of this patchfield
-- ************************************************************
-create function tg_pfield_ad() returns opaque as '
+create function tg_pfield_ad() returns trigger as '
begin
delete from PSlot where pfname = old.name;
return old;
-- * BEFORE INSERT or UPDATE on PSlot
-- * - Ensure that our patchfield does exist
-- ************************************************************
-create function tg_pslot_biu() returns opaque as '
+create function tg_pslot_biu() returns trigger as '
declare
pfrec record;
rename new to ps;
-- * AFTER UPDATE on System
-- * - If system name changes let interfaces follow
-- ************************************************************
-create function tg_system_au() returns opaque as '
+create function tg_system_au() returns trigger as '
begin
if new.name != old.name then
update IFace set sysname = new.name where sysname = old.name;
-- * BEFORE INSERT or UPDATE on IFace
-- * - set the slotname to IF.sysname.ifname
-- ************************************************************
-create function tg_iface_biu() returns opaque as '
+create function tg_iface_biu() returns trigger as '
declare
sname text;
sysrec record;
-- * AFTER INSERT or UPDATE or DELETE on Hub
-- * - insert/delete/rename slots as required
-- ************************************************************
-create function tg_hub_a() returns opaque as '
+create function tg_hub_a() returns trigger as '
declare
hname text;
dummy integer;
-- * - prevent from manual manipulation
-- * - set the slotname to HS.hubname.slotno
-- ************************************************************
-create function tg_hslot_biu() returns opaque as '
+create function tg_hslot_biu() returns trigger as '
declare
sname text;
xname HSlot.slotname%TYPE;
-- * BEFORE DELETE on HSlot
-- * - prevent from manual manipulation
-- ************************************************************
-create function tg_hslot_bd() returns opaque as '
+create function tg_hslot_bd() returns trigger as '
declare
hubrec record;
begin
-- * BEFORE INSERT on all slots
-- * - Check name prefix
-- ************************************************************
-create function tg_chkslotname() returns opaque as '
+create function tg_chkslotname() returns trigger as '
begin
if substr(new.slotname, 1, 2) != tg_argv[0] then
raise exception ''slotname must begin with %'', tg_argv[0];
-- * BEFORE INSERT or UPDATE on all slots with slotlink
-- * - Set slotlink to empty string if NULL value given
-- ************************************************************
-create function tg_chkslotlink() returns opaque as '
+create function tg_chkslotlink() returns trigger as '
begin
if new.slotlink isnull then
new.slotlink := '''';
-- * BEFORE INSERT or UPDATE on all slots with backlink
-- * - Set backlink to empty string if NULL value given
-- ************************************************************
-create function tg_chkbacklink() returns opaque as '
+create function tg_chkbacklink() returns trigger as '
begin
if new.backlink isnull then
new.backlink := '''';
-- * BEFORE UPDATE on PSlot
-- * - do delete/insert instead of update if name changes
-- ************************************************************
-create function tg_pslot_bu() returns opaque as '
+create function tg_pslot_bu() returns trigger as '
begin
if new.slotname != old.slotname then
delete from PSlot where slotname = old.slotname;
-- * BEFORE UPDATE on WSlot
-- * - do delete/insert instead of update if name changes
-- ************************************************************
-create function tg_wslot_bu() returns opaque as '
+create function tg_wslot_bu() returns trigger as '
begin
if new.slotname != old.slotname then
delete from WSlot where slotname = old.slotname;
-- * BEFORE UPDATE on PLine
-- * - do delete/insert instead of update if name changes
-- ************************************************************
-create function tg_pline_bu() returns opaque as '
+create function tg_pline_bu() returns trigger as '
begin
if new.slotname != old.slotname then
delete from PLine where slotname = old.slotname;
-- * BEFORE UPDATE on IFace
-- * - do delete/insert instead of update if name changes
-- ************************************************************
-create function tg_iface_bu() returns opaque as '
+create function tg_iface_bu() returns trigger as '
begin
if new.slotname != old.slotname then
delete from IFace where slotname = old.slotname;
-- * BEFORE UPDATE on HSlot
-- * - do delete/insert instead of update if name changes
-- ************************************************************
-create function tg_hslot_bu() returns opaque as '
+create function tg_hslot_bu() returns trigger as '
begin
if new.slotname != old.slotname or new.hubname != old.hubname then
delete from HSlot where slotname = old.slotname;
-- * BEFORE UPDATE on PHone
-- * - do delete/insert instead of update if name changes
-- ************************************************************
-create function tg_phone_bu() returns opaque as '
+create function tg_phone_bu() returns trigger as '
begin
if new.slotname != old.slotname then
delete from PHone where slotname = old.slotname;
-- * AFTER INSERT or UPDATE or DELETE on slot with backlink
-- * - Ensure that the opponent correctly points back to us
-- ************************************************************
-create function tg_backlink_a() returns opaque as '
+create function tg_backlink_a() returns trigger as '
declare
dummy integer;
begin
-- * AFTER INSERT or UPDATE or DELETE on slot with slotlink
-- * - Ensure that the opponent correctly points back to us
-- ************************************************************
-create function tg_slotlink_a() returns opaque as '
+create function tg_slotlink_a() returns trigger as '
declare
dummy integer;
begin
SELECT p1.oid, p1.typname
FROM pg_type as p1
-WHERE (p1.typlen <= 0 AND p1.typlen != -1) OR
- p1.typtype not in('b', 'c', 'd', 'p') OR
+WHERE p1.typnamespace = 0 OR
+ (p1.typlen <= 0 AND p1.typlen != -1) OR
+ (p1.typtype not in ('b', 'c', 'd', 'p')) OR
NOT p1.typisdefined OR
- (p1.typalign != 'c' AND p1.typalign != 's' AND
- p1.typalign != 'i' AND p1.typalign != 'd') OR
- (p1.typstorage != 'p' AND p1.typstorage != 'x' AND
- p1.typstorage != 'e' AND p1.typstorage != 'm');
+ (p1.typalign not in ('c', 's', 'i', 'd')) OR
+ (p1.typstorage not in ('p', 'x', 'e', 'm'));
-- Look for "pass by value" types that can't be passed by value.
(p1.typinput = 0 OR p1.typoutput = 0);
-- Check for bogus typinput routines
--- FIXME: ought to check prorettype, but there are special cases that make it
--- hard: prorettype might be binary-compatible with the type but not the same,
--- and for array types array_in's result has nothing to do with anything.
SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2
-WHERE p1.typinput = p2.oid AND p1.typtype = 'b' AND
- (p2.pronargs != 1 OR p2.proretset) AND
- (p2.pronargs != 3 OR p2.proretset OR p2.proargtypes[2] != 'int4'::regtype);
+WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
+ ((p2.pronargs = 1 AND p2.proargtypes[0] = 'cstring'::regtype) OR
+ (p2.pronargs = 3 AND p2.proargtypes[0] = 'cstring'::regtype AND
+ p2.proargtypes[1] = 'oid'::regtype AND
+ p2.proargtypes[2] = 'int4'::regtype));
+
+-- As of 7.3, this check finds SET and refcursor, which are borrowing
+-- other types' I/O routines
+SELECT p1.oid, p1.typname, p2.oid, p2.proname
+FROM pg_type AS p1, pg_proc AS p2
+WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
+ (p1.typelem != 0 AND p1.typlen < 0) AND NOT
+ (p2.prorettype = p1.oid AND NOT p2.proretset);
+
+-- Varlena array types will point to array_in
+SELECT p1.oid, p1.typname, p2.oid, p2.proname
+FROM pg_type AS p1, pg_proc AS p2
+WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND
+ (p1.typelem != 0 AND p1.typlen < 0) AND NOT
+ (p2.oid = 'array_in'::regproc);
-- Check for bogus typoutput routines
--- The first OR subclause detects bogus non-array cases,
--- the second one detects bogus array cases.
--- FIXME: ought to check prorettype, but not clear what it should be.
+
+-- As of 7.3, this check finds SET and refcursor, which are borrowing
+-- other types' I/O routines
+SELECT p1.oid, p1.typname, p2.oid, p2.proname
+FROM pg_type AS p1, pg_proc AS p2
+WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
+ ((p2.pronargs = 1 AND p2.proargtypes[0] = p1.oid) OR
+ (p2.oid = 'array_out'::regproc AND
+ p1.typelem != 0));
SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2
-WHERE p1.typoutput = p2.oid AND p1.typtype = 'b' AND
- (p2.pronargs != 1 OR p2.proretset) AND
- (p2.pronargs != 2 OR p2.proretset OR p1.typelem = 0);
+WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT
+ (p2.prorettype = 'cstring'::regtype AND NOT p2.proretset);
-- **************** pg_class ****************
return result;
}
-/*
- * You might have noticed a slight inconsistency between the following
- * declaration and the SQL definition:
- * CREATE FUNCTION complex_out(opaque) RETURNS opaque ...
- * The reason is that the argument pass into complex_out is really just a
- * pointer. POSTGRES thinks all output functions are:
- * char *out_func(char *);
- */
char *
complex_out(Complex * complex)
{
if (complex == NULL)
return NULL;
- result = (char *) palloc(60);
- sprintf(result, "(%g,%g)", complex->x, complex->y);
+ result = (char *) palloc(100);
+ snprintf(result, 100, "(%g,%g)", complex->x, complex->y);
return result;
}
-- Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
-- Portions Copyright (c) 1994, Regents of the University of California
--
--- $Header: /cvsroot/pgsql/src/tutorial/complex.source,v 1.13 2002/07/30 05:24:56 tgl Exp $
+-- $Header: /cvsroot/pgsql/src/tutorial/complex.source,v 1.14 2002/08/22 00:01:51 tgl Exp $
--
---------------------------------------------------------------------------
-- (in memory) representation. You will get a message telling you 'complex'
-- does not exist yet but that's okay.
-CREATE FUNCTION complex_in(opaque)
+CREATE FUNCTION complex_in(cstring)
RETURNS complex
AS '_OBJWD_/complex'
LANGUAGE 'c';
-- the output function 'complex_out' takes the internal representation and
-- converts it into the textual representation.
-CREATE FUNCTION complex_out(opaque)
- RETURNS opaque
+CREATE FUNCTION complex_out(complex)
+ RETURNS cstring
AS '_OBJWD_/complex'
LANGUAGE 'c';
-- clean up the example
DROP TABLE test_complex;
DROP TYPE complex CASCADE;
-DROP FUNCTION complex_out(opaque);