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>
<literal>TRIGGER</literal> privilege on the table.
</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
<!--
-$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 "&