Clean up CREATE FUNCTION syntax usage in contrib and elsewhere, in

particular get rid of single quotes around language names and old WITH ()
construct.
This commit is contained in:
Peter Eisentraut 2006-02-27 16:09:50 +00:00
parent fe83b3ebc6
commit 7f4f42fa10
65 changed files with 967 additions and 976 deletions

View File

@ -4,12 +4,12 @@ SET search_path = public;
CREATE FUNCTION gbtreekey4_in(cstring)
RETURNS gbtreekey4
AS 'MODULE_PATHNAME', 'gbtreekey_in'
LANGUAGE 'c' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbtreekey4_out(gbtreekey4)
RETURNS cstring
AS 'MODULE_PATHNAME', 'gbtreekey_out'
LANGUAGE 'c' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE gbtreekey4 (
INTERNALLENGTH = 4,
@ -20,12 +20,12 @@ OUTPUT = gbtreekey4_out
CREATE FUNCTION gbtreekey8_in(cstring)
RETURNS gbtreekey8
AS 'MODULE_PATHNAME', 'gbtreekey_in'
LANGUAGE 'c' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbtreekey8_out(gbtreekey8)
RETURNS cstring
AS 'MODULE_PATHNAME', 'gbtreekey_out'
LANGUAGE 'c' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE gbtreekey8 (
INTERNALLENGTH = 8,
@ -36,12 +36,12 @@ OUTPUT = gbtreekey8_out
CREATE FUNCTION gbtreekey16_in(cstring)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME', 'gbtreekey_in'
LANGUAGE 'c' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbtreekey16_out(gbtreekey16)
RETURNS cstring
AS 'MODULE_PATHNAME', 'gbtreekey_out'
LANGUAGE 'c' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE gbtreekey16 (
INTERNALLENGTH = 16,
@ -52,12 +52,12 @@ OUTPUT = gbtreekey16_out
CREATE FUNCTION gbtreekey32_in(cstring)
RETURNS gbtreekey32
AS 'MODULE_PATHNAME', 'gbtreekey_in'
LANGUAGE 'c' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbtreekey32_out(gbtreekey32)
RETURNS cstring
AS 'MODULE_PATHNAME', 'gbtreekey_out'
LANGUAGE 'c' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE gbtreekey32 (
INTERNALLENGTH = 32,
@ -68,12 +68,12 @@ OUTPUT = gbtreekey32_out
CREATE FUNCTION gbtreekey_var_in(cstring)
RETURNS gbtreekey_var
AS 'MODULE_PATHNAME', 'gbtreekey_in'
LANGUAGE 'c' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbtreekey_var_out(gbtreekey_var)
RETURNS cstring
AS 'MODULE_PATHNAME', 'gbtreekey_out'
LANGUAGE 'c' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE gbtreekey_var (
INTERNALLENGTH = VARIABLE,
@ -95,42 +95,42 @@ STORAGE = EXTENDED
CREATE FUNCTION gbt_oid_consistent(internal,oid,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_oid_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_var_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_oid_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_oid_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_oid_union(bytea, internal)
RETURNS gbtreekey8
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_oid_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_oid_ops
@ -162,32 +162,32 @@ AS
CREATE FUNCTION gbt_int2_consistent(internal,int2,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_int2_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_int2_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_int2_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_int2_union(bytea, internal)
RETURNS gbtreekey4
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_int2_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_int2_ops
@ -218,32 +218,32 @@ AS
CREATE FUNCTION gbt_int4_consistent(internal,int4,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_int4_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_int4_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_int4_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_int4_union(bytea, internal)
RETURNS gbtreekey8
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_int4_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_int4_ops
@ -274,32 +274,32 @@ AS
CREATE FUNCTION gbt_int8_consistent(internal,int8,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_int8_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_int8_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_int8_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_int8_union(bytea, internal)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_int8_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_int8_ops
@ -331,32 +331,32 @@ AS
CREATE FUNCTION gbt_float4_consistent(internal,float4,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_float4_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_float4_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_float4_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_float4_union(bytea, internal)
RETURNS gbtreekey8
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_float4_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_float4_ops
@ -390,32 +390,32 @@ AS
CREATE FUNCTION gbt_float8_consistent(internal,float8,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_float8_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_float8_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_float8_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_float8_union(bytea, internal)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_float8_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_float8_ops
@ -447,42 +447,42 @@ AS
CREATE FUNCTION gbt_ts_consistent(internal,timestamp,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_tstz_consistent(internal,timestamptz,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_ts_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_tstz_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_ts_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_ts_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_ts_union(bytea, internal)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_ts_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_timestamp_ops
@ -533,42 +533,42 @@ AS
CREATE FUNCTION gbt_time_consistent(internal,time,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_timetz_consistent(internal,timetz,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_time_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_timetz_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_time_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_time_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_time_union(bytea, internal)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_time_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_time_ops
@ -617,32 +617,32 @@ AS
CREATE FUNCTION gbt_date_consistent(internal,date,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_date_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_date_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_date_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_date_union(bytea, internal)
RETURNS gbtreekey8
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_date_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_date_ops
@ -674,37 +674,37 @@ AS
CREATE FUNCTION gbt_intv_consistent(internal,interval,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_intv_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_intv_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_intv_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_intv_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_intv_union(bytea, internal)
RETURNS gbtreekey32
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_intv_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_interval_ops
@ -735,32 +735,32 @@ AS
CREATE FUNCTION gbt_cash_consistent(internal,money,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_cash_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_cash_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_cash_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_cash_union(bytea, internal)
RETURNS gbtreekey8
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_cash_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_cash_ops
@ -791,32 +791,32 @@ AS
CREATE FUNCTION gbt_macad_consistent(internal,macaddr,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_macad_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_macad_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_macad_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_macad_union(bytea, internal)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_macad_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_macaddr_ops
@ -849,42 +849,42 @@ AS
CREATE FUNCTION gbt_text_consistent(internal,text,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_bpchar_consistent(internal,bpchar,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_text_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_bpchar_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_text_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_text_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_text_union(bytea, internal)
RETURNS gbtreekey_var
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_text_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_text_ops
@ -935,32 +935,32 @@ AS
CREATE FUNCTION gbt_bytea_consistent(internal,bytea,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_bytea_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_bytea_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_bytea_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_bytea_union(bytea, internal)
RETURNS gbtreekey_var
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_bytea_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_bytea_ops
@ -992,32 +992,32 @@ AS
CREATE FUNCTION gbt_numeric_consistent(internal,numeric,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_numeric_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_numeric_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_numeric_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_numeric_union(bytea, internal)
RETURNS gbtreekey_var
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_numeric_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_numeric_ops
@ -1047,32 +1047,32 @@ AS
CREATE FUNCTION gbt_bit_consistent(internal,bit,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_bit_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_bit_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_bit_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_bit_union(bytea, internal)
RETURNS gbtreekey_var
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_bit_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_bit_ops
@ -1124,32 +1124,32 @@ AS
CREATE FUNCTION gbt_inet_consistent(internal,inet,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_inet_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_inet_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gbt_inet_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_inet_union(bytea, internal)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gbt_inet_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class
CREATE OPERATOR CLASS gist_inet_ops

View File

@ -7,12 +7,12 @@ SET search_path = public;
CREATE OR REPLACE FUNCTION cube_in(cstring)
RETURNS cube
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION cube_out(cube)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE TYPE cube (
INTERNALLENGTH = variable,
@ -27,7 +27,7 @@ COMMENT ON TYPE cube IS 'multi-dimensional cube ''(FLOAT-1, FLOAT-2, ..., FLOAT-
CREATE OR REPLACE FUNCTION cube(text) RETURNS cube
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION cube(text) IS 'convert text to cube';
@ -42,70 +42,70 @@ CREATE CAST (text AS cube) WITH FUNCTION cube(text) AS ASSIGNMENT;
CREATE OR REPLACE FUNCTION cube_eq(cube, cube)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION cube_eq(cube, cube) IS 'same as';
CREATE OR REPLACE FUNCTION cube_ne(cube, cube)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION cube_ne(cube, cube) IS 'different';
CREATE OR REPLACE FUNCTION cube_lt(cube, cube)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION cube_lt(cube, cube) IS 'lower than';
CREATE OR REPLACE FUNCTION cube_gt(cube, cube)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION cube_gt(cube, cube) IS 'greater than';
CREATE OR REPLACE FUNCTION cube_le(cube, cube)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION cube_le(cube, cube) IS 'lower than or equal to';
CREATE OR REPLACE FUNCTION cube_ge(cube, cube)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION cube_ge(cube, cube) IS 'greater than or equal to';
CREATE OR REPLACE FUNCTION cube_cmp(cube, cube)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION cube_cmp(cube, cube) IS 'btree comparison function';
CREATE OR REPLACE FUNCTION cube_contains(cube, cube)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION cube_contains(cube, cube) IS 'contains';
CREATE OR REPLACE FUNCTION cube_contained(cube, cube)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION cube_contained(cube, cube) IS 'contained in';
CREATE OR REPLACE FUNCTION cube_overlap(cube, cube)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
COMMENT ON FUNCTION cube_overlap(cube, cube) IS 'overlaps';
@ -114,17 +114,17 @@ COMMENT ON FUNCTION cube_overlap(cube, cube) IS 'overlaps';
CREATE OR REPLACE FUNCTION cube_union(cube, cube)
RETURNS cube
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION cube_inter(cube, cube)
RETURNS cube
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION cube_size(cube)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
-- Misc N-dimensional functions
@ -134,54 +134,54 @@ LANGUAGE 'C' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION cube_distance(cube, cube)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
-- Extracting elements functions
CREATE OR REPLACE FUNCTION cube_dim(cube)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION cube_ll_coord(cube, int4)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION cube_ur_coord(cube, int4)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION cube(float8) RETURNS cube
AS 'MODULE_PATHNAME', 'cube_f8'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION cube(float8, float8) RETURNS cube
AS 'MODULE_PATHNAME', 'cube_f8_f8'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION cube(cube, float8) RETURNS cube
AS 'MODULE_PATHNAME', 'cube_c_f8'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION cube(cube, float8, float8) RETURNS cube
AS 'MODULE_PATHNAME', 'cube_c_f8_f8'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
-- Test if cube is also a point
CREATE OR REPLACE FUNCTION cube_is_point(cube)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
-- Increasing the size of a cube by a radius in at least n dimensions
CREATE OR REPLACE FUNCTION cube_enlarge(cube, float8, int4)
RETURNS cube
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
--
-- OPERATORS
@ -247,37 +247,37 @@ CREATE OPERATOR ~ (
CREATE OR REPLACE FUNCTION g_cube_consistent(internal,cube,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE OR REPLACE FUNCTION g_cube_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE OR REPLACE FUNCTION g_cube_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE OR REPLACE FUNCTION g_cube_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION g_cube_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE OR REPLACE FUNCTION g_cube_union(internal, internal)
RETURNS cube
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE OR REPLACE FUNCTION g_cube_same(cube, cube, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator classes for indexing

View File

@ -1,146 +1,146 @@
CREATE OR REPLACE FUNCTION dblink_connect (text)
RETURNS text
AS 'MODULE_PATHNAME','dblink_connect'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_connect (text, text)
RETURNS text
AS 'MODULE_PATHNAME','dblink_connect'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_disconnect ()
RETURNS text
AS 'MODULE_PATHNAME','dblink_disconnect'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_disconnect (text)
RETURNS text
AS 'MODULE_PATHNAME','dblink_disconnect'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_open (text,text)
CREATE OR REPLACE FUNCTION dblink_open (text, text)
RETURNS text
AS 'MODULE_PATHNAME','dblink_open'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_open (text,text,bool)
CREATE OR REPLACE FUNCTION dblink_open (text, text, boolean)
RETURNS text
AS 'MODULE_PATHNAME','dblink_open'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_open (text,text,text)
CREATE OR REPLACE FUNCTION dblink_open (text, text, text)
RETURNS text
AS 'MODULE_PATHNAME','dblink_open'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_open (text,text,text,bool)
CREATE OR REPLACE FUNCTION dblink_open (text, text, text, boolean)
RETURNS text
AS 'MODULE_PATHNAME','dblink_open'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_fetch (text,int)
CREATE OR REPLACE FUNCTION dblink_fetch (text, int)
RETURNS setof record
AS 'MODULE_PATHNAME','dblink_fetch'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_fetch (text,int,bool)
CREATE OR REPLACE FUNCTION dblink_fetch (text, int, boolean)
RETURNS setof record
AS 'MODULE_PATHNAME','dblink_fetch'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_fetch (text,text,int)
CREATE OR REPLACE FUNCTION dblink_fetch (text, text, int)
RETURNS setof record
AS 'MODULE_PATHNAME','dblink_fetch'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_fetch (text,text,int,bool)
CREATE OR REPLACE FUNCTION dblink_fetch (text, text, int, boolean)
RETURNS setof record
AS 'MODULE_PATHNAME','dblink_fetch'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_close (text)
RETURNS text
AS 'MODULE_PATHNAME','dblink_close'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_close (text,bool)
CREATE OR REPLACE FUNCTION dblink_close (text, boolean)
RETURNS text
AS 'MODULE_PATHNAME','dblink_close'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_close (text,text)
CREATE OR REPLACE FUNCTION dblink_close (text, text)
RETURNS text
AS 'MODULE_PATHNAME','dblink_close'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_close (text,text,bool)
CREATE OR REPLACE FUNCTION dblink_close (text, text, boolean)
RETURNS text
AS 'MODULE_PATHNAME','dblink_close'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink (text,text)
CREATE OR REPLACE FUNCTION dblink (text, text)
RETURNS setof record
AS 'MODULE_PATHNAME','dblink_record'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink (text,text,bool)
CREATE OR REPLACE FUNCTION dblink (text, text, boolean)
RETURNS setof record
AS 'MODULE_PATHNAME','dblink_record'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink (text)
RETURNS setof record
AS 'MODULE_PATHNAME','dblink_record'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink (text,bool)
CREATE OR REPLACE FUNCTION dblink (text, boolean)
RETURNS setof record
AS 'MODULE_PATHNAME','dblink_record'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_exec (text,text)
CREATE OR REPLACE FUNCTION dblink_exec (text, text)
RETURNS text
AS 'MODULE_PATHNAME','dblink_exec'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_exec (text,text,bool)
CREATE OR REPLACE FUNCTION dblink_exec (text, text, boolean)
RETURNS text
AS 'MODULE_PATHNAME','dblink_exec'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_exec (text)
RETURNS text
AS 'MODULE_PATHNAME','dblink_exec'
LANGUAGE 'c' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_exec (text,bool)
CREATE OR REPLACE FUNCTION dblink_exec (text,boolean)
RETURNS text
AS 'MODULE_PATHNAME','dblink_exec'
LANGUAGE 'c' STRICT;
LANGUAGE C STRICT;
CREATE TYPE dblink_pkey_results AS (position int4, colname text);
CREATE TYPE dblink_pkey_results AS (position int, colname text);
CREATE OR REPLACE FUNCTION dblink_get_pkey (text)
RETURNS setof dblink_pkey_results
AS 'MODULE_PATHNAME','dblink_get_pkey'
LANGUAGE 'c' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_build_sql_insert (text, int2vector, int4, _text, _text)
CREATE OR REPLACE FUNCTION dblink_build_sql_insert (text, int2vector, int, _text, _text)
RETURNS text
AS 'MODULE_PATHNAME','dblink_build_sql_insert'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_build_sql_delete (text, int2vector, int4, _text)
CREATE OR REPLACE FUNCTION dblink_build_sql_delete (text, int2vector, int, _text)
RETURNS text
AS 'MODULE_PATHNAME','dblink_build_sql_delete'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_build_sql_update (text, int2vector, int4, _text, _text)
CREATE OR REPLACE FUNCTION dblink_build_sql_update (text, int2vector, int, _text, _text)
RETURNS text
AS 'MODULE_PATHNAME','dblink_build_sql_update'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION dblink_current_query ()
RETURNS text
AS 'MODULE_PATHNAME','dblink_current_query'
LANGUAGE 'C';
LANGUAGE C;

View File

@ -1,62 +1,54 @@
BEGIN;
CREATE FUNCTION "recordchange" () RETURNS trigger AS
'$libdir/pending', 'recordchange' LANGUAGE 'C';
CREATE FUNCTION "recordchange" () RETURNS trigger
AS '$libdir/pending', 'recordchange'
LANGUAGE C;
CREATE TABLE dbmirror_MirrorHost (
MirrorHostId serial not null,
SlaveName varchar NOT NULL,
PRIMARY KEY(MirrorHostId)
MirrorHostId serial PRIMARY KEY,
SlaveName varchar NOT NULL
);
CREATE TABLE dbmirror_Pending (
SeqId serial,
TableName Name NOT NULL,
Op character,
XID int4 NOT NULL,
PRIMARY KEY (SeqId)
SeqId serial PRIMARY KEY,
TableName name NOT NULL,
Op character,
XID integer NOT NULL
);
CREATE INDEX dbmirror_Pending_XID_Index ON dbmirror_Pending (XID);
CREATE TABLE dbmirror_PendingData (
SeqId int4 NOT NULL,
IsKey bool NOT NULL,
Data varchar,
PRIMARY KEY (SeqId, IsKey) ,
FOREIGN KEY (SeqId) REFERENCES dbmirror_Pending (SeqId) ON UPDATE CASCADE ON DELETE CASCADE
SeqId integer NOT NULL,
IsKey boolean NOT NULL,
Data varchar,
PRIMARY KEY (SeqId, IsKey) ,
FOREIGN KEY (SeqId) REFERENCES dbmirror_Pending (SeqId) ON UPDATE CASCADE ON DELETE CASCADE
);
CREATE TABLE dbmirror_MirroredTransaction (
XID int4 NOT NULL,
LastSeqId int4 NOT NULL,
MirrorHostId int4 NOT NULL,
PRIMARY KEY (XID,MirrorHostId),
FOREIGN KEY (MirrorHostId) REFERENCES dbmirror_MirrorHost (MirrorHostId) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (LastSeqId) REFERENCES dbmirror_Pending (SeqId) ON UPDATE
CASCADE ON DELETE CASCADE
XID integer NOT NULL,
LastSeqId integer NOT NULL,
MirrorHostId integer NOT NULL,
PRIMARY KEY (XID, MirrorHostId),
FOREIGN KEY (MirrorHostId) REFERENCES dbmirror_MirrorHost (MirrorHostId) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (LastSeqId) REFERENCES dbmirror_Pending (SeqId) ON UPDATE CASCADE ON DELETE CASCADE
);
UPDATE pg_proc SET proname='nextval_pg' WHERE proname='nextval';
CREATE FUNCTION pg_catalog.nextval(regclass) RETURNS int8 AS
'$libdir/pending', 'nextval_mirror' LANGUAGE 'C' STRICT;
CREATE FUNCTION pg_catalog.nextval(regclass) RETURNS bigint
AS '$libdir/pending', 'nextval_mirror'
LANGUAGE C STRICT;
UPDATE pg_proc set proname='setval_pg' WHERE proname='setval';
CREATE FUNCTION pg_catalog.setval(regclass, int8, boolean) RETURNS int8 AS
'$libdir/pending', 'setval3_mirror' LANGUAGE 'C' STRICT;
CREATE FUNCTION pg_catalog.setval(regclass, int8) RETURNS int8 AS
'$libdir/pending', 'setval_mirror' LANGUAGE 'C' STRICT;
CREATE FUNCTION pg_catalog.setval(regclass, bigint, boolean) RETURNS bigint
AS '$libdir/pending', 'setval3_mirror'
LANGUAGE C STRICT;
CREATE FUNCTION pg_catalog.setval(regclass, bigint) RETURNS bigint
AS '$libdir/pending', 'setval_mirror'
LANGUAGE C STRICT;
COMMIT;

View File

@ -8,7 +8,7 @@ SET search_path = public;
-- in order to use different units (or a better value for the Earth's radius).
CREATE OR REPLACE FUNCTION earth() RETURNS float8
LANGUAGE 'sql' IMMUTABLE
LANGUAGE SQL IMMUTABLE
AS 'SELECT \'6378168\'::float8';
-- Astromers may want to change the earth function so that distances will be
@ -17,7 +17,7 @@ AS 'SELECT \'6378168\'::float8';
-- tests.
--
-- CREATE OR REPLACE FUNCTION earth() RETURNS float8
-- LANGUAGE 'sql' IMMUTABLE
-- LANGUAGE SQL IMMUTABLE
-- AS 'SELECT 180/pi()';
-- Define domain for locations on the surface of the earth using a cube
@ -35,43 +35,43 @@ CREATE DOMAIN earth AS cube
CREATE OR REPLACE FUNCTION sec_to_gc(float8)
RETURNS float8
LANGUAGE 'sql'
LANGUAGE SQL
IMMUTABLE STRICT
AS 'SELECT CASE WHEN $1 < 0 THEN 0::float8 WHEN $1/(2*earth()) > 1 THEN pi()*earth() ELSE 2*earth()*asin($1/(2*earth())) END';
CREATE OR REPLACE FUNCTION gc_to_sec(float8)
RETURNS float8
LANGUAGE 'sql'
LANGUAGE SQL
IMMUTABLE STRICT
AS 'SELECT CASE WHEN $1 < 0 THEN 0::float8 WHEN $1/earth() > pi() THEN 2*earth() ELSE 2*earth()*sin($1/(2*earth())) END';
CREATE OR REPLACE FUNCTION ll_to_earth(float8, float8)
RETURNS earth
LANGUAGE 'sql'
LANGUAGE SQL
IMMUTABLE STRICT
AS 'SELECT cube(cube(cube(earth()*cos(radians($1))*cos(radians($2))),earth()*cos(radians($1))*sin(radians($2))),earth()*sin(radians($1)))::earth';
CREATE OR REPLACE FUNCTION latitude(earth)
RETURNS float8
LANGUAGE 'sql'
LANGUAGE SQL
IMMUTABLE STRICT
AS 'SELECT CASE WHEN cube_ll_coord($1, 3)/earth() < -1 THEN -90::float8 WHEN cube_ll_coord($1, 3)/earth() > 1 THEN 90::float8 ELSE degrees(asin(cube_ll_coord($1, 3)/earth())) END';
CREATE OR REPLACE FUNCTION longitude(earth)
RETURNS float8
LANGUAGE 'sql'
LANGUAGE SQL
IMMUTABLE STRICT
AS 'SELECT degrees(atan2(cube_ll_coord($1, 2), cube_ll_coord($1, 1)))';
CREATE OR REPLACE FUNCTION earth_distance(earth, earth)
RETURNS float8
LANGUAGE 'sql'
LANGUAGE SQL
IMMUTABLE STRICT
AS 'SELECT sec_to_gc(cube_distance($1, $2))';
CREATE OR REPLACE FUNCTION earth_box(earth, float8)
RETURNS cube
LANGUAGE 'sql'
LANGUAGE SQL
IMMUTABLE STRICT
AS 'SELECT cube_enlarge($1, gc_to_sec($2), 3)';
@ -79,7 +79,7 @@ AS 'SELECT cube_enlarge($1, gc_to_sec($2), 3)';
CREATE OR REPLACE FUNCTION geo_distance (point, point)
RETURNS float8
LANGUAGE 'C' IMMUTABLE STRICT AS 'MODULE_PATHNAME';
LANGUAGE C IMMUTABLE STRICT AS 'MODULE_PATHNAME';
--------------- geo_distance as operator <@>

View File

@ -58,7 +58,7 @@ sub-string will fit.
The create the function that contains the trigger::
create function fti() returns trigger as
'/path/to/fti.so' language 'C';
'/path/to/fti.so' language C;
And finally define the trigger on the 'cds' table:

View File

@ -22,7 +22,7 @@
*
* -- Create the SQL function based on the compiled shared object
* create function fti() returns trigger as
* '/usr/local/pgsql/lib/contrib/fti.so' language 'C';
* '/usr/local/pgsql/lib/contrib/fti.so' language C;
*
* -- Create the FTI table
* create table product_fti (string varchar(255), id oid) without oids;

View File

@ -29,7 +29,7 @@
#
# create function fti() returns trigger as
# '/path/to/fti/file/fti.so'
# language 'C';
# language C;
#
# create trigger my_fti_trigger after update or insert or delete
# on mytable

View File

@ -3,4 +3,4 @@ SET search_path = public;
CREATE OR REPLACE FUNCTION fti() RETURNS trigger AS
'MODULE_PATHNAME', 'fti'
LANGUAGE 'C' VOLATILE CALLED ON NULL INPUT;
LANGUAGE C VOLATILE CALLED ON NULL INPUT;

View File

@ -20,58 +20,47 @@ SELECT soundex('Anne'), soundex('Ann'), difference('Anne', 'Ann');
SELECT soundex('Anne'), soundex('Andrew'), difference('Anne', 'Andrew');
SELECT soundex('Anne'), soundex('Margaret'), difference('Anne', 'Margaret');
CREATE TABLE s (nm text)\g
CREATE TABLE s (nm text);
insert into s values ('john')\g
insert into s values ('joan')\g
insert into s values ('wobbly')\g
insert into s values ('jack')\g
INSERT INTO s VALUES ('john');
INSERT INTO s VALUES ('joan');
INSERT INTO s VALUES ('wobbly');
INSERT INTO s VALUES ('jack');
select * from s
where soundex(nm) = soundex('john')\g
SELECT * FROM s WHERE soundex(nm) = soundex('john');
select a.nm, b.nm from s a, s b
where soundex(a.nm) = soundex(b.nm)
and a.oid <> b.oid\g
SELECT a.nm, b.nm FROM s a, s b WHERE soundex(a.nm) = soundex(b.nm) AND a.oid <> b.oid;
CREATE FUNCTION text_sx_eq(text, text) RETURNS bool AS
CREATE FUNCTION text_sx_eq(text, text) RETURNS boolean AS
'select soundex($1) = soundex($2)'
LANGUAGE 'sql'\g
LANGUAGE SQL;
CREATE FUNCTION text_sx_lt(text,text) RETURNS bool AS
CREATE FUNCTION text_sx_lt(text, text) RETURNS boolean AS
'select soundex($1) < soundex($2)'
LANGUAGE 'sql'\g
LANGUAGE SQL;
CREATE FUNCTION text_sx_gt(text,text) RETURNS bool AS
CREATE FUNCTION text_sx_gt(text, text) RETURNS boolean AS
'select soundex($1) > soundex($2)'
LANGUAGE 'sql';
LANGUAGE SQL;
CREATE FUNCTION text_sx_le(text,text) RETURNS bool AS
CREATE FUNCTION text_sx_le(text, text) RETURNS boolean AS
'select soundex($1) <= soundex($2)'
LANGUAGE 'sql';
LANGUAGE SQL;
CREATE FUNCTION text_sx_ge(text,text) RETURNS bool AS
CREATE FUNCTION text_sx_ge(text, text) RETURNS boolean AS
'select soundex($1) >= soundex($2)'
LANGUAGE 'sql';
LANGUAGE SQL;
CREATE FUNCTION text_sx_ne(text,text) RETURNS bool AS
CREATE FUNCTION text_sx_ne(text, text) RETURNS boolean AS
'select soundex($1) <> soundex($2)'
LANGUAGE 'sql';
LANGUAGE SQL;
DROP OPERATOR #= (text,text)\g
DROP OPERATOR #= (text, text);
CREATE OPERATOR #= (leftarg=text, rightarg=text, procedure=text_sx_eq,
commutator = #=)\g
CREATE OPERATOR #= (leftarg=text, rightarg=text, procedure=text_sx_eq, commutator = #=);
SELECT *
FROM s
WHERE text_sx_eq(nm,'john')\g
SELECT * FROM s WHERE text_sx_eq(nm, 'john');
SELECT *
FROM s
WHERE s.nm #= 'john';
SELECT *
FROM s
WHERE difference(s.nm, 'john') > 2;
SELECT * FROM s WHERE s.nm #= 'john';
SELECT * FROM s WHERE difference(s.nm, 'john') > 2;

View File

@ -10,12 +10,12 @@ SET search_path = public;
CREATE FUNCTION bqarr_in(cstring)
RETURNS query_int
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION bqarr_out(query_int)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE query_int (
INTERNALLENGTH = -1,
@ -27,20 +27,20 @@ CREATE TYPE query_int (
CREATE FUNCTION querytree(query_int)
RETURNS text
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION boolop(_int4, query_int)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
COMMENT ON FUNCTION boolop(_int4, query_int) IS 'boolean operation with array';
CREATE FUNCTION rboolop(query_int, _int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
COMMENT ON FUNCTION rboolop(query_int, _int4) IS 'boolean operation with array';
@ -72,35 +72,35 @@ CREATE OPERATOR ~~ (
CREATE FUNCTION _int_contains(_int4, _int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
COMMENT ON FUNCTION _int_contains(_int4, _int4) IS 'contains';
CREATE FUNCTION _int_contained(_int4, _int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
COMMENT ON FUNCTION _int_contained(_int4, _int4) IS 'contained in';
CREATE FUNCTION _int_overlap(_int4, _int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
COMMENT ON FUNCTION _int_overlap(_int4, _int4) IS 'overlaps';
CREATE FUNCTION _int_same(_int4, _int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
COMMENT ON FUNCTION _int_same(_int4, _int4) IS 'same as';
CREATE FUNCTION _int_different(_int4, _int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
COMMENT ON FUNCTION _int_different(_int4, _int4) IS 'different';
@ -108,12 +108,13 @@ COMMENT ON FUNCTION _int_different(_int4, _int4) IS 'different';
CREATE FUNCTION _int_union(_int4, _int4)
RETURNS _int4
AS 'MODULE_PATHNAME' LANGUAGE 'C' WITH (isstrict);
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION _int_inter(_int4, _int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
--
-- OPERATORS
@ -172,12 +173,12 @@ CREATE OPERATOR ~ (
CREATE FUNCTION intset(int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION icount(_int4)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR # (
RIGHTARG = _int4,
@ -187,32 +188,32 @@ CREATE OPERATOR # (
CREATE FUNCTION sort(_int4, text)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION sort(_int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION sort_asc(_int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION sort_desc(_int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION uniq(_int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION idx(_int4, int4)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR # (
LEFTARG = _int4,
@ -223,17 +224,17 @@ CREATE OPERATOR # (
CREATE FUNCTION subarray(_int4, int4, int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION subarray(_int4, int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION intarray_push_elem(_int4, int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR + (
LEFTARG = _int4,
@ -244,7 +245,7 @@ CREATE OPERATOR + (
CREATE FUNCTION intarray_push_array(_int4, _int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR + (
LEFTARG = _int4,
@ -256,7 +257,7 @@ CREATE OPERATOR + (
CREATE FUNCTION intarray_del_elem(_int4, int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR - (
LEFTARG = _int4,
@ -267,7 +268,7 @@ CREATE OPERATOR - (
CREATE FUNCTION intset_union_elem(_int4, int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR | (
LEFTARG = _int4,
@ -285,7 +286,7 @@ CREATE OPERATOR | (
CREATE FUNCTION intset_subtract(_int4, _int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict, isCachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR - (
LEFTARG = _int4,
@ -305,37 +306,37 @@ CREATE OPERATOR & (
CREATE FUNCTION g_int_consistent(internal,_int4,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION g_int_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION g_int_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION g_int_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION g_int_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION g_int_union(internal, internal)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION g_int_same(_int4, _int4, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator class for indexing
@ -364,12 +365,12 @@ DEFAULT FOR TYPE _int4 USING gist AS
CREATE FUNCTION _intbig_in(cstring)
RETURNS intbig_gkey
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION _intbig_out(intbig_gkey)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE intbig_gkey (
INTERNALLENGTH = -1,
@ -380,37 +381,37 @@ CREATE TYPE intbig_gkey (
CREATE FUNCTION g_intbig_consistent(internal,internal,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION g_intbig_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION g_intbig_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION g_intbig_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION g_intbig_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION g_intbig_union(internal, internal)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION g_intbig_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- register the opclass for indexing (not as default)

View File

@ -6,9 +6,9 @@
psql:_int.sql:13: NOTICE: type "query_int" is not yet defined
DETAIL: Creating a shell type definition.
psql:_int.sql:18: NOTICE: argument type query_int is only a shell
psql:_int.sql:367: NOTICE: type "intbig_gkey" is not yet defined
psql:_int.sql:368: NOTICE: type "intbig_gkey" is not yet defined
DETAIL: Creating a shell type definition.
psql:_int.sql:372: NOTICE: argument type intbig_gkey is only a shell
psql:_int.sql:373: NOTICE: argument type intbig_gkey is only a shell
SELECT intset(1234);
intset
--------

View File

@ -1,7 +1,7 @@
--
-- PostgreSQL code for ISSNs.
--
-- $PostgreSQL: pgsql/contrib/isbn_issn/isbn_issn.sql.in,v 1.11 2005/01/29 22:35:02 tgl Exp $
-- $PostgreSQL: pgsql/contrib/isbn_issn/isbn_issn.sql.in,v 1.12 2006/02/27 16:09:48 petere Exp $
--
-- Adjust this setting to control where the objects get created.
@ -120,7 +120,7 @@ CREATE OPERATOR <> (
CREATE FUNCTION issn_cmp(issn, issn)
RETURNS integer
AS '$libdir/isbn_issn'
LANGUAGE c STRICT;
LANGUAGE C STRICT;
-- Create default operator class for 'issn' --
-- Needed to create index or primary key --
@ -253,7 +253,7 @@ CREATE OPERATOR <> (
CREATE FUNCTION isbn_cmp(isbn, isbn)
RETURNS integer
AS '$libdir/isbn_issn'
LANGUAGE c STRICT;
LANGUAGE C STRICT;
-- Create default operator class for 'isbn' --
-- Needed to create index or primary key --

View File

@ -313,7 +313,7 @@ ltreetest=# select subpath(path,0,2)||'Space'||subpath(path,2) from test where p
We could create SQL-function:
CREATE FUNCTION ins_label(ltree, int4, text) RETURNS ltree
AS 'select subpath($1,0,$2) || $3 || subpath($1,$2);'
LANGUAGE SQL WITH (ISCACHABLE);
LANGUAGE SQL IMMUTABLE;
and previous select could be rewritten as:
@ -329,7 +329,7 @@ Or with another arguments:
CREATE FUNCTION ins_label(ltree, ltree, text) RETURNS ltree
AS 'select subpath($1,0,nlevel($2)) || $3 || subpath($1,nlevel($2));'
LANGUAGE SQL WITH (ISCACHABLE);
LANGUAGE SQL IMMUTABLE;
ltreetest=# select ins_label(path,'Top.Science'::ltree,'Space') from test where path <@ 'Top.Science.Astronomy';
ins_label

View File

@ -4,12 +4,12 @@ SET search_path = public;
CREATE FUNCTION ltree_in(cstring)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION ltree_out(ltree)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE ltree (
INTERNALLENGTH = -1,
@ -23,37 +23,37 @@ CREATE TYPE ltree (
CREATE FUNCTION ltree_cmp(ltree,ltree)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltree_lt(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltree_le(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltree_eq(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltree_ge(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltree_gt(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltree_ne(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR < (
@ -123,107 +123,107 @@ CREATE OPERATOR <> (
CREATE FUNCTION subltree(ltree,int4,int4)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION subpath(ltree,int4,int4)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION subpath(ltree,int4)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION index(ltree,ltree)
RETURNS int4
AS 'MODULE_PATHNAME', 'ltree_index'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION index(ltree,ltree,int4)
RETURNS int4
AS 'MODULE_PATHNAME', 'ltree_index'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION nlevel(ltree)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltree2text(ltree)
RETURNS text
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION text2ltree(text)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION lca(_ltree)
RETURNS ltree
AS 'MODULE_PATHNAME','_lca'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltree_isparent(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltree_risparent(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltree_addltree(ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltree_addtext(ltree,text)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltree_textadd(text,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR @> (
LEFTARG = ltree,
@ -296,12 +296,12 @@ CREATE OPERATOR CLASS ltree_ops
CREATE FUNCTION lquery_in(cstring)
RETURNS lquery
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION lquery_out(lquery)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE lquery (
INTERNALLENGTH = -1,
@ -313,12 +313,12 @@ CREATE TYPE lquery (
CREATE FUNCTION ltq_regex(ltree,lquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltq_rregex(lquery,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR ~ (
LEFTARG = ltree,
@ -360,12 +360,12 @@ CREATE OPERATOR ^~ (
CREATE FUNCTION lt_q_regex(ltree,_lquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION lt_q_rregex(_lquery,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR ? (
LEFTARG = ltree,
@ -407,12 +407,12 @@ CREATE OPERATOR ^? (
CREATE FUNCTION ltxtq_in(cstring)
RETURNS ltxtquery
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION ltxtq_out(ltxtquery)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE ltxtquery (
INTERNALLENGTH = -1,
@ -426,12 +426,12 @@ CREATE TYPE ltxtquery (
CREATE FUNCTION ltxtq_exec(ltree, ltxtquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION ltxtq_rexec(ltxtquery, ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR @ (
LEFTARG = ltree,
@ -474,12 +474,12 @@ CREATE OPERATOR ^@ (
CREATE FUNCTION ltree_gist_in(cstring)
RETURNS ltree_gist
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION ltree_gist_out(ltree_gist)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE ltree_gist (
internallength = -1,
@ -490,19 +490,25 @@ CREATE TYPE ltree_gist (
CREATE FUNCTION ltree_consistent(internal,internal,int2)
RETURNS bool as 'MODULE_PATHNAME' language 'C';
RETURNS bool as 'MODULE_PATHNAME' LANGUAGE C;
CREATE FUNCTION ltree_compress(internal)
RETURNS internal as 'MODULE_PATHNAME' language 'C';
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C;
CREATE FUNCTION ltree_decompress(internal)
RETURNS internal as 'MODULE_PATHNAME' language 'C';
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C;
CREATE FUNCTION ltree_penalty(internal,internal,internal)
RETURNS internal as 'MODULE_PATHNAME' language 'C' with(isstrict);
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION ltree_picksplit(internal, internal)
RETURNS internal as 'MODULE_PATHNAME' language 'C';
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C;
CREATE FUNCTION ltree_union(internal, internal)
RETURNS int4 as 'MODULE_PATHNAME' language 'C';
RETURNS int4 as 'MODULE_PATHNAME' LANGUAGE C;
CREATE FUNCTION ltree_same(internal, internal, internal)
RETURNS internal as 'MODULE_PATHNAME' language 'C';
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C;
CREATE OPERATOR CLASS gist_ltree_ops
DEFAULT FOR TYPE ltree USING gist AS
@ -534,52 +540,52 @@ CREATE OPERATOR CLASS gist_ltree_ops
CREATE FUNCTION _ltree_isparent(_ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION _ltree_r_isparent(ltree,_ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION _ltree_risparent(_ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION _ltree_r_risparent(ltree,_ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION _ltq_regex(_ltree,lquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION _ltq_rregex(lquery,_ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION _lt_q_regex(_ltree,_lquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION _lt_q_rregex(_lquery,_ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION _ltxtq_exec(_ltree, ltxtquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION _ltxtq_rexec(ltxtquery, _ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR @> (
LEFTARG = _ltree,
@ -767,7 +773,7 @@ CREATE OPERATOR ^@ (
CREATE FUNCTION _ltree_extract_isparent(_ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR ?@> (
LEFTARG = _ltree,
@ -778,7 +784,7 @@ CREATE OPERATOR ?@> (
CREATE FUNCTION _ltree_extract_risparent(_ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR ?<@ (
LEFTARG = _ltree,
@ -789,7 +795,7 @@ CREATE OPERATOR ?<@ (
CREATE FUNCTION _ltq_extract_regex(_ltree,lquery)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR ?~ (
LEFTARG = _ltree,
@ -800,7 +806,7 @@ CREATE OPERATOR ?~ (
CREATE FUNCTION _ltxtq_extract_exec(_ltree,ltxtquery)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR ?@ (
LEFTARG = _ltree,
@ -812,27 +818,32 @@ CREATE OPERATOR ?@ (
CREATE FUNCTION _ltree_consistent(internal,internal,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION _ltree_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION _ltree_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH(isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION _ltree_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION _ltree_union(internal, internal)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION _ltree_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE OPERATOR CLASS gist__ltree_ops
DEFAULT FOR TYPE _ltree USING gist AS

View File

@ -42,7 +42,7 @@ create index macoui_idx on macoui (addr);
create function manuf (macaddr)
returns text as '
select name from macoui m where trunc(\$1) = m.addr;
' language 'SQL';
' language SQL;
EOF
if [ $update -gt 0 ]; then

View File

@ -5,7 +5,7 @@ SET search_path = public;
CREATE OR REPLACE FUNCTION pg_buffercache_pages()
RETURNS SETOF RECORD
AS 'MODULE_PATHNAME', 'pg_buffercache_pages'
LANGUAGE 'C';
LANGUAGE C;
-- Create a view for convenient access.
CREATE VIEW pg_buffercache AS

View File

@ -6,7 +6,7 @@ SET search_path = public;
CREATE OR REPLACE FUNCTION pg_freespacemap()
RETURNS SETOF RECORD
AS 'MODULE_PATHNAME', 'pg_freespacemap'
LANGUAGE 'C';
LANGUAGE C;
-- Create a view for convenient access.
CREATE VIEW pg_freespacemap AS

View File

@ -5,27 +5,27 @@ BEGIN;
create function set_limit(float4)
returns float4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
create function show_limit()
returns float4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
create function show_trgm(text)
returns _text
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
create function similarity(text,text)
returns float4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
create function similarity_op(text,text)
returns bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR % (
LEFTARG = text,
@ -40,12 +40,12 @@ CREATE OPERATOR % (
CREATE FUNCTION gtrgm_in(cstring)
RETURNS gtrgm
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gtrgm_out(gtrgm)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE gtrgm (
INTERNALLENGTH = -1,
@ -57,37 +57,37 @@ CREATE TYPE gtrgm (
CREATE FUNCTION gtrgm_consistent(gtrgm,internal,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtrgm_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtrgm_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtrgm_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gtrgm_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtrgm_union(bytea, internal)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtrgm_same(gtrgm, gtrgm, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- create the operator class
CREATE OPERATOR CLASS gist_trgm_ops

View File

@ -4,72 +4,72 @@ SET search_path = public;
CREATE OR REPLACE FUNCTION digest(text, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_digest'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION digest(bytea, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_digest'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION digest_exists(text)
RETURNS bool
AS 'MODULE_PATHNAME', 'pg_digest_exists'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION hmac(text, text, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_hmac'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION hmac(bytea, bytea, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_hmac'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION hmac_exists(text)
RETURNS bool
AS 'MODULE_PATHNAME', 'pg_hmac_exists'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION crypt(text, text)
RETURNS text
AS 'MODULE_PATHNAME', 'pg_crypt'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION gen_salt(text)
RETURNS text
AS 'MODULE_PATHNAME', 'pg_gen_salt'
LANGUAGE 'C' VOLATILE STRICT;
LANGUAGE C VOLATILE STRICT;
CREATE OR REPLACE FUNCTION gen_salt(text, int4)
RETURNS text
AS 'MODULE_PATHNAME', 'pg_gen_salt_rounds'
LANGUAGE 'C' VOLATILE STRICT;
LANGUAGE C VOLATILE STRICT;
CREATE OR REPLACE FUNCTION encrypt(bytea, bytea, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_encrypt'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION decrypt(bytea, bytea, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_decrypt'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION encrypt_iv(bytea, bytea, bytea, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_encrypt_iv'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION decrypt_iv(bytea, bytea, bytea, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_decrypt_iv'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION cipher_exists(text)
RETURNS bool
AS 'MODULE_PATHNAME', 'pg_cipher_exists'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
--
-- pgp_sym_encrypt(data, key)
@ -77,12 +77,12 @@ LANGUAGE 'C' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION pgp_sym_encrypt(text, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_sym_encrypt_text'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION pgp_sym_encrypt_bytea(bytea, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_sym_encrypt_bytea'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
--
-- pgp_sym_encrypt(data, key, args)
@ -90,12 +90,12 @@ LANGUAGE 'C' STRICT;
CREATE OR REPLACE FUNCTION pgp_sym_encrypt(text, text, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_sym_encrypt_text'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION pgp_sym_encrypt_bytea(bytea, text, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_sym_encrypt_bytea'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
--
-- pgp_sym_decrypt(data, key)
@ -103,12 +103,12 @@ LANGUAGE 'C' STRICT;
CREATE OR REPLACE FUNCTION pgp_sym_decrypt(bytea, text)
RETURNS text
AS 'MODULE_PATHNAME', 'pgp_sym_decrypt_text'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION pgp_sym_decrypt_bytea(bytea, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_sym_decrypt_bytea'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
--
-- pgp_sym_decrypt(data, key, args)
@ -116,12 +116,12 @@ LANGUAGE 'C' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION pgp_sym_decrypt(bytea, text, text)
RETURNS text
AS 'MODULE_PATHNAME', 'pgp_sym_decrypt_text'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION pgp_sym_decrypt_bytea(bytea, text, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_sym_decrypt_bytea'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
--
-- pgp_pub_encrypt(data, key)
@ -129,12 +129,12 @@ LANGUAGE 'C' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION pgp_pub_encrypt(text, bytea)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_pub_encrypt_text'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_pub_encrypt_bytea'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
--
-- pgp_pub_encrypt(data, key, args)
@ -142,12 +142,12 @@ LANGUAGE 'C' STRICT;
CREATE OR REPLACE FUNCTION pgp_pub_encrypt(text, bytea, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_pub_encrypt_text'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_pub_encrypt_bytea'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
--
-- pgp_pub_decrypt(data, key)
@ -155,12 +155,12 @@ LANGUAGE 'C' STRICT;
CREATE OR REPLACE FUNCTION pgp_pub_decrypt(bytea, bytea)
RETURNS text
AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_text'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_bytea'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
--
-- pgp_pub_decrypt(data, key, psw)
@ -168,12 +168,12 @@ LANGUAGE 'C' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION pgp_pub_decrypt(bytea, bytea, text)
RETURNS text
AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_text'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_bytea'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
--
-- pgp_pub_decrypt(data, key, psw, arg)
@ -181,12 +181,12 @@ LANGUAGE 'C' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION pgp_pub_decrypt(bytea, bytea, text, text)
RETURNS text
AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_text'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pgp_pub_decrypt_bytea'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
--
-- PGP key ID
@ -194,7 +194,7 @@ LANGUAGE 'C' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION pgp_key_id(bytea)
RETURNS text
AS 'MODULE_PATHNAME', 'pgp_key_id_w'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
--
-- pgp armor
@ -202,10 +202,10 @@ LANGUAGE 'C' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION armor(bytea)
RETURNS text
AS 'MODULE_PATHNAME', 'pg_armor'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION dearmor(text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_dearmor'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT;

View File

@ -45,11 +45,11 @@ free_percent -- free space in %
CREATE OR REPLACE FUNCTION pgstattuple(text) RETURNS pgstattuple_type
AS 'MODULE_PATHNAME', 'pgstattuple'
LANGUAGE 'c' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION pgstattuple(oid) RETURNS pgstattuple_type
AS 'MODULE_PATHNAME', 'pgstattuplebyid'
LANGUAGE 'c' STRICT;
LANGUAGE C STRICT;
The argument is the table name (optionally it may be qualified)
or the OID of the table. Note that pgstattuple only returns

View File

@ -1,4 +1,4 @@
$PostgreSQL: pgsql/contrib/pgstattuple/README.pgstattuple.euc_jp,v 1.5 2003/11/29 22:39:29 pgsql Exp $
$PostgreSQL: pgsql/contrib/pgstattuple/README.pgstattuple.euc_jp,v 1.6 2006/02/27 16:09:49 petere Exp $
pgstattuple README 2002/08/22 石井達夫
@ -54,7 +54,7 @@ free_percent --
CREATE OR REPLACE FUNCTION pgstattuple(text) RETURNS pgstattuple_type
AS 'MODULE_PATHNAME', 'pgstattuple'
LANGUAGE 'c' WITH (isstrict);
LANGUAGE C STRICT;
第一引数: テーブル名

View File

@ -16,9 +16,9 @@ CREATE TYPE pgstattuple_type AS (
CREATE OR REPLACE FUNCTION pgstattuple(text)
RETURNS pgstattuple_type
AS 'MODULE_PATHNAME', 'pgstattuple'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE OR REPLACE FUNCTION pgstattuple(oid)
RETURNS pgstattuple_type
AS 'MODULE_PATHNAME', 'pgstattuplebyid'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;

View File

@ -7,12 +7,12 @@ SET search_path = public;
CREATE FUNCTION seg_in(cstring)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION seg_out(seg)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' IMMUTABLE STRICT;
LANGUAGE C STRICT IMMUTABLE;
CREATE TYPE seg (
INTERNALLENGTH = 12,
@ -32,7 +32,7 @@ COMMENT ON TYPE seg IS
CREATE FUNCTION seg_over_left(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_over_left(seg, seg) IS
'overlaps or is left of';
@ -40,7 +40,7 @@ COMMENT ON FUNCTION seg_over_left(seg, seg) IS
CREATE FUNCTION seg_over_right(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_over_right(seg, seg) IS
'overlaps or is right of';
@ -48,7 +48,7 @@ COMMENT ON FUNCTION seg_over_right(seg, seg) IS
CREATE FUNCTION seg_left(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_left(seg, seg) IS
'is left of';
@ -56,7 +56,7 @@ COMMENT ON FUNCTION seg_left(seg, seg) IS
CREATE FUNCTION seg_right(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_right(seg, seg) IS
'is right of';
@ -67,7 +67,7 @@ COMMENT ON FUNCTION seg_right(seg, seg) IS
CREATE FUNCTION seg_lt(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_lt(seg, seg) IS
'less than';
@ -75,7 +75,7 @@ COMMENT ON FUNCTION seg_lt(seg, seg) IS
CREATE FUNCTION seg_le(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_le(seg, seg) IS
'less than or equal';
@ -83,7 +83,7 @@ COMMENT ON FUNCTION seg_le(seg, seg) IS
CREATE FUNCTION seg_gt(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_gt(seg, seg) IS
'greater than';
@ -91,7 +91,7 @@ COMMENT ON FUNCTION seg_gt(seg, seg) IS
CREATE FUNCTION seg_ge(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_ge(seg, seg) IS
'greater than or equal';
@ -99,7 +99,7 @@ COMMENT ON FUNCTION seg_ge(seg, seg) IS
CREATE FUNCTION seg_contains(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_contains(seg, seg) IS
'contains';
@ -107,7 +107,7 @@ COMMENT ON FUNCTION seg_contains(seg, seg) IS
CREATE FUNCTION seg_contained(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_contained(seg, seg) IS
'contained in';
@ -115,7 +115,7 @@ COMMENT ON FUNCTION seg_contained(seg, seg) IS
CREATE FUNCTION seg_overlap(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_overlap(seg, seg) IS
'overlaps';
@ -123,7 +123,7 @@ COMMENT ON FUNCTION seg_overlap(seg, seg) IS
CREATE FUNCTION seg_same(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_same(seg, seg) IS
'same as';
@ -131,7 +131,7 @@ COMMENT ON FUNCTION seg_same(seg, seg) IS
CREATE FUNCTION seg_different(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_different(seg, seg) IS
'different';
@ -141,36 +141,36 @@ COMMENT ON FUNCTION seg_different(seg, seg) IS
CREATE OR REPLACE FUNCTION seg_cmp(seg, seg)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_cmp(seg, seg) IS 'btree comparison function';
CREATE FUNCTION seg_union(seg, seg)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION seg_inter(seg, seg)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION seg_size(seg)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
-- miscellaneous
CREATE FUNCTION seg_upper(seg)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION seg_lower(seg)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
--
@ -304,37 +304,37 @@ CREATE OPERATOR ~ (
CREATE FUNCTION gseg_consistent(internal,seg,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gseg_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gseg_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gseg_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE FUNCTION gseg_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gseg_union(internal, internal)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gseg_same(seg, seg, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- Create the operator classes for indexing

View File

@ -4,4 +4,4 @@ SET search_path = public;
CREATE OR REPLACE FUNCTION autoinc()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;

View File

@ -4,4 +4,4 @@ SET search_path = public;
CREATE OR REPLACE FUNCTION insert_username()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;

View File

@ -4,4 +4,4 @@ SET search_path = public;
CREATE OR REPLACE FUNCTION moddatetime()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;

View File

@ -4,9 +4,9 @@ SET search_path = public;
CREATE OR REPLACE FUNCTION check_primary_key()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE OR REPLACE FUNCTION check_foreign_key()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;

View File

@ -1,19 +1,17 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION timetravel()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE OR REPLACE FUNCTION set_timetravel(name, int4)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE OR REPLACE FUNCTION get_timetravel(name)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isStrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;

View File

@ -315,7 +315,7 @@ Notes
CREATE OR REPLACE FUNCTION crosstab_float8_5_cols(text)
RETURNS setof my_crosstab_float8_5_cols
AS '$libdir/tablefunc','crosstab' LANGUAGE 'c' STABLE STRICT;
AS '$libdir/tablefunc','crosstab' LANGUAGE C STABLE STRICT;
B. Use OUT parameters to define the return type implicitly.
The same example could also be done this way:
@ -328,7 +328,7 @@ Notes
OUT category_4 FLOAT8,
OUT category_5 FLOAT8)
RETURNS setof record
AS '$libdir/tablefunc','crosstab' LANGUAGE 'c' STABLE STRICT;
AS '$libdir/tablefunc','crosstab' LANGUAGE C STABLE STRICT;
Example usage

View File

@ -128,7 +128,7 @@ CREATE FUNCTION crosstab_out(text,
OUT rowid text, OUT att1 text, OUT att2 text, OUT att3 text)
RETURNS setof record
AS '$libdir/tablefunc','crosstab'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
SELECT * FROM crosstab_out('SELECT rowid, attribute, val FROM ct where rowclass = ''group1'' ORDER BY 1,2;');
rowid | att1 | att2 | att3
-------+------+------+------
@ -231,7 +231,7 @@ create type my_crosstab_result as (
CREATE FUNCTION crosstab_named(text, text)
RETURNS setof my_crosstab_result
AS '$libdir/tablefunc','crosstab_hash'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
SELECT * FROM crosstab_named(
'SELECT rowid, rowdt, attribute, val FROM cth ORDER BY 1',
'SELECT DISTINCT attribute FROM cth ORDER BY 1');
@ -248,7 +248,7 @@ CREATE FUNCTION crosstab_out(text, text,
OUT test_startdate timestamp, OUT volts float8)
RETURNS setof record
AS '$libdir/tablefunc','crosstab_hash'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
SELECT * FROM crosstab_out(
'SELECT rowid, rowdt, attribute, val FROM cth ORDER BY 1',
'SELECT DISTINCT attribute FROM cth ORDER BY 1');

View File

@ -44,7 +44,7 @@ CREATE FUNCTION crosstab_out(text,
OUT rowid text, OUT att1 text, OUT att2 text, OUT att3 text)
RETURNS setof record
AS '$libdir/tablefunc','crosstab'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
SELECT * FROM crosstab_out('SELECT rowid, attribute, val FROM ct where rowclass = ''group1'' ORDER BY 1,2;');
@ -119,7 +119,7 @@ create type my_crosstab_result as (
CREATE FUNCTION crosstab_named(text, text)
RETURNS setof my_crosstab_result
AS '$libdir/tablefunc','crosstab_hash'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
SELECT * FROM crosstab_named(
'SELECT rowid, rowdt, attribute, val FROM cth ORDER BY 1',
@ -133,7 +133,7 @@ CREATE FUNCTION crosstab_out(text, text,
OUT test_startdate timestamp, OUT volts float8)
RETURNS setof record
AS '$libdir/tablefunc','crosstab_hash'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
SELECT * FROM crosstab_out(
'SELECT rowid, rowdt, attribute, val FROM cth ORDER BY 1',

View File

@ -4,13 +4,13 @@ SET search_path = public;
CREATE OR REPLACE FUNCTION normal_rand(int4, float8, float8)
RETURNS setof float8
AS 'MODULE_PATHNAME','normal_rand'
LANGUAGE 'C' VOLATILE STRICT;
LANGUAGE C VOLATILE STRICT;
-- the generic crosstab function:
CREATE OR REPLACE FUNCTION crosstab(text)
RETURNS setof record
AS 'MODULE_PATHNAME','crosstab'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
-- examples of building custom type-specific crosstab functions:
CREATE TYPE tablefunc_crosstab_2 AS
@ -40,47 +40,47 @@ CREATE TYPE tablefunc_crosstab_4 AS
CREATE OR REPLACE FUNCTION crosstab2(text)
RETURNS setof tablefunc_crosstab_2
AS 'MODULE_PATHNAME','crosstab'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
CREATE OR REPLACE FUNCTION crosstab3(text)
RETURNS setof tablefunc_crosstab_3
AS 'MODULE_PATHNAME','crosstab'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
CREATE OR REPLACE FUNCTION crosstab4(text)
RETURNS setof tablefunc_crosstab_4
AS 'MODULE_PATHNAME','crosstab'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
-- obsolete:
CREATE OR REPLACE FUNCTION crosstab(text,int)
RETURNS setof record
AS 'MODULE_PATHNAME','crosstab'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
CREATE OR REPLACE FUNCTION crosstab(text,text)
RETURNS setof record
AS 'MODULE_PATHNAME','crosstab_hash'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
CREATE OR REPLACE FUNCTION connectby(text,text,text,text,int,text)
RETURNS setof record
AS 'MODULE_PATHNAME','connectby_text'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
CREATE OR REPLACE FUNCTION connectby(text,text,text,text,int)
RETURNS setof record
AS 'MODULE_PATHNAME','connectby_text'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
-- These 2 take the name of a field to ORDER BY as 4th arg (for sorting siblings)
CREATE OR REPLACE FUNCTION connectby(text,text,text,text,text,int,text)
RETURNS setof record
AS 'MODULE_PATHNAME','connectby_text_serial'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;
CREATE OR REPLACE FUNCTION connectby(text,text,text,text,text,int)
RETURNS setof record
AS 'MODULE_PATHNAME','connectby_text_serial'
LANGUAGE 'C' STABLE STRICT;
LANGUAGE C STABLE STRICT;

View File

@ -4,13 +4,13 @@ BEGIN;
HASINIT create function dinit_CFG_MODNAME(internal)
HASINIT returns internal
HASINIT as 'MODULE_PATHNAME'
HASINIT language 'C';
HASINIT language C;
NOSNOWBALL create function dlexize_CFG_MODNAME(internal,internal,int4)
NOSNOWBALL returns internal
NOSNOWBALL as 'MODULE_PATHNAME'
NOSNOWBALL language 'C'
NOSNOWBALL with (isstrict);
NOSNOWBALL language C
NOSNOWBALL returns null on null input;
insert into pg_ts_dict select
'CFG_MODNAME',

View File

@ -14,46 +14,46 @@ CREATE TABLE pg_ts_dict (
--dict interface
CREATE FUNCTION lexize(oid, text)
returns _text
RETURNS _text
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION lexize(text, text)
returns _text
RETURNS _text
as 'MODULE_PATHNAME', 'lexize_byname'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION lexize(text)
returns _text
RETURNS _text
as 'MODULE_PATHNAME', 'lexize_bycurrent'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION set_curdict(int)
returns void
RETURNS void
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION set_curdict(text)
returns void
RETURNS void
as 'MODULE_PATHNAME', 'set_curdict_byname'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
--built-in dictionaries
CREATE FUNCTION dex_init(internal)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C';
LANGUAGE C;
CREATE FUNCTION dex_lexize(internal,internal,int4)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
insert into pg_ts_dict select
'simple',
@ -64,15 +64,15 @@ insert into pg_ts_dict select
;
CREATE FUNCTION snb_en_init(internal)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C';
LANGUAGE C;
CREATE FUNCTION snb_lexize(internal,internal,int4)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
insert into pg_ts_dict select
'en_stem',
@ -83,9 +83,9 @@ insert into pg_ts_dict select
;
CREATE FUNCTION snb_ru_init_koi8(internal)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C';
LANGUAGE C;
insert into pg_ts_dict select
'ru_stem_koi8',
@ -96,9 +96,9 @@ insert into pg_ts_dict select
;
CREATE FUNCTION snb_ru_init_utf8(internal)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C';
LANGUAGE C;
insert into pg_ts_dict select
'ru_stem_utf8',
@ -109,15 +109,15 @@ insert into pg_ts_dict select
;
CREATE FUNCTION spell_init(internal)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C';
LANGUAGE C;
CREATE FUNCTION spell_lexize(internal,internal,int4)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
insert into pg_ts_dict select
'ispell_template',
@ -128,15 +128,15 @@ insert into pg_ts_dict select
;
CREATE FUNCTION syn_init(internal)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C';
LANGUAGE C;
CREATE FUNCTION syn_lexize(internal,internal,int4)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
insert into pg_ts_dict select
'synonym',
@ -162,81 +162,81 @@ CREATE TYPE tokentype
as (tokid int4, alias text, descr text);
CREATE FUNCTION token_type(int4)
returns setof tokentype
RETURNS setof tokentype
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION token_type(text)
returns setof tokentype
RETURNS setof tokentype
as 'MODULE_PATHNAME', 'token_type_byname'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION token_type()
returns setof tokentype
RETURNS setof tokentype
as 'MODULE_PATHNAME', 'token_type_current'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION set_curprs(int)
returns void
RETURNS void
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION set_curprs(text)
returns void
RETURNS void
as 'MODULE_PATHNAME', 'set_curprs_byname'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE TYPE tokenout
as (tokid int4, token text);
CREATE FUNCTION parse(oid,text)
returns setof tokenout
RETURNS setof tokenout
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION parse(text,text)
returns setof tokenout
RETURNS setof tokenout
as 'MODULE_PATHNAME', 'parse_byname'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION parse(text)
returns setof tokenout
RETURNS setof tokenout
as 'MODULE_PATHNAME', 'parse_current'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
--default parser
CREATE FUNCTION prsd_start(internal,int4)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C';
LANGUAGE C;
CREATE FUNCTION prsd_getlexeme(internal,internal,internal)
returns int4
RETURNS int4
as 'MODULE_PATHNAME'
language 'C';
LANGUAGE C;
CREATE FUNCTION prsd_end(internal)
returns void
RETURNS void
as 'MODULE_PATHNAME'
language 'C';
LANGUAGE C;
CREATE FUNCTION prsd_lextype(internal)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C';
LANGUAGE C;
CREATE FUNCTION prsd_headline(internal,internal,internal)
returns internal
RETURNS internal
as 'MODULE_PATHNAME'
language 'C';
LANGUAGE C;
insert into pg_ts_parser select
'default',
@ -264,22 +264,22 @@ CREATE TABLE pg_ts_cfgmap (
) with oids;
CREATE FUNCTION set_curcfg(int)
returns void
RETURNS void
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION set_curcfg(text)
returns void
RETURNS void
as 'MODULE_PATHNAME', 'set_curcfg_byname'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION show_curcfg()
returns oid
RETURNS oid
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
insert into pg_ts_cfg values ('default', 'default','C');
insert into pg_ts_cfg values ('default_russian', 'default','ru_RU.KOI8-R');
@ -367,12 +367,12 @@ insert into pg_ts_cfgmap values ('simple', 'uint', '{simple}');
CREATE FUNCTION tsvector_in(cstring)
RETURNS tsvector
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION tsvector_out(tsvector)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE tsvector (
INTERNALLENGTH = -1,
@ -384,37 +384,37 @@ CREATE TYPE tsvector (
CREATE FUNCTION length(tsvector)
RETURNS int4
AS 'MODULE_PATHNAME', 'tsvector_length'
LANGUAGE 'C' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION to_tsvector(oid, text)
RETURNS tsvector
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION to_tsvector(text, text)
RETURNS tsvector
AS 'MODULE_PATHNAME', 'to_tsvector_name'
LANGUAGE 'C' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION to_tsvector(text)
RETURNS tsvector
AS 'MODULE_PATHNAME', 'to_tsvector_current'
LANGUAGE 'C' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION strip(tsvector)
RETURNS tsvector
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION setweight(tsvector,"char")
RETURNS tsvector
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION concat(tsvector,tsvector)
RETURNS tsvector
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR || (
LEFTARG = tsvector,
@ -426,12 +426,12 @@ CREATE OPERATOR || (
CREATE FUNCTION tsquery_in(cstring)
RETURNS tsquery
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION tsquery_out(tsquery)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE tsquery (
INTERNALLENGTH = -1,
@ -443,50 +443,50 @@ CREATE TYPE tsquery (
CREATE FUNCTION querytree(tsquery)
RETURNS text
AS 'MODULE_PATHNAME', 'tsquerytree'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION to_tsquery(oid, text)
RETURNS tsquery
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION to_tsquery(text, text)
RETURNS tsquery
AS 'MODULE_PATHNAME','to_tsquery_name'
LANGUAGE 'c' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION to_tsquery(text)
RETURNS tsquery
AS 'MODULE_PATHNAME','to_tsquery_current'
LANGUAGE 'c' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION plainto_tsquery(oid, text)
RETURNS tsquery
AS 'MODULE_PATHNAME'
LANGUAGE 'c' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION plainto_tsquery(text, text)
RETURNS tsquery
AS 'MODULE_PATHNAME','plainto_tsquery_name'
LANGUAGE 'c' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION plainto_tsquery(text)
RETURNS tsquery
AS 'MODULE_PATHNAME','plainto_tsquery_current'
LANGUAGE 'c' with (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
--operations
CREATE FUNCTION exectsq(tsvector, tsquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
COMMENT ON FUNCTION exectsq(tsvector, tsquery) IS 'boolean operation with text index';
CREATE FUNCTION rexectsq(tsquery, tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
COMMENT ON FUNCTION rexectsq(tsquery, tsvector) IS 'boolean operation with text index';
@ -511,90 +511,90 @@ CREATE OPERATOR @@ (
CREATE FUNCTION tsearch2()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
--Relevation
CREATE FUNCTION rank(float4[], tsvector, tsquery)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION rank(float4[], tsvector, tsquery, int4)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION rank(tsvector, tsquery)
RETURNS float4
AS 'MODULE_PATHNAME', 'rank_def'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION rank(tsvector, tsquery, int4)
RETURNS float4
AS 'MODULE_PATHNAME', 'rank_def'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION rank_cd(int4, tsvector, tsquery)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION rank_cd(int4, tsvector, tsquery, int4)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION rank_cd(tsvector, tsquery)
RETURNS float4
AS 'MODULE_PATHNAME', 'rank_cd_def'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION rank_cd(tsvector, tsquery, int4)
RETURNS float4
AS 'MODULE_PATHNAME', 'rank_cd_def'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION headline(oid, text, tsquery, text)
RETURNS text
AS 'MODULE_PATHNAME', 'headline'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION headline(oid, text, tsquery)
RETURNS text
AS 'MODULE_PATHNAME', 'headline'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION headline(text, text, tsquery, text)
RETURNS text
AS 'MODULE_PATHNAME', 'headline_byname'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION headline(text, text, tsquery)
RETURNS text
AS 'MODULE_PATHNAME', 'headline_byname'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION headline(text, tsquery, text)
RETURNS text
AS 'MODULE_PATHNAME', 'headline_current'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION headline(text, tsquery)
RETURNS text
AS 'MODULE_PATHNAME', 'headline_current'
LANGUAGE 'C' WITH (isstrict, iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
--GiST
--GiST key type
CREATE FUNCTION gtsvector_in(cstring)
RETURNS gtsvector
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gtsvector_out(gtsvector)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE gtsvector (
INTERNALLENGTH = -1,
@ -606,37 +606,37 @@ CREATE TYPE gtsvector (
CREATE FUNCTION gtsvector_consistent(gtsvector,internal,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtsvector_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtsvector_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtsvector_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gtsvector_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtsvector_union(internal, internal)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtsvector_same(gtsvector, gtsvector, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
-- CREATE the OPERATOR class
CREATE OPERATOR CLASS gist_tsvector_ops
@ -660,12 +660,12 @@ CREATE TYPE statinfo
--CREATE FUNCTION tsstat_in(cstring)
--RETURNS tsstat
--AS 'MODULE_PATHNAME'
--LANGUAGE 'C' with (isstrict);
--LANGUAGE C RETURNS NULL ON NULL INPUT;
--
--CREATE FUNCTION tsstat_out(tsstat)
--RETURNS cstring
--AS 'MODULE_PATHNAME'
--LANGUAGE 'C' with (isstrict);
--LANGUAGE C RETURNS NULL ON NULL INPUT;
--
--CREATE TYPE tsstat (
-- INTERNALLENGTH = -1,
@ -677,13 +677,13 @@ CREATE TYPE statinfo
--CREATE FUNCTION ts_accum(tsstat,tsvector)
--RETURNS tsstat
--AS 'MODULE_PATHNAME'
--LANGUAGE 'C' with (isstrict);
--LANGUAGE C RETURNS NULL ON NULL INPUT;
--
--CREATE FUNCTION ts_accum_finish(tsstat)
-- returns setof statinfo
-- RETURNS setof statinfo
-- as 'MODULE_PATHNAME'
-- language 'C'
-- with (isstrict);
-- LANGUAGE C
-- RETURNS NULL ON NULL INPUT;
--
--CREATE AGGREGATE stat (
-- BASETYPE=tsvector,
@ -694,30 +694,30 @@ CREATE TYPE statinfo
--);
CREATE FUNCTION stat(text)
returns setof statinfo
RETURNS setof statinfo
as 'MODULE_PATHNAME', 'ts_stat'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
CREATE FUNCTION stat(text,text)
returns setof statinfo
RETURNS setof statinfo
as 'MODULE_PATHNAME', 'ts_stat'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
--reset - just for debuging
CREATE FUNCTION reset_tsearch()
returns void
RETURNS void
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
--get cover (debug for rank_cd)
CREATE FUNCTION get_covers(tsvector,tsquery)
returns text
RETURNS text
as 'MODULE_PATHNAME'
language 'C'
with (isstrict);
LANGUAGE C
RETURNS NULL ON NULL INPUT;
--debug function
create type tsdebug as (
@ -729,13 +729,13 @@ create type tsdebug as (
"tsvector" tsvector
);
create function _get_parser_from_curcfg()
returns text as
CREATE FUNCTION _get_parser_from_curcfg()
RETURNS text as
' select prs_name from pg_ts_cfg where oid = show_curcfg() '
language 'SQL' with(isstrict,iscachable);
LANGUAGE SQL RETURNS NULL ON NULL INPUT IMMUTABLE;
create function ts_debug(text)
returns setof tsdebug as '
CREATE FUNCTION ts_debug(text)
RETURNS setof tsdebug as '
select
m.ts_name,
t.alias as tok_type,
@ -753,43 +753,43 @@ where
t.alias = m.tok_alias and
m.ts_name=c.ts_name and
c.oid=show_curcfg()
' language 'SQL' with(isstrict);
' LANGUAGE SQL RETURNS NULL ON NULL INPUT;
--compare functions
CREATE FUNCTION tsvector_cmp(tsvector,tsvector)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION tsvector_lt(tsvector,tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION tsvector_le(tsvector,tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION tsvector_eq(tsvector,tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION tsvector_ge(tsvector,tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION tsvector_gt(tsvector,tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE FUNCTION tsvector_ne(tsvector,tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR < (
LEFTARG = tsvector,
@ -866,37 +866,37 @@ CREATE OPERATOR CLASS tsvector_ops
CREATE OR REPLACE FUNCTION tsquery_cmp(tsquery,tsquery)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OR REPLACE FUNCTION tsquery_lt(tsquery,tsquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OR REPLACE FUNCTION tsquery_le(tsquery,tsquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OR REPLACE FUNCTION tsquery_eq(tsquery,tsquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OR REPLACE FUNCTION tsquery_ge(tsquery,tsquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OR REPLACE FUNCTION tsquery_gt(tsquery,tsquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OR REPLACE FUNCTION tsquery_ne(tsquery,tsquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict,iscachable);
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR < (
@ -972,16 +972,16 @@ CREATE OPERATOR CLASS tsquery_ops
FUNCTION 1 tsquery_cmp(tsquery, tsquery);
CREATE OR REPLACE FUNCTION numnode(tsquery)
returns int4
RETURNS int4
as 'MODULE_PATHNAME', 'tsquery_numnode'
language 'C'
with (isstrict,iscachable);
LANGUAGE C
RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OR REPLACE FUNCTION tsquery_and(tsquery,tsquery)
returns tsquery
RETURNS tsquery
as 'MODULE_PATHNAME', 'tsquery_and'
language 'C'
with (isstrict,iscachable);
LANGUAGE C
RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR && (
LEFTARG = tsquery,
@ -993,10 +993,10 @@ CREATE OPERATOR && (
);
CREATE OR REPLACE FUNCTION tsquery_or(tsquery,tsquery)
returns tsquery
RETURNS tsquery
as 'MODULE_PATHNAME', 'tsquery_or'
language 'C'
with (isstrict,iscachable);
LANGUAGE C
RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR || (
LEFTARG = tsquery,
@ -1008,10 +1008,10 @@ CREATE OPERATOR || (
);
CREATE OR REPLACE FUNCTION tsquery_not(tsquery)
returns tsquery
RETURNS tsquery
as 'MODULE_PATHNAME', 'tsquery_not'
language 'C'
with (isstrict,iscachable);
LANGUAGE C
RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR !! (
RIGHTARG = tsquery,
@ -1021,26 +1021,26 @@ CREATE OPERATOR !! (
--------------rewrite subsystem
CREATE OR REPLACE FUNCTION rewrite(tsquery, text)
returns tsquery
RETURNS tsquery
as 'MODULE_PATHNAME', 'tsquery_rewrite'
language 'C'
with (isstrict,iscachable);
LANGUAGE C
RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OR REPLACE FUNCTION rewrite(tsquery, tsquery, tsquery)
returns tsquery
RETURNS tsquery
as 'MODULE_PATHNAME', 'tsquery_rewrite_query'
language 'C'
with (isstrict,iscachable);
LANGUAGE C
RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OR REPLACE FUNCTION rewrite_accum(tsquery,tsquery[])
RETURNS tsquery
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE OR REPLACE FUNCTION rewrite_finish(tsquery)
returns tsquery
RETURNS tsquery
as 'MODULE_PATHNAME'
language 'C';
LANGUAGE C;
CREATE AGGREGATE rewrite (
BASETYPE=tsquery[],
@ -1050,16 +1050,16 @@ CREATE AGGREGATE rewrite (
);
CREATE OR REPLACE FUNCTION tsq_mcontains(tsquery, tsquery)
returns bool
RETURNS bool
as 'MODULE_PATHNAME'
language 'C'
with (isstrict,iscachable);
LANGUAGE C
RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OR REPLACE FUNCTION tsq_mcontained(tsquery, tsquery)
returns bool
RETURNS bool
as 'MODULE_PATHNAME'
language 'C'
with (isstrict,iscachable);
LANGUAGE C
RETURNS NULL ON NULL INPUT IMMUTABLE;
CREATE OPERATOR @ (
LEFTARG = tsquery,
@ -1084,12 +1084,12 @@ CREATE OPERATOR ~ (
CREATE FUNCTION gtsq_in(cstring)
RETURNS gtsq
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gtsq_out(gtsq)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE TYPE gtsq (
INTERNALLENGTH = 8,
@ -1100,37 +1100,37 @@ CREATE TYPE gtsq (
CREATE FUNCTION gtsq_consistent(gtsq,internal,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtsq_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtsq_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtsq_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' with (isstrict);
LANGUAGE C RETURNS NULL ON NULL INPUT;
CREATE FUNCTION gtsq_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtsq_union(bytea, internal)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION gtsq_same(gtsq, gtsq, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
LANGUAGE C;
CREATE OPERATOR CLASS gist_tp_tsquery_ops
DEFAULT FOR TYPE tsquery USING gist

View File

@ -1,32 +1,32 @@
--SQL for XML parser
CREATE OR REPLACE FUNCTION xml_valid(text) RETURNS bool
AS 'MODULE_PATHNAME' LANGUAGE 'c' STRICT IMMUTABLE;
AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xml_encode_special_chars(text) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE 'c' STRICT IMMUTABLE;
AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xpath_string(text,text) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE 'c' STRICT IMMUTABLE;
AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xpath_nodeset(text,text,text,text) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE 'c' STRICT IMMUTABLE;
AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xpath_number(text,text) RETURNS float4
AS 'MODULE_PATHNAME' LANGUAGE 'c' STRICT IMMUTABLE;
AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xpath_bool(text,text) RETURNS boolean
AS 'MODULE_PATHNAME' LANGUAGE 'c' STRICT IMMUTABLE;
AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
-- List function
CREATE OR REPLACE FUNCTION xpath_list(text,text,text) RETURNS text
AS 'MODULE_PATHNAME'
LANGUAGE 'c' STRICT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xpath_list(text,text) RETURNS text
AS 'SELECT xpath_list($1,$2,'','')' language 'SQL' STRICT IMMUTABLE;
AS 'SELECT xpath_list($1,$2,'','')' LANGUAGE SQL STRICT IMMUTABLE;
@ -34,17 +34,17 @@ AS 'SELECT xpath_list($1,$2,'','')' language 'SQL' STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xpath_nodeset(text,text) RETURNS text AS
'SELECT xpath_nodeset($1,$2,'''','''')' language 'SQL' STRICT IMMUTABLE;
'SELECT xpath_nodeset($1,$2,'''','''')' LANGUAGE SQL STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xpath_nodeset(text,text,text) RETURNS text AS
'SELECT xpath_nodeset($1,$2,'''',$3)' language 'SQL' STRICT IMMUTABLE;
'SELECT xpath_nodeset($1,$2,'''',$3)' LANGUAGE SQL STRICT IMMUTABLE;
-- Table function
CREATE OR REPLACE FUNCTION xpath_table(text,text,text,text,text) RETURNS setof record
AS 'MODULE_PATHNAME'
LANGUAGE 'c' STRICT STABLE;
LANGUAGE C STRICT STABLE;
-- XSLT functions
-- Delete from here to the end of the file if you are not compiling with
@ -52,9 +52,9 @@ CREATE OR REPLACE FUNCTION xpath_table(text,text,text,text,text) RETURNS setof r
CREATE OR REPLACE FUNCTION xslt_process(text,text,text) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE 'c' STRICT VOLATILE;
AS 'MODULE_PATHNAME' LANGUAGE C STRICT VOLATILE;
-- the function checks for the correct argument count
CREATE OR REPLACE FUNCTION xslt_process(text,text) RETURNS text
AS 'MODULE_PATHNAME' LANGUAGE 'c' STRICT IMMUTABLE;
AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.70 2005/11/21 12:49:31 alvherre Exp $
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.71 2006/02/27 16:09:49 petere Exp $
*
* DESCRIPTION
* These routines take the parse tree and pick out the
@ -632,7 +632,7 @@ CreateFunction(CreateFunctionStmt *stmt)
* In PostgreSQL versions before 6.5, the SQL name of the created
* function could not be different from the internal name, and
* "prosrc" wasn't used. So there is code out there that does CREATE
* FUNCTION xyz AS '' LANGUAGE 'internal'. To preserve some modicum of
* FUNCTION xyz AS '' LANGUAGE internal. To preserve some modicum of
* backwards compatibility, accept an empty "prosrc" value as meaning
* the supplied SQL function name.
*/

View File

@ -524,7 +524,7 @@ library, depending on whether or not you write a PG_FUNCTION_INFO_V1() for
each one.
The SQL declaration for a dynamically-loaded function is CREATE FUNCTION
foo ... LANGUAGE 'C' regardless of whether it is old- or new-style.
foo ... LANGUAGE C regardless of whether it is old- or new-style.
New-style dynamic functions will be invoked directly by fmgr, and will
therefore have the same performance as internal functions after the initial

View File

@ -4,7 +4,7 @@
# Makefile for utils/mb/conversion_procs
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.16 2006/02/18 16:15:22 petere Exp $
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.17 2006/02/27 16:09:49 petere Exp $
#
#-------------------------------------------------------------------------
@ -167,7 +167,7 @@ ifeq ($(enable_shared), yes)
func=$$1; shift; \
obj=$$1; shift; \
echo "-- $$se --> $$de"; \
echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE 'c' STRICT;"; \
echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT;"; \
echo "DROP CONVERSION pg_catalog.$$name;"; \
echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
done > $@

View File

@ -21,7 +21,7 @@ int main(int argc, char* argv[]) {
RAISE NOTICE 'TG_NAME=%, TG WHEN=%', TG_NAME, TG_WHEN;
RETURN NEW;
END; $test$
LANGUAGE 'plpgsql';
LANGUAGE plpgsql;
EXEC SQL CREATE TRIGGER My_Table_Check_Trigger
BEFORE INSERT

View File

@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plpgsql/src/scan.l,v 1.42 2005/06/26 19:16:07 tgl Exp $
* $PostgreSQL: pgsql/src/pl/plpgsql/src/scan.l,v 1.43 2006/02/27 16:09:50 petere Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@ -522,7 +522,7 @@ plpgsql_scanner_init(const char *str, int functype)
* Hack: skip any initial newline, so that in the common coding layout
* CREATE FUNCTION ... AS '
* code body
* ' LANGUAGE 'plpgsql';
* ' LANGUAGE plpgsql;
* we will think "line 1" is what the programmer thinks of as line 1.
*----------
*/

View File

@ -52,7 +52,7 @@ create function check_pkey1_exists(int4, bpchar) returns bool as '
return "t"
}
return "f"
' language 'pltcl';
' language pltcl;
--
-- Trigger function on every change to T_pkey1
--
@ -138,7 +138,7 @@ create function trig_pkey1_before() returns trigger as '
# Anything is fine - let operation pass through
#
return OK
' language 'pltcl';
' language pltcl;
create trigger pkey1_before before insert or update or delete on T_pkey1
for each row execute procedure
trig_pkey1_before();
@ -175,7 +175,7 @@ create function trig_pkey2_before() returns trigger as '
# Return modified tuple in NEW
#
return [array get NEW]
' language 'pltcl';
' language pltcl;
create trigger pkey2_before before insert or update on T_pkey2
for each row execute procedure
trig_pkey2_before();
@ -261,7 +261,7 @@ create function trig_pkey2_after() returns trigger as '
}
return OK
' language 'pltcl';
' language pltcl;
create trigger pkey2_after after update or delete on T_pkey2
for each row execute procedure
trig_pkey2_after();
@ -355,7 +355,7 @@ create function check_primkey() returns trigger as '
# Anything is fine
#
return OK
' language 'pltcl';
' language pltcl;
create trigger dta1_before before insert or update on T_dta1
for each row execute procedure
check_primkey('ref1', 'ref2', 'T_pkey1', 'key1', 'key2');
@ -364,7 +364,7 @@ create trigger dta2_before before insert or update on T_dta2
check_primkey('ref1', 'ref2', 'T_pkey2', 'key1', 'key2');
create function tcl_int4add(int4,int4) returns int4 as '
return [expr $1 + $2]
' language 'pltcl';
' language pltcl;
-- We use split(n) as a quick-and-dirty way of parsing the input array
-- value, which comes in as a string like '{1,2}'. There are better ways...
create function tcl_int4_accum(int4[], int4) returns int4[] as '
@ -372,12 +372,12 @@ create function tcl_int4_accum(int4[], int4) returns int4[] as '
set newsum [expr {[lindex $state 1] + $2}]
set newcnt [expr {[lindex $state 2] + 1}]
return "{$newsum,$newcnt}"
' language 'pltcl';
' language pltcl;
create function tcl_int4_avg(int4[]) returns int4 as '
set state [split $1 "{,}"]
if {[lindex $state 2] == 0} { return_null }
return [expr {[lindex $state 1] / [lindex $state 2]}]
' language 'pltcl';
' language pltcl;
create aggregate tcl_avg (
sfunc = tcl_int4_accum,
basetype = int4,
@ -396,7 +396,7 @@ create function tcl_int4lt(int4,int4) returns bool as '
return t
}
return f
' language 'pltcl';
' language pltcl;
create operator @< (
leftarg = int4,
rightarg = int4,

View File

@ -58,7 +58,7 @@ create function check_pkey1_exists(int4, bpchar) returns bool as '
return "t"
}
return "f"
' language 'pltcl';
' language pltcl;
--
@ -146,7 +146,7 @@ create function trig_pkey1_before() returns trigger as '
# Anything is fine - let operation pass through
#
return OK
' language 'pltcl';
' language pltcl;
create trigger pkey1_before before insert or update or delete on T_pkey1
@ -187,7 +187,7 @@ create function trig_pkey2_before() returns trigger as '
# Return modified tuple in NEW
#
return [array get NEW]
' language 'pltcl';
' language pltcl;
create trigger pkey2_before before insert or update on T_pkey2
@ -277,7 +277,7 @@ create function trig_pkey2_after() returns trigger as '
}
return OK
' language 'pltcl';
' language pltcl;
create trigger pkey2_after after update or delete on T_pkey2
@ -375,7 +375,7 @@ create function check_primkey() returns trigger as '
# Anything is fine
#
return OK
' language 'pltcl';
' language pltcl;
create trigger dta1_before before insert or update on T_dta1
@ -390,7 +390,7 @@ create trigger dta2_before before insert or update on T_dta2
create function tcl_int4add(int4,int4) returns int4 as '
return [expr $1 + $2]
' language 'pltcl';
' language pltcl;
-- We use split(n) as a quick-and-dirty way of parsing the input array
-- value, which comes in as a string like '{1,2}'. There are better ways...
@ -400,13 +400,13 @@ create function tcl_int4_accum(int4[], int4) returns int4[] as '
set newsum [expr {[lindex $state 1] + $2}]
set newcnt [expr {[lindex $state 2] + 1}]
return "{$newsum,$newcnt}"
' language 'pltcl';
' language pltcl;
create function tcl_int4_avg(int4[]) returns int4 as '
set state [split $1 "{,}"]
if {[lindex $state 2] == 0} { return_null }
return [expr {[lindex $state 1] / [lindex $state 2]}]
' language 'pltcl';
' language pltcl;
create aggregate tcl_avg (
sfunc = tcl_int4_accum,
@ -428,7 +428,7 @@ create function tcl_int4lt(int4,int4) returns bool as '
return t
}
return f
' language 'pltcl';
' language pltcl;
create operator @< (
leftarg = int4,

View File

@ -6,7 +6,7 @@
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.55 2005/12/09 21:19:36 petere Exp $
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.56 2006/02/27 16:09:50 petere Exp $
#
#-------------------------------------------------------------------------
@ -62,7 +62,7 @@ uninstall:
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress'
# Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE 'C'.
# Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE C.
NAME = regress
SO_MAJOR_VERSION= 0

View File

@ -11,13 +11,13 @@ CREATE FUNCTION fn_x_before () RETURNS TRIGGER AS '
NEW.e := ''before trigger fired''::text;
return NEW;
END;
' language 'plpgsql';
' LANGUAGE plpgsql;
CREATE FUNCTION fn_x_after () RETURNS TRIGGER AS '
BEGIN
UPDATE x set e=''after trigger fired'' where c=''stuff'';
return NULL;
END;
' language 'plpgsql';
' LANGUAGE plpgsql;
CREATE TRIGGER trg_x_after AFTER INSERT ON x
FOR EACH ROW EXECUTE PROCEDURE fn_x_after();
CREATE TRIGGER trg_x_before BEFORE INSERT ON x

View File

@ -18,24 +18,24 @@ CREATE TYPE city_budget (
CREATE FUNCTION int42_in(cstring)
RETURNS int42
AS 'int4in'
LANGUAGE 'internal' WITH (isStrict);
LANGUAGE internal STRICT;
NOTICE: type "int42" is not yet defined
DETAIL: Creating a shell type definition.
CREATE FUNCTION int42_out(int42)
RETURNS cstring
AS 'int4out'
LANGUAGE 'internal' WITH (isStrict);
LANGUAGE internal STRICT;
NOTICE: argument type int42 is only a shell
CREATE FUNCTION text_w_default_in(cstring)
RETURNS text_w_default
AS 'textin'
LANGUAGE 'internal' WITH (isStrict);
LANGUAGE internal STRICT;
NOTICE: type "text_w_default" is not yet defined
DETAIL: Creating a shell type definition.
CREATE FUNCTION text_w_default_out(text_w_default)
RETURNS cstring
AS 'textout'
LANGUAGE 'internal' WITH (isStrict);
LANGUAGE internal STRICT;
NOTICE: argument type text_w_default is only a shell
CREATE TYPE int42 (
internallength = 4,

View File

@ -100,7 +100,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_room_au after update
on Room for each row execute procedure tg_room_au();
-- ************************************************************
@ -112,7 +112,7 @@ begin
delete from WSlot where roomno = old.roomno;
return old;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_room_ad after delete
on Room for each row execute procedure tg_room_ad();
-- ************************************************************
@ -140,7 +140,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_pfield_au after update
on PField for each row execute procedure tg_pfield_au();
-- ************************************************************
@ -152,7 +152,7 @@ begin
delete from PSlot where pfname = old.name;
return old;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_pfield_ad after delete
on PField for each row execute procedure tg_pfield_ad();
-- ************************************************************
@ -184,7 +184,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_system_au after update
on System for each row execute procedure tg_system_au();
-- ************************************************************
@ -237,7 +237,7 @@ begin
return old;
end if;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_hub_a after insert or update or delete
on Hub for each row execute procedure tg_hub_a();
-- ************************************************************
@ -261,7 +261,7 @@ begin
end loop;
return 0;
end
' language 'plpgsql';
' language plpgsql;
-- Test comments
COMMENT ON FUNCTION tg_hub_adjustslots_wrong(bpchar, integer, integer) IS 'function with args';
ERROR: function tg_hub_adjustslots_wrong(character, integer, integer) does not exist
@ -301,7 +301,7 @@ begin
new.slotname := sname;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_hslot_biu before insert or update
on HSlot for each row execute procedure tg_hslot_biu();
-- ************************************************************
@ -321,7 +321,7 @@ begin
end if;
raise exception ''no manual manipulation of HSlot'';
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_hslot_bd before delete
on HSlot for each row execute procedure tg_hslot_bd();
-- ************************************************************
@ -335,7 +335,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_chkslotname before insert
on PSlot for each row execute procedure tg_chkslotname('PS');
create trigger tg_chkslotname before insert
@ -357,7 +357,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_chkslotlink before insert or update
on PSlot for each row execute procedure tg_chkslotlink();
create trigger tg_chkslotlink before insert or update
@ -379,7 +379,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_chkbacklink before insert or update
on PSlot for each row execute procedure tg_chkbacklink();
create trigger tg_chkbacklink before insert or update
@ -409,7 +409,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_pslot_bu before update
on PSlot for each row execute procedure tg_pslot_bu();
-- ************************************************************
@ -435,7 +435,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_wslot_bu before update
on WSlot for each row execute procedure tg_Wslot_bu();
-- ************************************************************
@ -461,7 +461,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_pline_bu before update
on PLine for each row execute procedure tg_pline_bu();
-- ************************************************************
@ -487,7 +487,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_iface_bu before update
on IFace for each row execute procedure tg_iface_bu();
-- ************************************************************
@ -513,7 +513,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_hslot_bu before update
on HSlot for each row execute procedure tg_hslot_bu();
-- ************************************************************
@ -537,7 +537,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_phone_bu before update
on PHone for each row execute procedure tg_phone_bu();
-- ************************************************************
@ -576,7 +576,7 @@ begin
return old;
end if;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_backlink_a after insert or update or delete
on PSlot for each row execute procedure tg_backlink_a('PS');
create trigger tg_backlink_a after insert or update or delete
@ -636,7 +636,7 @@ begin
end if;
raise exception ''illegal backlink beginning with %'', mytype;
end;
' language 'plpgsql';
' language plpgsql;
-- ************************************************************
-- * Support function to clear out the backlink field if
-- * it still points to specific slot
@ -718,7 +718,7 @@ begin
return old;
end if;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_slotlink_a after insert or update or delete
on PSlot for each row execute procedure tg_slotlink_a('PS');
create trigger tg_slotlink_a after insert or update or delete
@ -812,7 +812,7 @@ begin
end if;
raise exception ''illegal slotlink beginning with %'', mytype;
end;
' language 'plpgsql';
' language plpgsql;
-- ************************************************************
-- * Support function to clear out the slotlink field if
-- * it still points to specific slot
@ -877,7 +877,7 @@ begin
return 0;
end if;
end;
' language 'plpgsql';
' language plpgsql;
-- ************************************************************
-- * Describe the backside of a patchfield slot
-- ************************************************************
@ -920,7 +920,7 @@ begin
end if;
return rec.backlink;
end;
' language 'plpgsql';
' language plpgsql;
-- ************************************************************
-- * Describe the front of a patchfield slot
-- ************************************************************
@ -954,7 +954,7 @@ begin
end if;
return psrec.slotlink;
end;
' language 'plpgsql';
' language plpgsql;
-- ************************************************************
-- * Describe the front of a wall connector slot
-- ************************************************************
@ -1002,7 +1002,7 @@ begin
end if;
return rec.slotlink;
end;
' language 'plpgsql';
' language plpgsql;
-- ************************************************************
-- * View of a patchfield describing backside and patches
-- ************************************************************
@ -1555,7 +1555,7 @@ BEGIN
rslt = CAST($1 AS TEXT) || '','' || recursion_test($1 - 1, $2);
END IF;
RETURN rslt;
END;' LANGUAGE 'plpgsql';
END;' LANGUAGE plpgsql;
SELECT recursion_test(4,3);
recursion_test
----------------
@ -1600,7 +1600,7 @@ create function test_found()
insert into found_test_tbl values (6);
end if;
return true;
end;' language 'plpgsql';
end;' language plpgsql;
select test_found();
test_found
------------
@ -1629,7 +1629,7 @@ BEGIN
RETURN NEXT rec;
END LOOP;
RETURN;
END;' language 'plpgsql';
END;' language plpgsql;
select * from test_table_func_rec();
a
-----
@ -1649,7 +1649,7 @@ BEGIN
RETURN NEXT row;
END LOOP;
RETURN;
END;' language 'plpgsql';
END;' language plpgsql;
select * from test_table_func_row();
a
-----
@ -1669,7 +1669,7 @@ BEGIN
RETURN NEXT i + 1;
END LOOP;
RETURN;
END;' language 'plpgsql';
END;' language plpgsql;
select * from test_ret_set_scalar(1,10);
test_ret_set_scalar
---------------------
@ -1699,7 +1699,7 @@ BEGIN
RETURN NEXT retval;
END IF;
RETURN;
END;' language 'plpgsql';
END;' language plpgsql;
SELECT * FROM test_ret_set_rec_dyn(1500) AS (a int, b int, c int);
a | b | c
---+----+----
@ -1725,7 +1725,7 @@ BEGIN
SELECT INTO retval 50, 5::numeric, ''xxx''::text;
RETURN retval;
END IF;
END;' language 'plpgsql';
END;' language plpgsql;
SELECT * FROM test_ret_rec_dyn(1500) AS (a int, b int, c int);
a | b | c
---+----+----
@ -1870,7 +1870,7 @@ BEGIN
ELSE
RETURN FALSE;
END IF;
END;' language 'plpgsql';
END;' language plpgsql;
create function perform_test_func() returns void as '
BEGIN
IF FOUND then
@ -1890,7 +1890,7 @@ BEGIN
END IF;
RETURN;
END;' language 'plpgsql';
END;' language plpgsql;
SELECT perform_test_func();
perform_test_func
-------------------
@ -2230,13 +2230,13 @@ begin
open rc for select a from rc_test;
return rc;
end
$$ language 'plpgsql';
$$ language plpgsql;
create function refcursor_test1(refcursor) returns refcursor as $$
begin
perform return_refcursor($1);
return $1;
end
$$ language 'plpgsql';
$$ language plpgsql;
begin;
select refcursor_test1('test1');
refcursor_test1
@ -2282,7 +2282,7 @@ begin
return false;
end if;
end
$$ language 'plpgsql';
$$ language plpgsql;
select refcursor_test2(20000, 20000) as "Should be false",
refcursor_test2(20, 20) as "Should be true";
Should be false | Should be true

View File

@ -33,29 +33,29 @@
-- argument polymorphism, but within the constraints of valid aggregate
-- functions, i.e. tf arg1 and tf return type must match
-- polymorphic single arg transfn
CREATE FUNCTION stfp(anyarray) returns anyarray as
'select $1' language 'sql';
CREATE FUNCTION stfp(anyarray) RETURNS anyarray AS
'select $1' LANGUAGE SQL;
-- non-polymorphic single arg transfn
CREATE FUNCTION stfnp(int[]) returns int[] as
'select $1' language 'sql';
CREATE FUNCTION stfnp(int[]) RETURNS int[] AS
'select $1' LANGUAGE SQL;
-- dual polymorphic transfn
CREATE FUNCTION tfp(anyarray,anyelement) returns anyarray as
'select $1 || $2' language 'sql';
CREATE FUNCTION tfp(anyarray,anyelement) RETURNS anyarray AS
'select $1 || $2' LANGUAGE SQL;
-- dual non-polymorphic transfn
CREATE FUNCTION tfnp(int[],int) returns int[] as
'select $1 || $2' language 'sql';
CREATE FUNCTION tfnp(int[],int) RETURNS int[] AS
'select $1 || $2' LANGUAGE SQL;
-- arg1 only polymorphic transfn
CREATE FUNCTION tf1p(anyarray,int) returns anyarray as
'select $1' language 'sql';
CREATE FUNCTION tf1p(anyarray,int) RETURNS anyarray AS
'select $1' LANGUAGE SQL;
-- arg2 only polymorphic transfn
CREATE FUNCTION tf2p(int[],anyelement) returns int[] as
'select $1' language 'sql';
CREATE FUNCTION tf2p(int[],anyelement) RETURNS int[] AS
'select $1' LANGUAGE SQL;
-- finalfn polymorphic
CREATE FUNCTION ffp(anyarray) returns anyarray as
'select $1' language 'sql';
CREATE FUNCTION ffp(anyarray) RETURNS anyarray AS
'select $1' LANGUAGE SQL;
-- finalfn non-polymorphic
CREATE FUNCTION ffnp(int[]) returns int[] as
'select $1' language 'sql';
'select $1' LANGUAGE SQL;
-- Try to cover all the possible states:
--
-- Note: in Cases 1 & 2, we are trying to return P. Therefore, if the transfn

View File

@ -779,7 +779,7 @@ BEGIN;
CREATE FUNCTION declares_cursor(text)
RETURNS void
AS 'DECLARE c CURSOR FOR SELECT stringu1 FROM tenk1 WHERE stringu1 LIKE $1;'
LANGUAGE 'sql';
LANGUAGE SQL;
SELECT declares_cursor('AB%');
declares_cursor
-----------------

View File

@ -188,7 +188,7 @@ SELECT * FROM vw_getfoo;
-- plpgsql, proretset = f, prorettype = b
DROP VIEW vw_getfoo;
DROP FUNCTION getfoo(int);
CREATE FUNCTION getfoo(int) RETURNS int AS 'DECLARE fooint int; BEGIN SELECT fooid into fooint FROM foo WHERE fooid = $1; RETURN fooint; END;' LANGUAGE 'plpgsql';
CREATE FUNCTION getfoo(int) RETURNS int AS 'DECLARE fooint int; BEGIN SELECT fooid into fooint FROM foo WHERE fooid = $1; RETURN fooint; END;' LANGUAGE plpgsql;
SELECT * FROM getfoo(1) AS t1;
t1
----
@ -205,7 +205,7 @@ SELECT * FROM vw_getfoo;
-- plpgsql, proretset = f, prorettype = c
DROP VIEW vw_getfoo;
DROP FUNCTION getfoo(int);
CREATE FUNCTION getfoo(int) RETURNS foo AS 'DECLARE footup foo%ROWTYPE; BEGIN SELECT * into footup FROM foo WHERE fooid = $1; RETURN footup; END;' LANGUAGE 'plpgsql';
CREATE FUNCTION getfoo(int) RETURNS foo AS 'DECLARE footup foo%ROWTYPE; BEGIN SELECT * into footup FROM foo WHERE fooid = $1; RETURN footup; END;' LANGUAGE plpgsql;
SELECT * FROM getfoo(1) AS t1;
fooid | foosubid | fooname
-------+----------+---------

View File

@ -764,7 +764,7 @@ create view rtest_vview4 as select X.a, X.b, count(Y.a) as refcount
group by X.a, X.b;
create function rtest_viewfunc1(int4) returns int4 as
'select count(*)::int4 from rtest_view2 where a = $1'
language 'sql';
language sql;
create view rtest_vview5 as select a, b, rtest_viewfunc1(a) as refcount
from rtest_view1;
insert into rtest_view1 values (1, 'item 1', 't');

View File

@ -276,7 +276,7 @@ drop sequence ttdummy_seq;
CREATE TABLE log_table (tstamp timestamp default timeofday()::timestamp);
CREATE TABLE main_table (a int, b int);
COPY main_table (a,b) FROM stdin;
CREATE FUNCTION trigger_func() RETURNS trigger LANGUAGE 'plpgsql' AS '
CREATE FUNCTION trigger_func() RETURNS trigger LANGUAGE plpgsql AS '
BEGIN
RAISE NOTICE ''trigger_func() called: action = %, when = %, level = %'', TG_OP, TG_WHEN, TG_LEVEL;
RETURN NULL;

View File

@ -5,74 +5,74 @@
CREATE FUNCTION widget_in(cstring)
RETURNS widget
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE FUNCTION widget_out(widget)
RETURNS cstring
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE FUNCTION int44in(cstring)
RETURNS city_budget
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE FUNCTION int44out(city_budget)
RETURNS cstring
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
CREATE FUNCTION check_primary_key ()
RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION check_foreign_key ()
RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION autoinc ()
RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION funny_dup17 ()
RETURNS trigger
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION ttdummy ()
RETURNS trigger
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION set_ttdummy (int4)
RETURNS int4
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
-- Things that shouldn't work:
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
AS 'SELECT ''not an integer'';';
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
AS 'not even SQL';
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
AS 'SELECT 1, 2, 3;';
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
AS 'SELECT $2;';
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
AS 'a', 'b';
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE c
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C
AS 'nosuchfile';
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE c
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C
AS '@abs_builddir@/regress@DLSUFFIX@', 'nosuchsymbol';
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE internal

View File

@ -4,25 +4,25 @@
CREATE FUNCTION hobbies(person)
RETURNS setof hobbies_r
AS 'select * from hobbies_r where person = $1.name'
LANGUAGE 'sql';
LANGUAGE SQL;
CREATE FUNCTION hobby_construct(text, text)
RETURNS hobbies_r
AS 'select $1 as name, $2 as hobby'
LANGUAGE 'sql';
LANGUAGE SQL;
CREATE FUNCTION hobbies_by_name(hobbies_r.name%TYPE)
RETURNS hobbies_r.person%TYPE
AS 'select person from hobbies_r where name = $1'
LANGUAGE 'sql';
LANGUAGE SQL;
CREATE FUNCTION equipment(hobbies_r)
RETURNS setof equipment_r
AS 'select * from equipment_r where hobby = $1.name'
LANGUAGE 'sql';
LANGUAGE SQL;
CREATE FUNCTION user_relns()
@ -32,37 +32,37 @@ CREATE FUNCTION user_relns()
where relnamespace = n.oid and
(nspname !~ ''pg_.*'' and nspname <> ''information_schema'') and
relkind <> ''i'' '
LANGUAGE 'sql';
LANGUAGE SQL;
CREATE FUNCTION pt_in_widget(point, widget)
RETURNS bool
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION overpaid(emp)
RETURNS bool
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION boxarea(box)
RETURNS float8
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION interpt_pp(path, path)
RETURNS point
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION reverse_name(name)
RETURNS name
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
LANGUAGE C;
CREATE FUNCTION oldstyle_length(int4, text)
RETURNS int4
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
LANGUAGE C;
--
-- Function dynamic loading

View File

@ -4,76 +4,76 @@
CREATE FUNCTION widget_in(cstring)
RETURNS widget
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
NOTICE: type "widget" is not yet defined
DETAIL: Creating a shell type definition.
CREATE FUNCTION widget_out(widget)
RETURNS cstring
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
NOTICE: argument type widget is only a shell
CREATE FUNCTION int44in(cstring)
RETURNS city_budget
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
NOTICE: type "city_budget" is not yet defined
DETAIL: Creating a shell type definition.
CREATE FUNCTION int44out(city_budget)
RETURNS cstring
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
NOTICE: argument type city_budget is only a shell
CREATE FUNCTION check_primary_key ()
RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION check_foreign_key ()
RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION autoinc ()
RETURNS trigger
AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION funny_dup17 ()
RETURNS trigger
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION ttdummy ()
RETURNS trigger
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION set_ttdummy (int4)
RETURNS int4
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C' STRICT;
LANGUAGE C STRICT;
-- Things that shouldn't work:
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
AS 'SELECT ''not an integer'';';
ERROR: return type mismatch in function declared to return integer
DETAIL: Actual return type is "unknown".
CONTEXT: SQL function "test1"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
AS 'not even SQL';
ERROR: syntax error at or near "not" at character 62
LINE 2: AS 'not even SQL';
^
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
AS 'SELECT 1, 2, 3;';
ERROR: return type mismatch in function declared to return integer
DETAIL: Final SELECT must return exactly one column.
CONTEXT: SQL function "test1"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
AS 'SELECT $2;';
ERROR: there is no parameter $2
CONTEXT: SQL function "test1"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE sql
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL
AS 'a', 'b';
ERROR: only one AS item needed for language "sql"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE c
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C
AS 'nosuchfile';
ERROR: could not access file "nosuchfile": No such file or directory
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE c
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C
AS '@abs_builddir@/regress@DLSUFFIX@', 'nosuchsymbol';
ERROR: could not find function "nosuchsymbol" in file "@abs_builddir@/regress@DLSUFFIX@"
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE internal

View File

@ -4,21 +4,21 @@
CREATE FUNCTION hobbies(person)
RETURNS setof hobbies_r
AS 'select * from hobbies_r where person = $1.name'
LANGUAGE 'sql';
LANGUAGE SQL;
CREATE FUNCTION hobby_construct(text, text)
RETURNS hobbies_r
AS 'select $1 as name, $2 as hobby'
LANGUAGE 'sql';
LANGUAGE SQL;
CREATE FUNCTION hobbies_by_name(hobbies_r.name%TYPE)
RETURNS hobbies_r.person%TYPE
AS 'select person from hobbies_r where name = $1'
LANGUAGE 'sql';
LANGUAGE SQL;
NOTICE: type reference hobbies_r.name%TYPE converted to text
NOTICE: type reference hobbies_r.person%TYPE converted to text
CREATE FUNCTION equipment(hobbies_r)
RETURNS setof equipment_r
AS 'select * from equipment_r where hobby = $1.name'
LANGUAGE 'sql';
LANGUAGE SQL;
CREATE FUNCTION user_relns()
RETURNS setof name
AS 'select relname
@ -26,31 +26,31 @@ CREATE FUNCTION user_relns()
where relnamespace = n.oid and
(nspname !~ ''pg_.*'' and nspname <> ''information_schema'') and
relkind <> ''i'' '
LANGUAGE 'sql';
LANGUAGE SQL;
CREATE FUNCTION pt_in_widget(point, widget)
RETURNS bool
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION overpaid(emp)
RETURNS bool
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION boxarea(box)
RETURNS float8
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION interpt_pp(path, path)
RETURNS point
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'C';
LANGUAGE C;
CREATE FUNCTION reverse_name(name)
RETURNS name
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
LANGUAGE C;
CREATE FUNCTION oldstyle_length(int4, text)
RETURNS int4
AS '@abs_builddir@/regress@DLSUFFIX@'
LANGUAGE 'c';
LANGUAGE C;
--
-- Function dynamic loading
--

View File

@ -11,14 +11,14 @@ CREATE FUNCTION fn_x_before () RETURNS TRIGGER AS '
NEW.e := ''before trigger fired''::text;
return NEW;
END;
' language 'plpgsql';
' LANGUAGE plpgsql;
CREATE FUNCTION fn_x_after () RETURNS TRIGGER AS '
BEGIN
UPDATE x set e=''after trigger fired'' where c=''stuff'';
return NULL;
END;
' language 'plpgsql';
' LANGUAGE plpgsql;
CREATE TRIGGER trg_x_after AFTER INSERT ON x
FOR EACH ROW EXECUTE PROCEDURE fn_x_after();

View File

@ -22,19 +22,19 @@ CREATE TYPE city_budget (
CREATE FUNCTION int42_in(cstring)
RETURNS int42
AS 'int4in'
LANGUAGE 'internal' WITH (isStrict);
LANGUAGE internal STRICT;
CREATE FUNCTION int42_out(int42)
RETURNS cstring
AS 'int4out'
LANGUAGE 'internal' WITH (isStrict);
LANGUAGE internal STRICT;
CREATE FUNCTION text_w_default_in(cstring)
RETURNS text_w_default
AS 'textin'
LANGUAGE 'internal' WITH (isStrict);
LANGUAGE internal STRICT;
CREATE FUNCTION text_w_default_out(text_w_default)
RETURNS cstring
AS 'textout'
LANGUAGE 'internal' WITH (isStrict);
LANGUAGE internal STRICT;
CREATE TYPE int42 (
internallength = 4,

View File

@ -134,7 +134,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_room_au after update
on Room for each row execute procedure tg_room_au();
@ -149,7 +149,7 @@ begin
delete from WSlot where roomno = old.roomno;
return old;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_room_ad after delete
on Room for each row execute procedure tg_room_ad();
@ -183,7 +183,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_pfield_au after update
on PField for each row execute procedure tg_pfield_au();
@ -198,7 +198,7 @@ begin
delete from PSlot where pfname = old.name;
return old;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_pfield_ad after delete
on PField for each row execute procedure tg_pfield_ad();
@ -236,7 +236,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_system_au after update
on System for each row execute procedure tg_system_au();
@ -295,7 +295,7 @@ begin
return old;
end if;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_hub_a after insert or update or delete
on Hub for each row execute procedure tg_hub_a();
@ -322,7 +322,7 @@ begin
end loop;
return 0;
end
' language 'plpgsql';
' language plpgsql;
-- Test comments
COMMENT ON FUNCTION tg_hub_adjustslots_wrong(bpchar, integer, integer) IS 'function with args';
@ -363,7 +363,7 @@ begin
new.slotname := sname;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_hslot_biu before insert or update
on HSlot for each row execute procedure tg_hslot_biu();
@ -386,7 +386,7 @@ begin
end if;
raise exception ''no manual manipulation of HSlot'';
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_hslot_bd before delete
on HSlot for each row execute procedure tg_hslot_bd();
@ -403,7 +403,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_chkslotname before insert
on PSlot for each row execute procedure tg_chkslotname('PS');
@ -432,7 +432,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_chkslotlink before insert or update
on PSlot for each row execute procedure tg_chkslotlink();
@ -461,7 +461,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_chkbacklink before insert or update
on PSlot for each row execute procedure tg_chkbacklink();
@ -496,7 +496,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_pslot_bu before update
on PSlot for each row execute procedure tg_pslot_bu();
@ -525,7 +525,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_wslot_bu before update
on WSlot for each row execute procedure tg_Wslot_bu();
@ -554,7 +554,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_pline_bu before update
on PLine for each row execute procedure tg_pline_bu();
@ -583,7 +583,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_iface_bu before update
on IFace for each row execute procedure tg_iface_bu();
@ -612,7 +612,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_hslot_bu before update
on HSlot for each row execute procedure tg_hslot_bu();
@ -639,7 +639,7 @@ begin
end if;
return new;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_phone_bu before update
on PHone for each row execute procedure tg_phone_bu();
@ -681,7 +681,7 @@ begin
return old;
end if;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_backlink_a after insert or update or delete
@ -747,7 +747,7 @@ begin
end if;
raise exception ''illegal backlink beginning with %'', mytype;
end;
' language 'plpgsql';
' language plpgsql;
-- ************************************************************
@ -833,7 +833,7 @@ begin
return old;
end if;
end;
' language 'plpgsql';
' language plpgsql;
create trigger tg_slotlink_a after insert or update or delete
@ -935,7 +935,7 @@ begin
end if;
raise exception ''illegal slotlink beginning with %'', mytype;
end;
' language 'plpgsql';
' language plpgsql;
-- ************************************************************
@ -1002,7 +1002,7 @@ begin
return 0;
end if;
end;
' language 'plpgsql';
' language plpgsql;
-- ************************************************************
@ -1047,7 +1047,7 @@ begin
end if;
return rec.backlink;
end;
' language 'plpgsql';
' language plpgsql;
-- ************************************************************
@ -1083,7 +1083,7 @@ begin
end if;
return psrec.slotlink;
end;
' language 'plpgsql';
' language plpgsql;
-- ************************************************************
@ -1133,7 +1133,7 @@ begin
end if;
return rec.slotlink;
end;
' language 'plpgsql';
' language plpgsql;
@ -1437,7 +1437,7 @@ BEGIN
rslt = CAST($1 AS TEXT) || '','' || recursion_test($1 - 1, $2);
END IF;
RETURN rslt;
END;' LANGUAGE 'plpgsql';
END;' LANGUAGE plpgsql;
SELECT recursion_test(4,3);
@ -1480,7 +1480,7 @@ create function test_found()
insert into found_test_tbl values (6);
end if;
return true;
end;' language 'plpgsql';
end;' language plpgsql;
select test_found();
select * from found_test_tbl;
@ -1497,7 +1497,7 @@ BEGIN
RETURN NEXT rec;
END LOOP;
RETURN;
END;' language 'plpgsql';
END;' language plpgsql;
select * from test_table_func_rec();
@ -1509,7 +1509,7 @@ BEGIN
RETURN NEXT row;
END LOOP;
RETURN;
END;' language 'plpgsql';
END;' language plpgsql;
select * from test_table_func_row();
@ -1521,7 +1521,7 @@ BEGIN
RETURN NEXT i + 1;
END LOOP;
RETURN;
END;' language 'plpgsql';
END;' language plpgsql;
select * from test_ret_set_scalar(1,10);
@ -1539,7 +1539,7 @@ BEGIN
RETURN NEXT retval;
END IF;
RETURN;
END;' language 'plpgsql';
END;' language plpgsql;
SELECT * FROM test_ret_set_rec_dyn(1500) AS (a int, b int, c int);
SELECT * FROM test_ret_set_rec_dyn(5) AS (a int, b numeric, c text);
@ -1555,7 +1555,7 @@ BEGIN
SELECT INTO retval 50, 5::numeric, ''xxx''::text;
RETURN retval;
END IF;
END;' language 'plpgsql';
END;' language plpgsql;
SELECT * FROM test_ret_rec_dyn(1500) AS (a int, b int, c int);
SELECT * FROM test_ret_rec_dyn(5) AS (a int, b numeric, c text);
@ -1658,7 +1658,7 @@ BEGIN
ELSE
RETURN FALSE;
END IF;
END;' language 'plpgsql';
END;' language plpgsql;
create function perform_test_func() returns void as '
BEGIN
@ -1679,7 +1679,7 @@ BEGIN
END IF;
RETURN;
END;' language 'plpgsql';
END;' language plpgsql;
SELECT perform_test_func();
SELECT * FROM perform_test;
@ -1904,14 +1904,14 @@ begin
open rc for select a from rc_test;
return rc;
end
$$ language 'plpgsql';
$$ language plpgsql;
create function refcursor_test1(refcursor) returns refcursor as $$
begin
perform return_refcursor($1);
return $1;
end
$$ language 'plpgsql';
$$ language plpgsql;
begin;
@ -1940,7 +1940,7 @@ begin
return false;
end if;
end
$$ language 'plpgsql';
$$ language plpgsql;
select refcursor_test2(20000, 20000) as "Should be false",
refcursor_test2(20, 20) as "Should be true";

View File

@ -37,32 +37,32 @@
-- functions, i.e. tf arg1 and tf return type must match
-- polymorphic single arg transfn
CREATE FUNCTION stfp(anyarray) returns anyarray as
'select $1' language 'sql';
CREATE FUNCTION stfp(anyarray) RETURNS anyarray AS
'select $1' LANGUAGE SQL;
-- non-polymorphic single arg transfn
CREATE FUNCTION stfnp(int[]) returns int[] as
'select $1' language 'sql';
CREATE FUNCTION stfnp(int[]) RETURNS int[] AS
'select $1' LANGUAGE SQL;
-- dual polymorphic transfn
CREATE FUNCTION tfp(anyarray,anyelement) returns anyarray as
'select $1 || $2' language 'sql';
CREATE FUNCTION tfp(anyarray,anyelement) RETURNS anyarray AS
'select $1 || $2' LANGUAGE SQL;
-- dual non-polymorphic transfn
CREATE FUNCTION tfnp(int[],int) returns int[] as
'select $1 || $2' language 'sql';
CREATE FUNCTION tfnp(int[],int) RETURNS int[] AS
'select $1 || $2' LANGUAGE SQL;
-- arg1 only polymorphic transfn
CREATE FUNCTION tf1p(anyarray,int) returns anyarray as
'select $1' language 'sql';
CREATE FUNCTION tf1p(anyarray,int) RETURNS anyarray AS
'select $1' LANGUAGE SQL;
-- arg2 only polymorphic transfn
CREATE FUNCTION tf2p(int[],anyelement) returns int[] as
'select $1' language 'sql';
CREATE FUNCTION tf2p(int[],anyelement) RETURNS int[] AS
'select $1' LANGUAGE SQL;
-- finalfn polymorphic
CREATE FUNCTION ffp(anyarray) returns anyarray as
'select $1' language 'sql';
CREATE FUNCTION ffp(anyarray) RETURNS anyarray AS
'select $1' LANGUAGE SQL;
-- finalfn non-polymorphic
CREATE FUNCTION ffnp(int[]) returns int[] as
'select $1' language 'sql';
'select $1' LANGUAGE SQL;
-- Try to cover all the possible states:
--

View File

@ -239,7 +239,7 @@ BEGIN;
CREATE FUNCTION declares_cursor(text)
RETURNS void
AS 'DECLARE c CURSOR FOR SELECT stringu1 FROM tenk1 WHERE stringu1 LIKE $1;'
LANGUAGE 'sql';
LANGUAGE SQL;
SELECT declares_cursor('AB%');

View File

@ -86,7 +86,7 @@ SELECT * FROM vw_getfoo;
-- plpgsql, proretset = f, prorettype = b
DROP VIEW vw_getfoo;
DROP FUNCTION getfoo(int);
CREATE FUNCTION getfoo(int) RETURNS int AS 'DECLARE fooint int; BEGIN SELECT fooid into fooint FROM foo WHERE fooid = $1; RETURN fooint; END;' LANGUAGE 'plpgsql';
CREATE FUNCTION getfoo(int) RETURNS int AS 'DECLARE fooint int; BEGIN SELECT fooid into fooint FROM foo WHERE fooid = $1; RETURN fooint; END;' LANGUAGE plpgsql;
SELECT * FROM getfoo(1) AS t1;
CREATE VIEW vw_getfoo AS SELECT * FROM getfoo(1);
SELECT * FROM vw_getfoo;
@ -94,7 +94,7 @@ SELECT * FROM vw_getfoo;
-- plpgsql, proretset = f, prorettype = c
DROP VIEW vw_getfoo;
DROP FUNCTION getfoo(int);
CREATE FUNCTION getfoo(int) RETURNS foo AS 'DECLARE footup foo%ROWTYPE; BEGIN SELECT * into footup FROM foo WHERE fooid = $1; RETURN footup; END;' LANGUAGE 'plpgsql';
CREATE FUNCTION getfoo(int) RETURNS foo AS 'DECLARE footup foo%ROWTYPE; BEGIN SELECT * into footup FROM foo WHERE fooid = $1; RETURN footup; END;' LANGUAGE plpgsql;
SELECT * FROM getfoo(1) AS t1;
CREATE VIEW vw_getfoo AS SELECT * FROM getfoo(1);
SELECT * FROM vw_getfoo;

View File

@ -431,7 +431,7 @@ create view rtest_vview4 as select X.a, X.b, count(Y.a) as refcount
group by X.a, X.b;
create function rtest_viewfunc1(int4) returns int4 as
'select count(*)::int4 from rtest_view2 where a = $1'
language 'sql';
language sql;
create view rtest_vview5 as select a, b, rtest_viewfunc1(a) as refcount
from rtest_view1;

View File

@ -218,7 +218,7 @@ COPY main_table (a,b) FROM stdin;
80 15
\.
CREATE FUNCTION trigger_func() RETURNS trigger LANGUAGE 'plpgsql' AS '
CREATE FUNCTION trigger_func() RETURNS trigger LANGUAGE plpgsql AS '
BEGIN
RAISE NOTICE ''trigger_func() called: action = %, when = %, level = %'', TG_OP, TG_WHEN, TG_LEVEL;
RETURN NULL;

View File

@ -6,7 +6,7 @@
--
-- Copyright (c) 1994-5, Regents of the University of California
--
-- $PostgreSQL: pgsql/src/tutorial/funcs.source,v 1.7 2003/11/29 22:41:33 pgsql Exp $
-- $PostgreSQL: pgsql/src/tutorial/funcs.source,v 1.8 2006/02/27 16:09:50 petere Exp $
--
---------------------------------------------------------------------------
@ -21,8 +21,8 @@
-- let's create a simple SQL function that takes no arguments and
-- returns 1
CREATE FUNCTION one() RETURNS int4
AS 'SELECT 1 as ONE' LANGUAGE 'sql';
CREATE FUNCTION one() RETURNS integer
AS 'SELECT 1 as ONE' LANGUAGE SQL;
--
-- functions can be used in any expressions (eg. in the target list or
@ -34,8 +34,8 @@ SELECT one() AS answer;
-- here's how you create a function that takes arguments. The following
-- function returns the sum of its two arguments:
CREATE FUNCTION add_em(int4, int4) RETURNS int4
AS 'SELECT $1 + $2' LANGUAGE 'sql';
CREATE FUNCTION add_em(integer, integer) RETURNS integer
AS 'SELECT $1 + $2' LANGUAGE SQL;
SELECT add_em(1, 2) AS answer;
@ -50,8 +50,8 @@ SELECT add_em(1, 2) AS answer;
CREATE TABLE EMP (
name text,
salary int4,
age int4,
salary integer,
age integer,
cubicle point
);
@ -64,8 +64,8 @@ INSERT INTO EMP VALUES ('Ginger', 4800, 30, '(2,4)');
-- the argument of a function can also be a tuple. For instance,
-- double_salary takes a tuple of the EMP table
CREATE FUNCTION double_salary(EMP) RETURNS int4
AS 'SELECT $1.salary * 2 AS salary' LANGUAGE 'sql';
CREATE FUNCTION double_salary(EMP) RETURNS integer
AS 'SELECT $1.salary * 2 AS salary' LANGUAGE SQL;
SELECT name, double_salary(EMP) AS dream
FROM EMP
@ -80,7 +80,7 @@ CREATE FUNCTION new_emp() RETURNS EMP
1000 AS salary,
25 AS age,
\'(2,2)\'::point AS cubicle'
LANGUAGE 'sql';
LANGUAGE SQL;
-- you can then project a column out of resulting the tuple by using the
-- "function notation" for projection columns. (ie. bar(foo) is equivalent
@ -91,7 +91,7 @@ SELECT name(new_emp()) AS nobody;
-- let's try one more function that returns tuples
CREATE FUNCTION high_pay() RETURNS setof EMP
AS 'SELECT * FROM EMP where salary > 1500'
LANGUAGE 'sql';
LANGUAGE SQL;
SELECT name(high_pay()) AS overpaid;
@ -109,10 +109,10 @@ SELECT name(high_pay()) AS overpaid;
--
-- SELECT * FROM EMP;
--
-- CREATE FUNCTION clean_EMP () RETURNS int4
-- CREATE FUNCTION clean_EMP () RETURNS integer
-- AS 'DELETE FROM EMP WHERE EMP.salary <= 0\;
-- SELECT 1 AS ignore_this'
-- LANGUAGE 'sql';
-- LANGUAGE SQL;
--
-- SELECT clean_EMP();
--
@ -125,17 +125,17 @@ SELECT name(high_pay()) AS overpaid;
-- See funcs.c for the definition of the C functions.
-----------------------------
CREATE FUNCTION add_one(int4) RETURNS int4
AS '_OBJWD_/funcs' LANGUAGE 'c';
CREATE FUNCTION add_one(integer) RETURNS integer
AS '_OBJWD_/funcs' LANGUAGE C;
CREATE FUNCTION makepoint(point, point) RETURNS point
AS '_OBJWD_/funcs' LANGUAGE 'c';
AS '_OBJWD_/funcs' LANGUAGE C;
CREATE FUNCTION copytext(text) RETURNS text
AS '_OBJWD_/funcs' LANGUAGE 'c';
AS '_OBJWD_/funcs' LANGUAGE C;
CREATE FUNCTION c_overpaid(EMP, int4) RETURNS bool
AS '_OBJWD_/funcs' LANGUAGE 'c';
CREATE FUNCTION c_overpaid(EMP, integer) RETURNS boolean
AS '_OBJWD_/funcs' LANGUAGE C;
SELECT add_one(3) AS four;
@ -149,14 +149,14 @@ WHERE name = 'Bill' or name = 'Sam';
-- remove functions that were created in this file
DROP FUNCTION c_overpaid(EMP, int4);
DROP FUNCTION c_overpaid(EMP, integer);
DROP FUNCTION copytext(text);
DROP FUNCTION makepoint(point,point);
DROP FUNCTION add_one(int4);
DROP FUNCTION makepoint(point, point);
DROP FUNCTION add_one(integer);
--DROP FUNCTION clean_EMP();
DROP FUNCTION high_pay();
DROP FUNCTION new_emp();
DROP FUNCTION add_em(int4, int4);
DROP FUNCTION add_em(integer, integer);
DROP FUNCTION one();
DROP FUNCTION double_salary(EMP);