warning: skipping missing include file data/mkdata: No such file or directory echo "==> Mk $stem.sql" eval echo "\" $SED -e "s/__TDBNAME__/$tdbname/g" -e "s/__TSCHENAME__/$tschename/g" < $prereq | if $PSQL -Xwe --set ON_ERROR_STOP= -d $pgdbname -U $pguser -f /dev/stdin; then touch $target; else kill $$; fi\"" eval "$psqlskel" 2>&1 | sed -e 's/^/ /g' # indent two spaces ==> Mk .sql sed -e s/__TDBNAME__/_n_srv/g -e s/__TSCHENAME__/n_srv/g < skel.sql | if psql -Xwe --set ON_ERROR_STOP= -d template1 -U _postgresql -f /dev/stdin; then touch skel.ck; else kill 2432; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Database squeleton */ drop database if exists _n_srv; DROP DATABASE create database _n_srv encoding = 'UTF8' template = template0; CREATE DATABASE You are now connected to database "_n_srv" as user "_postgresql". drop schema if exists public; DROP SCHEMA create schema public; CREATE SCHEMA drop schema if exists regress; psql:/dev/stdin:27: NOTICE: schema "regress" does not exist, skipping DROP SCHEMA create schema regress; CREATE SCHEMA drop schema if exists n_srv; psql:/dev/stdin:30: NOTICE: schema "n_srv" does not exist, skipping DROP SCHEMA create schema n_srv; CREATE SCHEMA alter database _n_srv set search_path to n_srv,public; ALTER DATABASE ==> Mk role/auth.sh sh role/auth.sh role/auth.sql ==> Mk func/pgrole.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/pgrole.sql; then touch func/pgrole.ck; else kill 9802; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Returns a set of role names that have permissions on an object name, this * function search for objna in the current schema search path, in order. */ create or replace function grantee_on_obj(objna text) returns table (grantee text) language plpgsql as $$ declare sch text; -- schema to search in. begin for sch in select unnest(current_schemas('t')) loop return query select rol.rolname::text from pg_catalog.pg_shdepend shd join pg_catalog.pg_class cla on shd.objid = cla.oid join pg_catalog.pg_roles rol on shd.refobjid = rol.oid join pg_catalog.pg_namespace nas on cla.relnamespace = nas.oid where nas.nspname = sch and cla.relname = objna; end loop; return; end; $$; CREATE FUNCTION create or replace function revoke_all_on_obj(obj_n text, out revokes bigint) returns bigint language plpgsql as $$ declare role_n text; sql text; begin revokes := 0; for role_n in select grantee from grantee_on_obj(obj_n) as foo (grantee) loop sql := 'revoke all on "' || obj_n || '" from "' || role_n || '";'; -- debug: -- raise notice '%', sql; execute sql; revokes := revokes + 1; end loop; return; end; $$; CREATE FUNCTION /* * Creates role if not exists. Returns false if the role already exists or it * couldn't create the role for whatever reason... */ create or replace function creatrolifne(rol text) returns boolean language plpgsql as $$ begin if rol is null then return false; end if; perform rolname from pg_roles where rolname = rol; -- DEBUG: raise notice 'Fucking found: %', found; if found then return false; end if; execute 'create role "' || rol || '";'; return true; end; $$; CREATE FUNCTION ==> Mk role/cdr.sh sh role/cdr.sh role/cdr.sql ==> Mk role/ext.www.sh sh role/ext.www.sh role/ext.www.sql ==> Mk role/ext.www.client.sh sh role/ext.www.client.sh role/ext.www.client.sql ==> Mk role/ext.www.hclient.sh sh role/ext.www.hclient.sh role/ext.www.hclient.sql ==> Mk role/int.www.sh sh role/int.www.sh role/int.www.sql ==> Mk role/n_srv.sh sh role/n_srv.sh role/n_srv.sql ==> Mk role/www.cookie.sh sh role/www.cookie.sh role/www.cookie.sql ==> Mk table/cdrt.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/cdrt.sql; then touch table/cdrt.ck; else kill 31665; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Contains the type's of Call Detail Records (CDR) that we can handle */ drop table if exists cdrt cascade; psql:table/cdrt.sql:20: NOTICE: table "cdrt" does not exist, skipping DROP TABLE create table cdrt ( cdrtid bigserial not null primary key, cdrtna varchar(32) not null unique ); psql:table/cdrt.sql:27: NOTICE: CREATE TABLE will create implicit sequence "cdrt_cdrtid_seq" for serial column "cdrt.cdrtid" psql:table/cdrt.sql:27: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "cdrt_pkey" for table "cdrt" psql:table/cdrt.sql:27: NOTICE: CREATE TABLE / UNIQUE will create implicit index "cdrt_cdrtna_key" for table "cdrt" CREATE TABLE /* * Insert's default btna's. */ insert into cdrt (cdrtid, cdrtna) values (0, 'ast'); INSERT 0 1 insert into cdrt (cdrtid, cdrtna) values (1, 'omni'); INSERT 0 1 insert into cdrt (cdrtid, cdrtna) values (2, 'axt'); INSERT 0 1 insert into cdrt (cdrtid, cdrtna) values (3, 'ale'); INSERT 0 1 ==> Mk table/numtref.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/numtref.sql; then touch table/numtref.ck; else kill 21902; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Numeration tree family (numtref) */ drop table if exists numtref cascade; psql:table/numtref.sql:20: NOTICE: table "numtref" does not exist, skipping DROP TABLE create table numtref ( numtrefid bigserial primary key, numtrefna varchar(32) not null unique, numtrefdesc text ); psql:table/numtref.sql:27: NOTICE: CREATE TABLE will create implicit sequence "numtref_numtrefid_seq" for serial column "numtref.numtrefid" psql:table/numtref.sql:27: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "numtref_pkey" for table "numtref" psql:table/numtref.sql:27: NOTICE: CREATE TABLE / UNIQUE will create implicit index "numtref_numtrefna_key" for table "numtref" CREATE TABLE ==> Mk table/srv.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/srv.sql; then touch table/srv.ck; else kill 2061; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Contains the type of call (service code). */ drop table if exists srv cascade; psql:table/srv.sql:21: NOTICE: table "srv" does not exist, skipping DROP TABLE create table srv ( srvid bigint not null primary key constraint "srvid must be non-negative" check (srvid >= 0), srvna varchar(126) not null ); psql:table/srv.sql:30: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "srv_pkey" for table "srv" CREATE TABLE ==> Mk func/cube.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/cube.sql; then touch func/cube.ck; else kill 12704; fi /* $PostgreSQL: pgsql/contrib/cube/cube.sql.in,v 1.25 2009/06/11 18:30:03 tgl Exp $ */ SET search_path = public; SET CREATE OR REPLACE FUNCTION cube_in(cstring) RETURNS cube AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; psql:func/cube.sql:13: NOTICE: type "cube" is not yet defined DETAIL: Creating a shell type definition. CREATE FUNCTION CREATE OR REPLACE FUNCTION cube(float8[], float8[]) RETURNS cube AS '$libdir/cube', 'cube_a_f8_f8' LANGUAGE C IMMUTABLE STRICT; psql:func/cube.sql:17: NOTICE: return type cube is only a shell CREATE FUNCTION CREATE OR REPLACE FUNCTION cube(float8[]) RETURNS cube AS '$libdir/cube', 'cube_a_f8' LANGUAGE C IMMUTABLE STRICT; psql:func/cube.sql:21: NOTICE: return type cube is only a shell CREATE FUNCTION CREATE OR REPLACE FUNCTION cube_out(cube) RETURNS cstring AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; psql:func/cube.sql:26: NOTICE: argument type cube is only a shell CREATE FUNCTION CREATE TYPE cube ( INTERNALLENGTH = variable, INPUT = cube_in, OUTPUT = cube_out, ALIGNMENT = double ); CREATE TYPE COMMENT ON TYPE cube IS 'multi-dimensional cube ''(FLOAT-1, FLOAT-2, ..., FLOAT-N), (FLOAT-1, FLOAT-2, ..., FLOAT-N)'''; COMMENT CREATE OR REPLACE FUNCTION cube_eq(cube, cube) RETURNS bool AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION cube_eq(cube, cube) IS 'same as'; COMMENT CREATE OR REPLACE FUNCTION cube_ne(cube, cube) RETURNS bool AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION cube_ne(cube, cube) IS 'different'; COMMENT CREATE OR REPLACE FUNCTION cube_lt(cube, cube) RETURNS bool AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION cube_lt(cube, cube) IS 'lower than'; COMMENT CREATE OR REPLACE FUNCTION cube_gt(cube, cube) RETURNS bool AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION cube_gt(cube, cube) IS 'greater than'; COMMENT CREATE OR REPLACE FUNCTION cube_le(cube, cube) RETURNS bool AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION cube_le(cube, cube) IS 'lower than or equal to'; COMMENT CREATE OR REPLACE FUNCTION cube_ge(cube, cube) RETURNS bool AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION cube_ge(cube, cube) IS 'greater than or equal to'; COMMENT CREATE OR REPLACE FUNCTION cube_cmp(cube, cube) RETURNS int4 AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION cube_cmp(cube, cube) IS 'btree comparison function'; COMMENT CREATE OR REPLACE FUNCTION cube_contains(cube, cube) RETURNS bool AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION cube_contains(cube, cube) IS 'contains'; COMMENT CREATE OR REPLACE FUNCTION cube_contained(cube, cube) RETURNS bool AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION cube_contained(cube, cube) IS 'contained in'; COMMENT CREATE OR REPLACE FUNCTION cube_overlap(cube, cube) RETURNS bool AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION cube_overlap(cube, cube) IS 'overlaps'; COMMENT CREATE OR REPLACE FUNCTION cube_union(cube, cube) RETURNS cube AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube_inter(cube, cube) RETURNS cube AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube_size(cube) RETURNS float8 AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube_subset(cube, int4[]) RETURNS cube AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube_distance(cube, cube) RETURNS float8 AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube_dim(cube) RETURNS int4 AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube_ll_coord(cube, int4) RETURNS float8 AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube_ur_coord(cube, int4) RETURNS float8 AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube(float8) RETURNS cube AS '$libdir/cube', 'cube_f8' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube(float8, float8) RETURNS cube AS '$libdir/cube', 'cube_f8_f8' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube(cube, float8) RETURNS cube AS '$libdir/cube', 'cube_c_f8' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube(cube, float8, float8) RETURNS cube AS '$libdir/cube', 'cube_c_f8_f8' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube_is_point(cube) RETURNS bool AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION cube_enlarge(cube, float8, int4) RETURNS cube AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR < ( LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_lt, COMMUTATOR = '>', NEGATOR = '>=', RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR CREATE OPERATOR > ( LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_gt, COMMUTATOR = '<', NEGATOR = '<=', RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR CREATE OPERATOR <= ( LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_le, COMMUTATOR = '>=', NEGATOR = '>', RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR CREATE OPERATOR >= ( LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_ge, COMMUTATOR = '<=', NEGATOR = '<', RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR CREATE OPERATOR && ( LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_overlap, COMMUTATOR = '&&', RESTRICT = areasel, JOIN = areajoinsel ); CREATE OPERATOR CREATE OPERATOR = ( LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_eq, COMMUTATOR = '=', NEGATOR = '<>', RESTRICT = eqsel, JOIN = eqjoinsel, MERGES ); CREATE OPERATOR CREATE OPERATOR <> ( LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_ne, COMMUTATOR = '<>', NEGATOR = '=', RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR CREATE OPERATOR @> ( LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_contains, COMMUTATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR <@ ( LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_contained, COMMUTATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR @ ( LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_contains, COMMUTATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ~ ( LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_contained, COMMUTATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OR REPLACE FUNCTION g_cube_consistent(internal,cube,int,oid,internal) RETURNS bool AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_cube_compress(internal) RETURNS internal AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_cube_decompress(internal) RETURNS internal AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_cube_penalty(internal,internal,internal) RETURNS internal AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_cube_picksplit(internal, internal) RETURNS internal AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_cube_union(internal, internal) RETURNS cube AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_cube_same(cube, cube, internal) RETURNS internal AS '$libdir/cube' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS cube_ops DEFAULT FOR TYPE cube USING btree AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 cube_cmp(cube, cube); CREATE OPERATOR CLASS CREATE OPERATOR CLASS gist_cube_ops DEFAULT FOR TYPE cube USING gist AS OPERATOR 3 && , OPERATOR 6 = , OPERATOR 7 @> , OPERATOR 8 <@ , OPERATOR 13 @ , OPERATOR 14 ~ , FUNCTION 1 g_cube_consistent (internal, cube, int, oid, internal), FUNCTION 2 g_cube_union (internal, internal), FUNCTION 3 g_cube_compress (internal), FUNCTION 4 g_cube_decompress (internal), FUNCTION 5 g_cube_penalty (internal, internal, internal), FUNCTION 6 g_cube_picksplit (internal, internal), FUNCTION 7 g_cube_same (cube, cube, internal); CREATE OPERATOR CLASS ==> Mk func/intarray.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/intarray.sql; then touch func/intarray.ck; else kill 10695; fi /* $PostgreSQL: pgsql/contrib/intarray/_int.sql.in,v 1.32 2009/06/11 18:30:03 tgl Exp $ */ SET search_path = public; SET CREATE OR REPLACE FUNCTION bqarr_in(cstring) RETURNS query_int AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; psql:func/intarray.sql:14: NOTICE: type "query_int" is not yet defined DETAIL: Creating a shell type definition. CREATE FUNCTION CREATE OR REPLACE FUNCTION bqarr_out(query_int) RETURNS cstring AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; psql:func/intarray.sql:19: NOTICE: argument type query_int is only a shell CREATE FUNCTION CREATE TYPE query_int ( INTERNALLENGTH = -1, INPUT = bqarr_in, OUTPUT = bqarr_out ); CREATE TYPE CREATE OR REPLACE FUNCTION querytree(query_int) RETURNS text AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION boolop(_int4, query_int) RETURNS bool AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION COMMENT ON FUNCTION boolop(_int4, query_int) IS 'boolean operation with array'; COMMENT CREATE OR REPLACE FUNCTION rboolop(query_int, _int4) RETURNS bool AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION COMMENT ON FUNCTION rboolop(query_int, _int4) IS 'boolean operation with array'; COMMENT CREATE OPERATOR @@ ( LEFTARG = _int4, RIGHTARG = query_int, PROCEDURE = boolop, COMMUTATOR = '~~', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ~~ ( LEFTARG = query_int, RIGHTARG = _int4, PROCEDURE = rboolop, COMMUTATOR = '@@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OR REPLACE FUNCTION _int_contains(_int4, _int4) RETURNS bool AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION COMMENT ON FUNCTION _int_contains(_int4, _int4) IS 'contains'; COMMENT CREATE OR REPLACE FUNCTION _int_contained(_int4, _int4) RETURNS bool AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION COMMENT ON FUNCTION _int_contained(_int4, _int4) IS 'contained in'; COMMENT CREATE OR REPLACE FUNCTION _int_overlap(_int4, _int4) RETURNS bool AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION COMMENT ON FUNCTION _int_overlap(_int4, _int4) IS 'overlaps'; COMMENT CREATE OR REPLACE FUNCTION _int_same(_int4, _int4) RETURNS bool AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION COMMENT ON FUNCTION _int_same(_int4, _int4) IS 'same as'; COMMENT CREATE OR REPLACE FUNCTION _int_different(_int4, _int4) RETURNS bool AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION COMMENT ON FUNCTION _int_different(_int4, _int4) IS 'different'; COMMENT CREATE OR REPLACE FUNCTION _int_union(_int4, _int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION _int_inter(_int4, _int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR && ( LEFTARG = _int4, RIGHTARG = _int4, PROCEDURE = _int_overlap, COMMUTATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR @> ( LEFTARG = _int4, RIGHTARG = _int4, PROCEDURE = _int_contains, COMMUTATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR <@ ( LEFTARG = _int4, RIGHTARG = _int4, PROCEDURE = _int_contained, COMMUTATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR @ ( LEFTARG = _int4, RIGHTARG = _int4, PROCEDURE = _int_contains, COMMUTATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ~ ( LEFTARG = _int4, RIGHTARG = _int4, PROCEDURE = _int_contained, COMMUTATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OR REPLACE FUNCTION intset(int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION icount(_int4) RETURNS int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR # ( RIGHTARG = _int4, PROCEDURE = icount ); CREATE OPERATOR CREATE OR REPLACE FUNCTION sort(_int4, text) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION sort(_int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION sort_asc(_int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION sort_desc(_int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION uniq(_int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION idx(_int4, int4) RETURNS int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR # ( LEFTARG = _int4, RIGHTARG = int4, PROCEDURE = idx ); CREATE OPERATOR CREATE OR REPLACE FUNCTION subarray(_int4, int4, int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION subarray(_int4, int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION intarray_push_elem(_int4, int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR + ( LEFTARG = _int4, RIGHTARG = int4, PROCEDURE = intarray_push_elem ); CREATE OPERATOR CREATE OR REPLACE FUNCTION intarray_push_array(_int4, _int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR + ( LEFTARG = _int4, RIGHTARG = _int4, COMMUTATOR = +, PROCEDURE = intarray_push_array ); CREATE OPERATOR CREATE OR REPLACE FUNCTION intarray_del_elem(_int4, int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR - ( LEFTARG = _int4, RIGHTARG = int4, PROCEDURE = intarray_del_elem ); CREATE OPERATOR CREATE OR REPLACE FUNCTION intset_union_elem(_int4, int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR | ( LEFTARG = _int4, RIGHTARG = int4, PROCEDURE = intset_union_elem ); CREATE OPERATOR CREATE OPERATOR | ( LEFTARG = _int4, RIGHTARG = _int4, COMMUTATOR = |, PROCEDURE = _int_union ); CREATE OPERATOR CREATE OR REPLACE FUNCTION intset_subtract(_int4, _int4) RETURNS _int4 AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR - ( LEFTARG = _int4, RIGHTARG = _int4, PROCEDURE = intset_subtract ); CREATE OPERATOR CREATE OPERATOR & ( LEFTARG = _int4, RIGHTARG = _int4, COMMUTATOR = &, PROCEDURE = _int_inter ); CREATE OPERATOR CREATE OR REPLACE FUNCTION g_int_consistent(internal,_int4,int,oid,internal) RETURNS bool AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_int_compress(internal) RETURNS internal AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_int_decompress(internal) RETURNS internal AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_int_penalty(internal,internal,internal) RETURNS internal AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_int_picksplit(internal, internal) RETURNS internal AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_int_union(internal, internal) RETURNS _int4 AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_int_same(_int4, _int4, internal) RETURNS internal AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist__int_ops DEFAULT FOR TYPE _int4 USING gist AS OPERATOR 3 &&, OPERATOR 6 = (anyarray, anyarray), OPERATOR 7 @>, OPERATOR 8 <@, OPERATOR 13 @, OPERATOR 14 ~, OPERATOR 20 @@ (_int4, query_int), FUNCTION 1 g_int_consistent (internal, _int4, int, oid, internal), FUNCTION 2 g_int_union (internal, internal), FUNCTION 3 g_int_compress (internal), FUNCTION 4 g_int_decompress (internal), FUNCTION 5 g_int_penalty (internal, internal, internal), FUNCTION 6 g_int_picksplit (internal, internal), FUNCTION 7 g_int_same (_int4, _int4, internal); CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION _intbig_in(cstring) RETURNS intbig_gkey AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; psql:func/intarray.sql:390: NOTICE: type "intbig_gkey" is not yet defined DETAIL: Creating a shell type definition. CREATE FUNCTION CREATE OR REPLACE FUNCTION _intbig_out(intbig_gkey) RETURNS cstring AS '$libdir/_int' LANGUAGE C STRICT IMMUTABLE; psql:func/intarray.sql:395: NOTICE: argument type intbig_gkey is only a shell CREATE FUNCTION CREATE TYPE intbig_gkey ( INTERNALLENGTH = -1, INPUT = _intbig_in, OUTPUT = _intbig_out ); CREATE TYPE CREATE OR REPLACE FUNCTION g_intbig_consistent(internal,internal,int,oid,internal) RETURNS bool AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_intbig_compress(internal) RETURNS internal AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_intbig_decompress(internal) RETURNS internal AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_intbig_penalty(internal,internal,internal) RETURNS internal AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_intbig_picksplit(internal, internal) RETURNS internal AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_intbig_union(internal, internal) RETURNS _int4 AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION g_intbig_same(internal, internal, internal) RETURNS internal AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist__intbig_ops FOR TYPE _int4 USING gist AS OPERATOR 3 &&, OPERATOR 6 = (anyarray, anyarray), OPERATOR 7 @>, OPERATOR 8 <@, OPERATOR 13 @, OPERATOR 14 ~, OPERATOR 20 @@ (_int4, query_int), FUNCTION 1 g_intbig_consistent (internal, internal, int, oid, internal), FUNCTION 2 g_intbig_union (internal, internal), FUNCTION 3 g_intbig_compress (internal), FUNCTION 4 g_intbig_decompress (internal), FUNCTION 5 g_intbig_penalty (internal, internal, internal), FUNCTION 6 g_intbig_picksplit (internal, internal), FUNCTION 7 g_intbig_same (internal, internal, internal), STORAGE intbig_gkey; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION ginint4_queryextract(internal, internal, int2, internal, internal) RETURNS internal AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ginint4_consistent(internal, int2, internal, int4, internal, internal) RETURNS bool AS '$libdir/_int' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gin__int_ops FOR TYPE _int4 USING gin AS OPERATOR 3 &&, OPERATOR 6 = (anyarray, anyarray), OPERATOR 7 @>, OPERATOR 8 <@, OPERATOR 13 @, OPERATOR 14 ~, OPERATOR 20 @@ (_int4, query_int), FUNCTION 1 btint4cmp (int4, int4), FUNCTION 2 ginarrayextract (anyarray, internal), FUNCTION 3 ginint4_queryextract (internal, internal, int2, internal, internal), FUNCTION 4 ginint4_consistent (internal, int2, internal, int4, internal, internal), STORAGE int4; CREATE OPERATOR CLASS ==> Mk func/ltree.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/ltree.sql; then touch func/ltree.ck; else kill 6254; fi /* $PostgreSQL: pgsql/contrib/ltree/ltree.sql.in,v 1.18 2009/06/11 18:30:03 tgl Exp $ */ SET search_path = public; SET CREATE OR REPLACE FUNCTION ltree_in(cstring) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT; psql:func/ltree.sql:9: NOTICE: type "ltree" is not yet defined DETAIL: Creating a shell type definition. CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_out(ltree) RETURNS cstring AS '$libdir/ltree' LANGUAGE C STRICT; psql:func/ltree.sql:14: NOTICE: argument type ltree is only a shell CREATE FUNCTION CREATE TYPE ltree ( INTERNALLENGTH = -1, INPUT = ltree_in, OUTPUT = ltree_out, STORAGE = extended ); CREATE TYPE CREATE OR REPLACE FUNCTION ltree_cmp(ltree,ltree) RETURNS int4 AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_lt(ltree,ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_le(ltree,ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_eq(ltree,ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_ge(ltree,ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_gt(ltree,ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_ne(ltree,ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR < ( LEFTARG = ltree, RIGHTARG = ltree, PROCEDURE = ltree_lt, COMMUTATOR = '>', NEGATOR = '>=', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR <= ( LEFTARG = ltree, RIGHTARG = ltree, PROCEDURE = ltree_le, COMMUTATOR = '>=', NEGATOR = '>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR >= ( LEFTARG = ltree, RIGHTARG = ltree, PROCEDURE = ltree_ge, COMMUTATOR = '<=', NEGATOR = '<', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR > ( LEFTARG = ltree, RIGHTARG = ltree, PROCEDURE = ltree_gt, COMMUTATOR = '<', NEGATOR = '<=', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR = ( LEFTARG = ltree, RIGHTARG = ltree, PROCEDURE = ltree_eq, COMMUTATOR = '=', NEGATOR = '<>', RESTRICT = eqsel, JOIN = eqjoinsel, SORT1 = '<', SORT2 = '<' ); CREATE OPERATOR CREATE OPERATOR <> ( LEFTARG = ltree, RIGHTARG = ltree, PROCEDURE = ltree_ne, COMMUTATOR = '<>', NEGATOR = '=', RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR CREATE OR REPLACE FUNCTION subltree(ltree,int4,int4) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION subpath(ltree,int4,int4) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION subpath(ltree,int4) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION index(ltree,ltree) RETURNS int4 AS '$libdir/ltree', 'ltree_index' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION index(ltree,ltree,int4) RETURNS int4 AS '$libdir/ltree', 'ltree_index' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION nlevel(ltree) RETURNS int4 AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree2text(ltree) RETURNS text AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION text2ltree(text) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION lca(_ltree) RETURNS ltree AS '$libdir/ltree','_lca' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION lca(ltree,ltree) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION lca(ltree,ltree,ltree) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION lca(ltree,ltree,ltree,ltree) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION lca(ltree,ltree,ltree,ltree,ltree) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree,ltree) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_isparent(ltree,ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_risparent(ltree,ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_addltree(ltree,ltree) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_addtext(ltree,text) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_textadd(text,ltree) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltreeparentsel(internal, oid, internal, integer) RETURNS float8 AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR @> ( LEFTARG = ltree, RIGHTARG = ltree, PROCEDURE = ltree_isparent, COMMUTATOR = '<@', RESTRICT = ltreeparentsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^@> ( LEFTARG = ltree, RIGHTARG = ltree, PROCEDURE = ltree_isparent, COMMUTATOR = '^<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR <@ ( LEFTARG = ltree, RIGHTARG = ltree, PROCEDURE = ltree_risparent, COMMUTATOR = '@>', RESTRICT = ltreeparentsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^<@ ( LEFTARG = ltree, RIGHTARG = ltree, PROCEDURE = ltree_risparent, COMMUTATOR = '^@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR || ( LEFTARG = ltree, RIGHTARG = ltree, PROCEDURE = ltree_addltree ); CREATE OPERATOR CREATE OPERATOR || ( LEFTARG = ltree, RIGHTARG = text, PROCEDURE = ltree_addtext ); CREATE OPERATOR CREATE OPERATOR || ( LEFTARG = text, RIGHTARG = ltree, PROCEDURE = ltree_textadd ); CREATE OPERATOR CREATE OPERATOR CLASS ltree_ops DEFAULT FOR TYPE ltree USING btree AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 ltree_cmp(ltree, ltree); CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION lquery_in(cstring) RETURNS lquery AS '$libdir/ltree' LANGUAGE C STRICT; psql:func/ltree.sql:306: NOTICE: type "lquery" is not yet defined DETAIL: Creating a shell type definition. CREATE FUNCTION CREATE OR REPLACE FUNCTION lquery_out(lquery) RETURNS cstring AS '$libdir/ltree' LANGUAGE C STRICT; psql:func/ltree.sql:311: NOTICE: argument type lquery is only a shell CREATE FUNCTION CREATE TYPE lquery ( INTERNALLENGTH = -1, INPUT = lquery_in, OUTPUT = lquery_out, STORAGE = extended ); CREATE TYPE CREATE OR REPLACE FUNCTION ltq_regex(ltree,lquery) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltq_rregex(lquery,ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR ~ ( LEFTARG = ltree, RIGHTARG = lquery, PROCEDURE = ltq_regex, COMMUTATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ~ ( LEFTARG = lquery, RIGHTARG = ltree, PROCEDURE = ltq_rregex, COMMUTATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^~ ( LEFTARG = ltree, RIGHTARG = lquery, PROCEDURE = ltq_regex, COMMUTATOR = '^~', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^~ ( LEFTARG = lquery, RIGHTARG = ltree, PROCEDURE = ltq_rregex, COMMUTATOR = '^~', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OR REPLACE FUNCTION lt_q_regex(ltree,_lquery) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION lt_q_rregex(_lquery,ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR ? ( LEFTARG = ltree, RIGHTARG = _lquery, PROCEDURE = lt_q_regex, COMMUTATOR = '?', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ? ( LEFTARG = _lquery, RIGHTARG = ltree, PROCEDURE = lt_q_rregex, COMMUTATOR = '?', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^? ( LEFTARG = ltree, RIGHTARG = _lquery, PROCEDURE = lt_q_regex, COMMUTATOR = '^?', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^? ( LEFTARG = _lquery, RIGHTARG = ltree, PROCEDURE = lt_q_rregex, COMMUTATOR = '^?', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OR REPLACE FUNCTION ltxtq_in(cstring) RETURNS ltxtquery AS '$libdir/ltree' LANGUAGE C STRICT; psql:func/ltree.sql:417: NOTICE: type "ltxtquery" is not yet defined DETAIL: Creating a shell type definition. CREATE FUNCTION CREATE OR REPLACE FUNCTION ltxtq_out(ltxtquery) RETURNS cstring AS '$libdir/ltree' LANGUAGE C STRICT; psql:func/ltree.sql:422: NOTICE: argument type ltxtquery is only a shell CREATE FUNCTION CREATE TYPE ltxtquery ( INTERNALLENGTH = -1, INPUT = ltxtq_in, OUTPUT = ltxtq_out, STORAGE = extended ); CREATE TYPE CREATE OR REPLACE FUNCTION ltxtq_exec(ltree, ltxtquery) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltxtq_rexec(ltxtquery, ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR @ ( LEFTARG = ltree, RIGHTARG = ltxtquery, PROCEDURE = ltxtq_exec, COMMUTATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR @ ( LEFTARG = ltxtquery, RIGHTARG = ltree, PROCEDURE = ltxtq_rexec, COMMUTATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^@ ( LEFTARG = ltree, RIGHTARG = ltxtquery, PROCEDURE = ltxtq_exec, COMMUTATOR = '^@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^@ ( LEFTARG = ltxtquery, RIGHTARG = ltree, PROCEDURE = ltxtq_rexec, COMMUTATOR = '^@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OR REPLACE FUNCTION ltree_gist_in(cstring) RETURNS ltree_gist AS '$libdir/ltree' LANGUAGE C STRICT; psql:func/ltree.sql:484: NOTICE: type "ltree_gist" is not yet defined DETAIL: Creating a shell type definition. CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_gist_out(ltree_gist) RETURNS cstring AS '$libdir/ltree' LANGUAGE C STRICT; psql:func/ltree.sql:489: NOTICE: argument type ltree_gist is only a shell CREATE FUNCTION CREATE TYPE ltree_gist ( internallength = -1, input = ltree_gist_in, output = ltree_gist_out, storage = plain ); CREATE TYPE CREATE OR REPLACE FUNCTION ltree_consistent(internal,internal,int2,oid,internal) RETURNS bool as '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_compress(internal) RETURNS internal as '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_decompress(internal) RETURNS internal as '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_penalty(internal,internal,internal) RETURNS internal as '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_picksplit(internal, internal) RETURNS internal as '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_union(internal, internal) RETURNS int4 as '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ltree_same(internal, internal, internal) RETURNS internal as '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_ltree_ops DEFAULT FOR TYPE ltree USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , OPERATOR 10 @> , OPERATOR 11 <@ , OPERATOR 12 ~ (ltree, lquery) , OPERATOR 13 ~ (lquery, ltree) , OPERATOR 14 @ (ltree, ltxtquery) , OPERATOR 15 @ (ltxtquery, ltree) , OPERATOR 16 ? (ltree, _lquery) , OPERATOR 17 ? (_lquery, ltree) , FUNCTION 1 ltree_consistent (internal, internal, int2, oid, internal), FUNCTION 2 ltree_union (internal, internal), FUNCTION 3 ltree_compress (internal), FUNCTION 4 ltree_decompress (internal), FUNCTION 5 ltree_penalty (internal, internal, internal), FUNCTION 6 ltree_picksplit (internal, internal), FUNCTION 7 ltree_same (internal, internal, internal), STORAGE ltree_gist; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION _ltree_isparent(_ltree,ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION _ltree_r_isparent(ltree,_ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION _ltree_risparent(_ltree,ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION _ltree_r_risparent(ltree,_ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION _ltq_regex(_ltree,lquery) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION _ltq_rregex(lquery,_ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION _lt_q_regex(_ltree,_lquery) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION _lt_q_rregex(_lquery,_ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION _ltxtq_exec(_ltree, ltxtquery) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION _ltxtq_rexec(ltxtquery, _ltree) RETURNS bool AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR @> ( LEFTARG = _ltree, RIGHTARG = ltree, PROCEDURE = _ltree_isparent, COMMUTATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR <@ ( LEFTARG = ltree, RIGHTARG = _ltree, PROCEDURE = _ltree_r_isparent, COMMUTATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR <@ ( LEFTARG = _ltree, RIGHTARG = ltree, PROCEDURE = _ltree_risparent, COMMUTATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR @> ( LEFTARG = ltree, RIGHTARG = _ltree, PROCEDURE = _ltree_r_risparent, COMMUTATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ~ ( LEFTARG = _ltree, RIGHTARG = lquery, PROCEDURE = _ltq_regex, COMMUTATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ~ ( LEFTARG = lquery, RIGHTARG = _ltree, PROCEDURE = _ltq_rregex, COMMUTATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ? ( LEFTARG = _ltree, RIGHTARG = _lquery, PROCEDURE = _lt_q_regex, COMMUTATOR = '?', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ? ( LEFTARG = _lquery, RIGHTARG = _ltree, PROCEDURE = _lt_q_rregex, COMMUTATOR = '?', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR @ ( LEFTARG = _ltree, RIGHTARG = ltxtquery, PROCEDURE = _ltxtq_exec, COMMUTATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR @ ( LEFTARG = ltxtquery, RIGHTARG = _ltree, PROCEDURE = _ltxtq_rexec, COMMUTATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^@> ( LEFTARG = _ltree, RIGHTARG = ltree, PROCEDURE = _ltree_isparent, COMMUTATOR = '^<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^<@ ( LEFTARG = ltree, RIGHTARG = _ltree, PROCEDURE = _ltree_r_isparent, COMMUTATOR = '^@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^<@ ( LEFTARG = _ltree, RIGHTARG = ltree, PROCEDURE = _ltree_risparent, COMMUTATOR = '^@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^@> ( LEFTARG = ltree, RIGHTARG = _ltree, PROCEDURE = _ltree_r_risparent, COMMUTATOR = '^<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^~ ( LEFTARG = _ltree, RIGHTARG = lquery, PROCEDURE = _ltq_regex, COMMUTATOR = '^~', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^~ ( LEFTARG = lquery, RIGHTARG = _ltree, PROCEDURE = _ltq_rregex, COMMUTATOR = '^~', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^? ( LEFTARG = _ltree, RIGHTARG = _lquery, PROCEDURE = _lt_q_regex, COMMUTATOR = '^?', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^? ( LEFTARG = _lquery, RIGHTARG = _ltree, PROCEDURE = _lt_q_rregex, COMMUTATOR = '^?', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^@ ( LEFTARG = _ltree, RIGHTARG = ltxtquery, PROCEDURE = _ltxtq_exec, COMMUTATOR = '^@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ^@ ( LEFTARG = ltxtquery, RIGHTARG = _ltree, PROCEDURE = _ltxtq_rexec, COMMUTATOR = '^@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OR REPLACE FUNCTION _ltree_extract_isparent(_ltree,ltree) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR ?@> ( LEFTARG = _ltree, RIGHTARG = ltree, PROCEDURE = _ltree_extract_isparent ); CREATE OPERATOR CREATE OR REPLACE FUNCTION _ltree_extract_risparent(_ltree,ltree) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR ?<@ ( LEFTARG = _ltree, RIGHTARG = ltree, PROCEDURE = _ltree_extract_risparent ); CREATE OPERATOR CREATE OR REPLACE FUNCTION _ltq_extract_regex(_ltree,lquery) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR ?~ ( LEFTARG = _ltree, RIGHTARG = lquery, PROCEDURE = _ltq_extract_regex ); CREATE OPERATOR CREATE OR REPLACE FUNCTION _ltxtq_extract_exec(_ltree,ltxtquery) RETURNS ltree AS '$libdir/ltree' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR ?@ ( LEFTARG = _ltree, RIGHTARG = ltxtquery, PROCEDURE = _ltxtq_extract_exec ); CREATE OPERATOR CREATE OR REPLACE FUNCTION _ltree_consistent(internal,internal,int2,oid,internal) RETURNS bool AS '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION _ltree_compress(internal) RETURNS internal AS '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION _ltree_penalty(internal,internal,internal) RETURNS internal AS '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION _ltree_picksplit(internal, internal) RETURNS internal AS '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION _ltree_union(internal, internal) RETURNS int4 AS '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION _ltree_same(internal, internal, internal) RETURNS internal AS '$libdir/ltree' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist__ltree_ops DEFAULT FOR TYPE _ltree USING gist AS OPERATOR 10 <@ (_ltree, ltree), OPERATOR 11 @> (ltree, _ltree), OPERATOR 12 ~ (_ltree, lquery), OPERATOR 13 ~ (lquery, _ltree), OPERATOR 14 @ (_ltree, ltxtquery), OPERATOR 15 @ (ltxtquery, _ltree), OPERATOR 16 ? (_ltree, _lquery), OPERATOR 17 ? (_lquery, _ltree), FUNCTION 1 _ltree_consistent (internal, internal, int2, oid, internal), FUNCTION 2 _ltree_union (internal, internal), FUNCTION 3 _ltree_compress (internal), FUNCTION 4 ltree_decompress (internal), FUNCTION 5 _ltree_penalty (internal, internal, internal), FUNCTION 6 _ltree_picksplit (internal, internal), FUNCTION 7 _ltree_same (internal, internal, internal), STORAGE ltree_gist; CREATE OPERATOR CLASS ==> Mk table/rolki.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/rolki.sql; then touch table/rolki.ck; else kill 31932; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Role kind table, this are the predefined roles into pg_roles. */ drop table if exists rolki cascade; psql:table/rolki.sql:21: NOTICE: table "rolki" does not exist, skipping DROP TABLE create table rolki ( rolkiid bigserial not null primary key check (rolkiid > 0), rolkna varchar(126) unique not null ); psql:table/rolki.sql:28: NOTICE: CREATE TABLE will create implicit sequence "rolki_rolkiid_seq" for serial column "rolki.rolkiid" psql:table/rolki.sql:28: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "rolki_pkey" for table "rolki" psql:table/rolki.sql:28: NOTICE: CREATE TABLE / UNIQUE will create implicit index "rolki_rolkna_key" for table "rolki" CREATE TABLE ==> Mk func/btree_gist.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/btree_gist.sql; then touch func/btree_gist.ck; else kill 30919; fi /* $PostgreSQL: pgsql/contrib/btree_gist/btree_gist.sql.in,v 1.21 2009/06/11 18:30:03 tgl Exp $ */ SET search_path = public; SET CREATE OR REPLACE FUNCTION gbtreekey4_in(cstring) RETURNS gbtreekey4 AS '$libdir/btree_gist', 'gbtreekey_in' LANGUAGE C IMMUTABLE STRICT; psql:func/btree_gist.sql:9: NOTICE: type "gbtreekey4" is not yet defined DETAIL: Creating a shell type definition. CREATE FUNCTION CREATE OR REPLACE FUNCTION gbtreekey4_out(gbtreekey4) RETURNS cstring AS '$libdir/btree_gist', 'gbtreekey_out' LANGUAGE C IMMUTABLE STRICT; psql:func/btree_gist.sql:14: NOTICE: argument type gbtreekey4 is only a shell CREATE FUNCTION CREATE TYPE gbtreekey4 ( INTERNALLENGTH = 4, INPUT = gbtreekey4_in, OUTPUT = gbtreekey4_out ); CREATE TYPE CREATE OR REPLACE FUNCTION gbtreekey8_in(cstring) RETURNS gbtreekey8 AS '$libdir/btree_gist', 'gbtreekey_in' LANGUAGE C IMMUTABLE STRICT; psql:func/btree_gist.sql:25: NOTICE: type "gbtreekey8" is not yet defined DETAIL: Creating a shell type definition. CREATE FUNCTION CREATE OR REPLACE FUNCTION gbtreekey8_out(gbtreekey8) RETURNS cstring AS '$libdir/btree_gist', 'gbtreekey_out' LANGUAGE C IMMUTABLE STRICT; psql:func/btree_gist.sql:30: NOTICE: argument type gbtreekey8 is only a shell CREATE FUNCTION CREATE TYPE gbtreekey8 ( INTERNALLENGTH = 8, INPUT = gbtreekey8_in, OUTPUT = gbtreekey8_out ); CREATE TYPE CREATE OR REPLACE FUNCTION gbtreekey16_in(cstring) RETURNS gbtreekey16 AS '$libdir/btree_gist', 'gbtreekey_in' LANGUAGE C IMMUTABLE STRICT; psql:func/btree_gist.sql:41: NOTICE: type "gbtreekey16" is not yet defined DETAIL: Creating a shell type definition. CREATE FUNCTION CREATE OR REPLACE FUNCTION gbtreekey16_out(gbtreekey16) RETURNS cstring AS '$libdir/btree_gist', 'gbtreekey_out' LANGUAGE C IMMUTABLE STRICT; psql:func/btree_gist.sql:46: NOTICE: argument type gbtreekey16 is only a shell CREATE FUNCTION CREATE TYPE gbtreekey16 ( INTERNALLENGTH = 16, INPUT = gbtreekey16_in, OUTPUT = gbtreekey16_out ); CREATE TYPE CREATE OR REPLACE FUNCTION gbtreekey32_in(cstring) RETURNS gbtreekey32 AS '$libdir/btree_gist', 'gbtreekey_in' LANGUAGE C IMMUTABLE STRICT; psql:func/btree_gist.sql:57: NOTICE: type "gbtreekey32" is not yet defined DETAIL: Creating a shell type definition. CREATE FUNCTION CREATE OR REPLACE FUNCTION gbtreekey32_out(gbtreekey32) RETURNS cstring AS '$libdir/btree_gist', 'gbtreekey_out' LANGUAGE C IMMUTABLE STRICT; psql:func/btree_gist.sql:62: NOTICE: argument type gbtreekey32 is only a shell CREATE FUNCTION CREATE TYPE gbtreekey32 ( INTERNALLENGTH = 32, INPUT = gbtreekey32_in, OUTPUT = gbtreekey32_out ); CREATE TYPE CREATE OR REPLACE FUNCTION gbtreekey_var_in(cstring) RETURNS gbtreekey_var AS '$libdir/btree_gist', 'gbtreekey_in' LANGUAGE C IMMUTABLE STRICT; psql:func/btree_gist.sql:73: NOTICE: type "gbtreekey_var" is not yet defined DETAIL: Creating a shell type definition. CREATE FUNCTION CREATE OR REPLACE FUNCTION gbtreekey_var_out(gbtreekey_var) RETURNS cstring AS '$libdir/btree_gist', 'gbtreekey_out' LANGUAGE C IMMUTABLE STRICT; psql:func/btree_gist.sql:78: NOTICE: argument type gbtreekey_var is only a shell CREATE FUNCTION CREATE TYPE gbtreekey_var ( INTERNALLENGTH = VARIABLE, INPUT = gbtreekey_var_in, OUTPUT = gbtreekey_var_out, STORAGE = EXTENDED ); CREATE TYPE CREATE OR REPLACE FUNCTION gbt_oid_consistent(internal,oid,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_oid_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_decompress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_var_decompress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_oid_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_oid_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_oid_union(bytea, internal) RETURNS gbtreekey8 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_oid_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_oid_ops DEFAULT FOR TYPE oid USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_oid_consistent (internal, oid, int2, oid, internal), FUNCTION 2 gbt_oid_union (bytea, internal), FUNCTION 3 gbt_oid_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_oid_penalty (internal, internal, internal), FUNCTION 6 gbt_oid_picksplit (internal, internal), FUNCTION 7 gbt_oid_same (internal, internal, internal), STORAGE gbtreekey8; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_int2_consistent(internal,int2,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int2_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int2_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int2_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int2_union(bytea, internal) RETURNS gbtreekey4 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int2_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_int2_ops DEFAULT FOR TYPE int2 USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_int2_consistent (internal, int2, int2, oid, internal), FUNCTION 2 gbt_int2_union (bytea, internal), FUNCTION 3 gbt_int2_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_int2_penalty (internal, internal, internal), FUNCTION 6 gbt_int2_picksplit (internal, internal), FUNCTION 7 gbt_int2_same (internal, internal, internal), STORAGE gbtreekey4; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_int4_consistent(internal,int4,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int4_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int4_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int4_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int4_union(bytea, internal) RETURNS gbtreekey8 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int4_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_int4_ops DEFAULT FOR TYPE int4 USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_int4_consistent (internal, int4, int2, oid, internal), FUNCTION 2 gbt_int4_union (bytea, internal), FUNCTION 3 gbt_int4_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_int4_penalty (internal, internal, internal), FUNCTION 6 gbt_int4_picksplit (internal, internal), FUNCTION 7 gbt_int4_same (internal, internal, internal), STORAGE gbtreekey8; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_int8_consistent(internal,int8,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int8_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int8_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int8_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int8_union(bytea, internal) RETURNS gbtreekey16 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_int8_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_int8_ops DEFAULT FOR TYPE int8 USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_int8_consistent (internal, int8, int2, oid, internal), FUNCTION 2 gbt_int8_union (bytea, internal), FUNCTION 3 gbt_int8_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_int8_penalty (internal, internal, internal), FUNCTION 6 gbt_int8_picksplit (internal, internal), FUNCTION 7 gbt_int8_same (internal, internal, internal), STORAGE gbtreekey16; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_float4_consistent(internal,float4,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_float4_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_float4_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_float4_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_float4_union(bytea, internal) RETURNS gbtreekey8 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_float4_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_float4_ops DEFAULT FOR TYPE float4 USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_float4_consistent (internal, float4, int2, oid, internal), FUNCTION 2 gbt_float4_union (bytea, internal), FUNCTION 3 gbt_float4_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_float4_penalty (internal, internal, internal), FUNCTION 6 gbt_float4_picksplit (internal, internal), FUNCTION 7 gbt_float4_same (internal, internal, internal), STORAGE gbtreekey8; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_float8_consistent(internal,float8,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_float8_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_float8_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_float8_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_float8_union(bytea, internal) RETURNS gbtreekey16 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_float8_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_float8_ops DEFAULT FOR TYPE float8 USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_float8_consistent (internal, float8, int2, oid, internal), FUNCTION 2 gbt_float8_union (bytea, internal), FUNCTION 3 gbt_float8_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_float8_penalty (internal, internal, internal), FUNCTION 6 gbt_float8_picksplit (internal, internal), FUNCTION 7 gbt_float8_same (internal, internal, internal), STORAGE gbtreekey16; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_ts_consistent(internal,timestamp,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_tstz_consistent(internal,timestamptz,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_ts_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_tstz_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_ts_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_ts_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_ts_union(bytea, internal) RETURNS gbtreekey16 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_ts_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_timestamp_ops DEFAULT FOR TYPE timestamp USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_ts_consistent (internal, timestamp, int2, oid, internal), FUNCTION 2 gbt_ts_union (bytea, internal), FUNCTION 3 gbt_ts_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_ts_penalty (internal, internal, internal), FUNCTION 6 gbt_ts_picksplit (internal, internal), FUNCTION 7 gbt_ts_same (internal, internal, internal), STORAGE gbtreekey16; CREATE OPERATOR CLASS CREATE OPERATOR CLASS gist_timestamptz_ops DEFAULT FOR TYPE timestamptz USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_tstz_consistent (internal, timestamptz, int2, oid, internal), FUNCTION 2 gbt_ts_union (bytea, internal), FUNCTION 3 gbt_tstz_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_ts_penalty (internal, internal, internal), FUNCTION 6 gbt_ts_picksplit (internal, internal), FUNCTION 7 gbt_ts_same (internal, internal, internal), STORAGE gbtreekey16; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_time_consistent(internal,time,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_timetz_consistent(internal,timetz,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_time_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_timetz_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_time_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_time_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_time_union(bytea, internal) RETURNS gbtreekey16 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_time_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_time_ops DEFAULT FOR TYPE time USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_time_consistent (internal, time, int2, oid, internal), FUNCTION 2 gbt_time_union (bytea, internal), FUNCTION 3 gbt_time_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_time_penalty (internal, internal, internal), FUNCTION 6 gbt_time_picksplit (internal, internal), FUNCTION 7 gbt_time_same (internal, internal, internal), STORAGE gbtreekey16; CREATE OPERATOR CLASS CREATE OPERATOR CLASS gist_timetz_ops DEFAULT FOR TYPE timetz USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_timetz_consistent (internal, timetz, int2, oid, internal), FUNCTION 2 gbt_time_union (bytea, internal), FUNCTION 3 gbt_timetz_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_time_penalty (internal, internal, internal), FUNCTION 6 gbt_time_picksplit (internal, internal), FUNCTION 7 gbt_time_same (internal, internal, internal), STORAGE gbtreekey16; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_date_consistent(internal,date,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_date_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_date_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_date_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_date_union(bytea, internal) RETURNS gbtreekey8 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_date_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_date_ops DEFAULT FOR TYPE date USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_date_consistent (internal, date, int2, oid, internal), FUNCTION 2 gbt_date_union (bytea, internal), FUNCTION 3 gbt_date_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_date_penalty (internal, internal, internal), FUNCTION 6 gbt_date_picksplit (internal, internal), FUNCTION 7 gbt_date_same (internal, internal, internal), STORAGE gbtreekey8; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_intv_consistent(internal,interval,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_intv_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_intv_decompress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_intv_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_intv_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_intv_union(bytea, internal) RETURNS gbtreekey32 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_intv_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_interval_ops DEFAULT FOR TYPE interval USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_intv_consistent (internal, interval, int2, oid, internal), FUNCTION 2 gbt_intv_union (bytea, internal), FUNCTION 3 gbt_intv_compress (internal), FUNCTION 4 gbt_intv_decompress (internal), FUNCTION 5 gbt_intv_penalty (internal, internal, internal), FUNCTION 6 gbt_intv_picksplit (internal, internal), FUNCTION 7 gbt_intv_same (internal, internal, internal), STORAGE gbtreekey32; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_cash_consistent(internal,money,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_cash_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_cash_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_cash_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_cash_union(bytea, internal) RETURNS gbtreekey8 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_cash_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_cash_ops DEFAULT FOR TYPE money USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_cash_consistent (internal, money, int2, oid, internal), FUNCTION 2 gbt_cash_union (bytea, internal), FUNCTION 3 gbt_cash_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_cash_penalty (internal, internal, internal), FUNCTION 6 gbt_cash_picksplit (internal, internal), FUNCTION 7 gbt_cash_same (internal, internal, internal), STORAGE gbtreekey16; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_macad_consistent(internal,macaddr,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_macad_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_macad_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_macad_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_macad_union(bytea, internal) RETURNS gbtreekey16 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_macad_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_macaddr_ops DEFAULT FOR TYPE macaddr USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_macad_consistent (internal, macaddr, int2, oid, internal), FUNCTION 2 gbt_macad_union (bytea, internal), FUNCTION 3 gbt_macad_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_macad_penalty (internal, internal, internal), FUNCTION 6 gbt_macad_picksplit (internal, internal), FUNCTION 7 gbt_macad_same (internal, internal, internal), STORAGE gbtreekey16; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_text_consistent(internal,text,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_bpchar_consistent(internal,bpchar,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_text_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_bpchar_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_text_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_text_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_text_union(bytea, internal) RETURNS gbtreekey_var AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_text_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_text_ops DEFAULT FOR TYPE text USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_text_consistent (internal, text, int2, oid, internal), FUNCTION 2 gbt_text_union (bytea, internal), FUNCTION 3 gbt_text_compress (internal), FUNCTION 4 gbt_var_decompress (internal), FUNCTION 5 gbt_text_penalty (internal, internal, internal), FUNCTION 6 gbt_text_picksplit (internal, internal), FUNCTION 7 gbt_text_same (internal, internal, internal), STORAGE gbtreekey_var; CREATE OPERATOR CLASS CREATE OPERATOR CLASS gist_bpchar_ops DEFAULT FOR TYPE bpchar USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_bpchar_consistent (internal, bpchar , int2, oid, internal), FUNCTION 2 gbt_text_union (bytea, internal), FUNCTION 3 gbt_bpchar_compress (internal), FUNCTION 4 gbt_var_decompress (internal), FUNCTION 5 gbt_text_penalty (internal, internal, internal), FUNCTION 6 gbt_text_picksplit (internal, internal), FUNCTION 7 gbt_text_same (internal, internal, internal), STORAGE gbtreekey_var; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_bytea_consistent(internal,bytea,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_bytea_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_bytea_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_bytea_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_bytea_union(bytea, internal) RETURNS gbtreekey_var AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_bytea_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_bytea_ops DEFAULT FOR TYPE bytea USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_bytea_consistent (internal, bytea, int2, oid, internal), FUNCTION 2 gbt_bytea_union (bytea, internal), FUNCTION 3 gbt_bytea_compress (internal), FUNCTION 4 gbt_var_decompress (internal), FUNCTION 5 gbt_bytea_penalty (internal, internal, internal), FUNCTION 6 gbt_bytea_picksplit (internal, internal), FUNCTION 7 gbt_bytea_same (internal, internal, internal), STORAGE gbtreekey_var; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_numeric_consistent(internal,numeric,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_numeric_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_numeric_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_numeric_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_numeric_union(bytea, internal) RETURNS gbtreekey_var AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_numeric_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_numeric_ops DEFAULT FOR TYPE numeric USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_numeric_consistent (internal, numeric, int2, oid, internal), FUNCTION 2 gbt_numeric_union (bytea, internal), FUNCTION 3 gbt_numeric_compress (internal), FUNCTION 4 gbt_var_decompress (internal), FUNCTION 5 gbt_numeric_penalty (internal, internal, internal), FUNCTION 6 gbt_numeric_picksplit (internal, internal), FUNCTION 7 gbt_numeric_same (internal, internal, internal), STORAGE gbtreekey_var; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_bit_consistent(internal,bit,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_bit_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_bit_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_bit_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_bit_union(bytea, internal) RETURNS gbtreekey_var AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_bit_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_bit_ops DEFAULT FOR TYPE bit USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_bit_consistent (internal, bit, int2, oid, internal), FUNCTION 2 gbt_bit_union (bytea, internal), FUNCTION 3 gbt_bit_compress (internal), FUNCTION 4 gbt_var_decompress (internal), FUNCTION 5 gbt_bit_penalty (internal, internal, internal), FUNCTION 6 gbt_bit_picksplit (internal, internal), FUNCTION 7 gbt_bit_same (internal, internal, internal), STORAGE gbtreekey_var; CREATE OPERATOR CLASS CREATE OPERATOR CLASS gist_vbit_ops DEFAULT FOR TYPE varbit USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_bit_consistent (internal, bit, int2, oid, internal), FUNCTION 2 gbt_bit_union (bytea, internal), FUNCTION 3 gbt_bit_compress (internal), FUNCTION 4 gbt_var_decompress (internal), FUNCTION 5 gbt_bit_penalty (internal, internal, internal), FUNCTION 6 gbt_bit_picksplit (internal, internal), FUNCTION 7 gbt_bit_same (internal, internal, internal), STORAGE gbtreekey_var; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gbt_inet_consistent(internal,inet,int2,oid,internal) RETURNS bool AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_inet_compress(internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_inet_penalty(internal,internal,internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_inet_picksplit(internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_inet_union(bytea, internal) RETURNS gbtreekey16 AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gbt_inet_same(internal, internal, internal) RETURNS internal AS '$libdir/btree_gist' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_inet_ops DEFAULT FOR TYPE inet USING gist AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 gbt_inet_consistent (internal, inet, int2, oid, internal), FUNCTION 2 gbt_inet_union (bytea, internal), FUNCTION 3 gbt_inet_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_inet_penalty (internal, internal, internal), FUNCTION 6 gbt_inet_picksplit (internal, internal), FUNCTION 7 gbt_inet_same (internal, internal, internal), STORAGE gbtreekey16; CREATE OPERATOR CLASS CREATE OPERATOR CLASS gist_cidr_ops DEFAULT FOR TYPE cidr USING gist AS OPERATOR 1 < (inet, inet) , OPERATOR 2 <= (inet, inet) , OPERATOR 3 = (inet, inet) , OPERATOR 4 >= (inet, inet) , OPERATOR 5 > (inet, inet) , FUNCTION 1 gbt_inet_consistent (internal, inet, int2, oid, internal), FUNCTION 2 gbt_inet_union (bytea, internal), FUNCTION 3 gbt_inet_compress (internal), FUNCTION 4 gbt_decompress (internal), FUNCTION 5 gbt_inet_penalty (internal, internal, internal), FUNCTION 6 gbt_inet_picksplit (internal, internal), FUNCTION 7 gbt_inet_same (internal, internal, internal), STORAGE gbtreekey16; CREATE OPERATOR CLASS ==> Mk func/chronos/chronos_utils.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/chronos/chronos_utils.sql; then touch func/chronos/chronos_utils.ck; else kill 17144; fi /* Helper functions for Chronos Temporal Extensions Author: Scott Bailey License: BSD Copyright (c) 2009, Scott Bailey All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY Scott Bailey ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /***************************************************************** * CONFIG *****************************************************************/ /* * These settings controls how much to increment or decrement when * adding numeric values to date/time values. * Common values: * '1us' or '1 microsecond' (default for temporal project period) * '1ms' '1 millisecond' * '1s' '1 second' (default for timestamp, period and time) * '1m' '1 minute' * '1h' '1 hour' * '1d' '1 day' (default for date) */ CREATE OR REPLACE FUNCTION timestamp_granularity() RETURNS INTERVAL AS $$ SELECT INTERVAL '1s'; $$ LANGUAGE 'sql' IMMUTABLE; CREATE FUNCTION COMMENT ON FUNCTION timestamp_granularity() IS 'Configuration for units to use in time/timestamp math.'; COMMENT CREATE OR REPLACE FUNCTION date_granularity() RETURNS INTERVAL AS $$ SELECT INTERVAL '1 day'; $$ LANGUAGE 'sql' IMMUTABLE; CREATE FUNCTION COMMENT ON FUNCTION date_granularity() IS 'Configuration for units to use in date math.'; COMMENT CREATE OR REPLACE FUNCTION period_granularity() RETURNS INTERVAL AS $$ SELECT INTERVAL '1s'; $$ LANGUAGE 'sql' IMMUTABLE; CREATE FUNCTION COMMENT ON FUNCTION period_granularity() IS 'Configuration for units to use in period math.'; COMMENT /***************************************************************** * timestamp functions *****************************************************************/ CREATE OR REPLACE FUNCTION prior(ts1 timestampTz) RETURNS timestampTz AS $$ SELECT $1 - timestamp_granularity(); $$ LANGUAGE 'sql' IMMUTABLE STRICT COST 1; CREATE FUNCTION COMMENT ON FUNCTION prior(timestampTz) IS 'Timestamp immediately prior to ts1 (1 granule)'; COMMENT CREATE OR REPLACE FUNCTION prior(ts1 timestamp) RETURNS timestamp AS $$ SELECT $1 - timestamp_granularity(); $$ LANGUAGE 'sql' IMMUTABLE STRICT COST 1; CREATE FUNCTION COMMENT ON FUNCTION prior(timestamp) IS 'Timestamp immediately prior to ts1 (1 granule)'; COMMENT CREATE OR REPLACE FUNCTION next(ts1 timestampTz) RETURNS timestampTz AS $$ SELECT $1 + timestamp_granularity(); $$ LANGUAGE 'sql' IMMUTABLE STRICT COST 1; CREATE FUNCTION COMMENT ON FUNCTION next(timestampTz) IS 'Timestamp immediately after ts1 (1 granule)'; COMMENT CREATE OR REPLACE FUNCTION next(timestamp) RETURNS timestamp AS $$ SELECT $1 + timestamp_granularity(); $$ LANGUAGE 'sql' IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION next(timestamp) IS 'Timestamp immediately after ts1 (1 granule)'; COMMENT CREATE OR REPLACE FUNCTION timestamp_add(ts1 timestampTz, n numeric) RETURNS timestampTz AS $$ SELECT $1 + timestamp_granularity() * $2; $$ LANGUAGE 'sql' IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION timestamp_add(timestampTz, numeric) IS 'Add n timestamp granules to ts1'; COMMENT CREATE OR REPLACE FUNCTION timestamp_add(ts1 timestamp, n numeric) RETURNS timestamp AS $$ SELECT $1 + timestamp_granularity() * $2; $$ LANGUAGE 'sql' IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION timestamp_add(timestamp, numeric) IS 'Add n timestamp granules to ts1'; COMMENT CREATE OR REPLACE FUNCTION timestamp_subtract(ts1 timestampTz, n numeric) RETURNS timestampTz AS $$ SELECT $1 - timestamp_granularity() * $2; $$ LANGUAGE 'sql' IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION timestamp_subtract(timestampTz, numeric) IS 'Subtract n timestamp granules from ts1'; COMMENT CREATE OR REPLACE FUNCTION timestamp_subtract(ts1 timestamp, n numeric) RETURNS timestamp AS $$ SELECT $1 - timestamp_granularity() * $2; $$ LANGUAGE 'sql' IMMUTABLE STRICT COST 1; CREATE FUNCTION COMMENT ON FUNCTION timestamp_subtract(timestamp, numeric) IS 'Subtract n timestamp granules from ts1'; COMMENT /***************************************************************** * date functions *****************************************************************/ CREATE OR REPLACE FUNCTION date_add(d1 date, n numeric) RETURNS timestampTz AS $$ SELECT $1::timestampTz + date_granularity() * $2; $$ LANGUAGE 'sql' IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION date_add(date, numeric) IS 'Add n date granules to d1. The date type only allows interger addition. This allows numeric addition and returns a timestampTz.'; COMMENT CREATE OR REPLACE FUNCTION date_subtract(d1 date, n numeric) RETURNS timestampTz AS $$ SELECT $1::timestampTz - date_granularity() * $2; $$ LANGUAGE 'sql' IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION date_subtract(date, numeric) IS 'Subtract n date granules from d1. The date type only allows interger subtraction. This allows numeric subtraction and returns a timestampTz.'; COMMENT CREATE OR REPLACE FUNCTION last_day(d1 date) RETURNS date AS $$ SELECT CASE WHEN mo IN (1,3,5,7,8,10,12) THEN mon_start + 30 -- 31 days WHEN mo IN (4,6,9,11) THEN mon_start + 29 -- 30 days WHEN MOD(yr, 4) != 0 OR (MOD(yr, 100) = 0 AND MOD(yr, 400) != 0) THEN mon_start + 27 -- 28 days ELSE mon_start + 28 -- 29 days END FROM ( SELECT EXTRACT(MONTH FROM $1)::int AS mo, EXTRACT(YEAR FROM $1)::int AS yr, DATE_TRUNC('MONTH', $1)::date AS mon_start ) sub $$ LANGUAGE 'sql' IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION last_day(date) IS 'Returns the last day in the month containing d1'; COMMENT CREATE OR REPLACE FUNCTION week_of_month(d1 date, dir int) RETURNS int AS $$ SELECT CASE WHEN $2 >= 0 THEN CEIL(EXTRACT(DAY FROM $1) / 7)::int ELSE 0 - CEIL( (EXTRACT(DAY FROM last_day($1)) - EXTRACT(DAY FROM $1) + 1) / 7 )::int END $$ LANGUAGE 'sql' IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION week_of_month(date, int) IS 'Get the week of month from either the start or end of the month.'; COMMENT CREATE OR REPLACE FUNCTION week_of_month(d1 date) RETURNS int AS $$ SELECT week_of_month($1, 1); $$ LANGUAGE 'sql' IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION week_of_month(date) IS 'Get the week of month from the start of the month.'; COMMENT CREATE OR REPLACE FUNCTION day_of_cycle( dt date, anchor_date date, cycle_length int ) RETURNS int AS $$ SELECT CASE WHEN $1 > $2 THEN MOD($1 - $2, $3) WHEN $1 < $2 THEN MOD($3 - MOD($1 - $2, $3), $3) ELSE 0 END; $$ LANGUAGE 'sql' IMMUTABLE; CREATE FUNCTION COMMENT ON FUNCTION day_of_cycle(date,date,int) IS 'Find where a date is in a cycle given the anchor date and length of a cycle.'; COMMENT /***************************************************************** * time functions *****************************************************************/ CREATE OR REPLACE FUNCTION time_add(t1 time, n numeric) RETURNS time AS $$ SELECT $1 + timestamp_granularity() * $2; $$ LANGUAGE 'sql' IMMUTABLE STRICT COST 1; CREATE FUNCTION COMMENT ON FUNCTION time_add(time, numeric) IS 'Add n timestamp granules to t1.'; COMMENT CREATE OR REPLACE FUNCTION time_add(t1 timeTz, n numeric) RETURNS timeTz AS $$ SELECT $1 + timestamp_granularity() * $2; $$ LANGUAGE 'sql' IMMUTABLE STRICT COST 1; CREATE FUNCTION COMMENT ON FUNCTION time_add(timeTz, numeric) IS 'Add n timestamp granules to t1.'; COMMENT CREATE OR REPLACE FUNCTION time_subtract(t1 time, n numeric) RETURNS time AS $$ SELECT $1 - timestamp_granularity() * $2; $$ LANGUAGE 'sql' IMMUTABLE STRICT COST 1; CREATE FUNCTION COMMENT ON FUNCTION time_subtract(time, numeric) IS 'Subtract n timestamp granules from t1'; COMMENT CREATE OR REPLACE FUNCTION time_subtract(t1 timeTz, n numeric) RETURNS timeTz AS $$ SELECT $1 - timestamp_granularity() * $2; $$ LANGUAGE 'sql' IMMUTABLE STRICT COST 1; CREATE FUNCTION COMMENT ON FUNCTION time_subtract(timeTz, numeric) IS 'Subtract n timestamp granules from t1'; COMMENT /***************************************************************** * interval functions *****************************************************************/ CREATE OR REPLACE FUNCTION seconds(i interval) RETURNS numeric AS $$ SELECT EXTRACT(EPOCH FROM $1)::numeric; $$ LANGUAGE 'sql' IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION seconds(interval) IS 'Convert interval to seconds. Opposite of to_interval(numeric).'; COMMENT CREATE OR REPLACE FUNCTION to_interval(n numeric) RETURNS interval AS $$ SELECT INTERVAL '1s' * $1; $$ LANGUAGE 'sql' IMMUTABLE STRICT; CREATE FUNCTION COMMENT ON FUNCTION to_interval(numeric) IS 'Convert seconds to interval. Opposite of duration(interval)'; COMMENT /***************************************************************** * operators *****************************************************************/ CREATE OPERATOR +( PROCEDURE = timestamp_add, LEFTARG = timestampTz, RIGHTARG = numeric ); CREATE OPERATOR CREATE OPERATOR -( PROCEDURE = timestamp_subtract, LEFTARG = timestampTz, RIGHTARG = numeric ); CREATE OPERATOR CREATE OPERATOR +( PROCEDURE = timestamp_add, LEFTARG = timestamp, RIGHTARG = numeric ); CREATE OPERATOR CREATE OPERATOR -( PROCEDURE = timestamp_subtract, LEFTARG = timestamp, RIGHTARG = numeric ); CREATE OPERATOR CREATE OPERATOR +( PROCEDURE = date_add, LEFTARG = date, RIGHTARG = numeric ); CREATE OPERATOR CREATE OPERATOR -( PROCEDURE = date_subtract, LEFTARG = date, RIGHTARG = numeric ); CREATE OPERATOR CREATE OPERATOR +( PROCEDURE = time_add, LEFTARG = time, RIGHTARG = numeric ); CREATE OPERATOR CREATE OPERATOR -( PROCEDURE = time_subtract, LEFTARG = time, RIGHTARG = numeric ); CREATE OPERATOR CREATE OPERATOR +( PROCEDURE = time_add, LEFTARG = timetz, RIGHTARG = numeric ); CREATE OPERATOR CREATE OPERATOR -( PROCEDURE = time_subtract, LEFTARG = timetz, RIGHTARG = numeric ); CREATE OPERATOR ==> Mk func/temporal/period.o gcc -O2 -Wall -fPIC -I/usr/local/include/postgresql/server -o func/temporal/period.o -c func/temporal/period.c patch=`dirname $prereq`/`basename $prereq .in`.patch patch -o func/temporal/period.sql func/temporal/period.sql.in <$patch Hmm... Looks like a unified diff to me... The text leading up to this was: -------------------------- |--- func/temporal/period.sql.in Sun Jul 3 16:25:52 2011 |+++ func/temporal/period.sql Fri Jul 1 22:04:27 2011 -------------------------- Patching file func/temporal/period.sql.in using Plan A... Hunk #1 succeeded at 8. Hunk #2 succeeded at 26. done ==> Mk table/excep.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/excep.sql; then touch table/excep.ck; else kill 22097; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * For exception descriptions see dbdata. */ drop table if exists excep cascade; psql:table/excep.sql:21: NOTICE: table "excep" does not exist, skipping DROP TABLE create table excep ( excepid bigserial not null primary key, excepdesc varchar(64) ); psql:table/excep.sql:28: NOTICE: CREATE TABLE will create implicit sequence "excep_excepid_seq" for serial column "excep.excepid" psql:table/excep.sql:28: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "excep_pkey" for table "excep" CREATE TABLE /* * Insert default exceptions */ insert into excep (excepid, excepdesc) values (0, 'Change extension from building 023 to building 043'), (1, 'Telular call: use srvid = "15" and use message "Desvío"'); INSERT 0 2 ==> Mk table/place.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/place.sql; then touch table/place.ck; else kill 4838; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Starts place localization implementation. */ drop table if exists place cascade; psql:table/place.sql:21: NOTICE: table "place" does not exist, skipping DROP TABLE create table place ( placeid bigserial not null primary key, placena varchar(126) unique not null ); psql:table/place.sql:28: NOTICE: CREATE TABLE will create implicit sequence "place_placeid_seq" for serial column "place.placeid" psql:table/place.sql:28: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "place_pkey" for table "place" psql:table/place.sql:28: NOTICE: CREATE TABLE / UNIQUE will create implicit index "place_placena_key" for table "place" CREATE TABLE ==> Mk table/doc.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/doc.sql; then touch table/doc.ck; else kill 440; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Stores the revision history and the access path (in web) * for the wiki sub-system. */ drop table if exists doc cascade; psql:table/doc.sql:23: NOTICE: table "doc" does not exist, skipping DROP TABLE create table doc ( docpath ltree primary key, docisact boolean default true not null /* see table/doc_doclarev.sql for more columns */ ); psql:table/doc.sql:31: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "doc_pkey" for table "doc" CREATE TABLE ==> Mk func/docaclt.o gcc -O2 -Wall -fPIC -I/usr/local/include/postgresql/server -o func/docaclt.o -c func/docaclt.c ==> Mk table/sap_avfcodext.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/sap_avfcodext.sql; then touch table/sap_avfcodext.ck; else kill 4402; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* XXX we should split this in multiple tables... adding primary keys */ /* * We also do some sap autoupdating with SAP's @AVFCONMUTADOR table (to build * table), but we insert automatically to our local building table. */ drop table if exists sap_avfcodext cascade; psql:table/sap_avfcodext.sql:23: NOTICE: table "sap_avfcodext" does not exist, skipping DROP TABLE /* * from sap's '[@avfcodext]' table */ create table sap_avfcodext ( savfid bigint not null check (savfid > 0), savfbuildno varchar(126) check (savfbuildno != ''), savfextno varchar(126) check (savfextno ~ '^[[:digit:]]+$'), savfpass varchar(126) check (savfpass ~ '^[[:digit:]]+$') ); CREATE TABLE ==> Mk table/sap_inv.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/sap_inv.sql; then touch table/sap_inv.ck; else kill 4968; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * sap_inv */ drop table if exists sap_inv cascade; psql:table/sap_inv.sql:20: NOTICE: table "sap_inv" does not exist, skipping DROP TABLE /* * from sap's tables oinv and [@ecfd_einv] */ create table sap_inv ( sinvcos varchar(126) not null check (sinvcos like '_____'), sinvuuid varchar(126) not null ); CREATE TABLE ==> Mk table/sap_octr.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/sap_octr.sql; then touch table/sap_octr.ck; else kill 2153; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* XXX: change this fucking ugly mnemonics */ /* * sap_octr contains id (cstmrcode) of the client */ drop table if exists sap_octr cascade; psql:table/sap_octr.sql:22: NOTICE: table "sap_octr" does not exist, skipping DROP TABLE /* * from sap's 'octr' table */ create table sap_octr ( soctrid bigint check (soctrid > 0) primary key, soctrcos varchar(126) check (soctrcos like '_____') constraint "soctrcos must be upper case" check (upper(soctrcos) = soctrcos), soctrsttm timestamp without time zone, soctrentm timestamp without time zone ); psql:table/sap_octr.sql:39: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "sap_octr_pkey" for table "sap_octr" CREATE TABLE ==> Mk func/rolki.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/rolki.sql; then touch func/rolki.ck; else kill 2810; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Inserts a rolki by rolkna only if it doesn't exist, don't raising an error if * it doesn't exist */ create or replace function insrolki(rolkna text) returns setof rolki strict language sql as $$ insert into rolki (rolkna) values ($1) except all select rolkna from rolki where rolkna = $1 returning *; $$; CREATE FUNCTION ==> Mk func/pgcrypto.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/pgcrypto.sql; then touch func/pgcrypto.ck; else kill 10128; fi /* $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.sql.in,v 1.15 2007/11/13 04:24:28 momjian Exp $ */ SET search_path = public; SET CREATE OR REPLACE FUNCTION digest(text, text) RETURNS bytea AS '$libdir/pgcrypto', 'pg_digest' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION digest(bytea, text) RETURNS bytea AS '$libdir/pgcrypto', 'pg_digest' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION hmac(text, text, text) RETURNS bytea AS '$libdir/pgcrypto', 'pg_hmac' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION hmac(bytea, bytea, text) RETURNS bytea AS '$libdir/pgcrypto', 'pg_hmac' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION crypt(text, text) RETURNS text AS '$libdir/pgcrypto', 'pg_crypt' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gen_salt(text) RETURNS text AS '$libdir/pgcrypto', 'pg_gen_salt' LANGUAGE C VOLATILE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gen_salt(text, int4) RETURNS text AS '$libdir/pgcrypto', 'pg_gen_salt_rounds' LANGUAGE C VOLATILE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION encrypt(bytea, bytea, text) RETURNS bytea AS '$libdir/pgcrypto', 'pg_encrypt' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION decrypt(bytea, bytea, text) RETURNS bytea AS '$libdir/pgcrypto', 'pg_decrypt' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION encrypt_iv(bytea, bytea, bytea, text) RETURNS bytea AS '$libdir/pgcrypto', 'pg_encrypt_iv' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION decrypt_iv(bytea, bytea, bytea, text) RETURNS bytea AS '$libdir/pgcrypto', 'pg_decrypt_iv' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gen_random_bytes(int4) RETURNS bytea AS '$libdir/pgcrypto', 'pg_random_bytes' LANGUAGE 'C' VOLATILE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_sym_encrypt(text, text) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_sym_encrypt_text' LANGUAGE C STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_sym_encrypt_bytea(bytea, text) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_sym_encrypt_bytea' LANGUAGE C STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_sym_encrypt(text, text, text) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_sym_encrypt_text' LANGUAGE C STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_sym_encrypt_bytea(bytea, text, text) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_sym_encrypt_bytea' LANGUAGE C STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_sym_decrypt(bytea, text) RETURNS text AS '$libdir/pgcrypto', 'pgp_sym_decrypt_text' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_sym_decrypt_bytea(bytea, text) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_sym_decrypt_bytea' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_sym_decrypt(bytea, text, text) RETURNS text AS '$libdir/pgcrypto', 'pgp_sym_decrypt_text' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_sym_decrypt_bytea(bytea, text, text) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_sym_decrypt_bytea' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_pub_encrypt(text, bytea) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_pub_encrypt_text' LANGUAGE C STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_pub_encrypt_bytea' LANGUAGE C STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_pub_encrypt(text, bytea, text) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_pub_encrypt_text' LANGUAGE C STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_pub_encrypt_bytea' LANGUAGE C STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_pub_decrypt(bytea, bytea) RETURNS text AS '$libdir/pgcrypto', 'pgp_pub_decrypt_text' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_pub_decrypt_bytea' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_pub_decrypt(bytea, bytea, text) RETURNS text AS '$libdir/pgcrypto', 'pgp_pub_decrypt_text' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_pub_decrypt_bytea' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_pub_decrypt(bytea, bytea, text, text) RETURNS text AS '$libdir/pgcrypto', 'pgp_pub_decrypt_text' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text) RETURNS bytea AS '$libdir/pgcrypto', 'pgp_pub_decrypt_bytea' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION pgp_key_id(bytea) RETURNS text AS '$libdir/pgcrypto', 'pgp_key_id_w' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION armor(bytea) RETURNS text AS '$libdir/pgcrypto', 'pg_armor' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION dearmor(text) RETURNS bytea AS '$libdir/pgcrypto', 'pg_dearmor' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION ==> Mk func/hstore.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/hstore.sql; then touch func/hstore.ck; else kill 13611; fi /* $PostgreSQL: pgsql/contrib/hstore/hstore.sql.in,v 1.15 2010/07/02 20:36:48 rhaas Exp $ */ SET search_path = public; SET CREATE TYPE hstore; CREATE TYPE CREATE OR REPLACE FUNCTION hstore_in(cstring) RETURNS hstore AS '$libdir/hstore' LANGUAGE C STRICT IMMUTABLE; psql:func/hstore.sql:11: NOTICE: return type hstore is only a shell CREATE FUNCTION CREATE OR REPLACE FUNCTION hstore_out(hstore) RETURNS cstring AS '$libdir/hstore' LANGUAGE C STRICT IMMUTABLE; psql:func/hstore.sql:16: NOTICE: argument type hstore is only a shell CREATE FUNCTION CREATE OR REPLACE FUNCTION hstore_recv(internal) RETURNS hstore AS '$libdir/hstore' LANGUAGE C STRICT IMMUTABLE; psql:func/hstore.sql:21: NOTICE: return type hstore is only a shell CREATE FUNCTION CREATE OR REPLACE FUNCTION hstore_send(hstore) RETURNS bytea AS '$libdir/hstore' LANGUAGE C STRICT IMMUTABLE; psql:func/hstore.sql:26: NOTICE: argument type hstore is only a shell CREATE FUNCTION CREATE TYPE hstore ( INTERNALLENGTH = -1, INPUT = hstore_in, OUTPUT = hstore_out, RECEIVE = hstore_recv, SEND = hstore_send, STORAGE = extended ); CREATE TYPE CREATE OR REPLACE FUNCTION hstore_version_diag(hstore) RETURNS integer AS '$libdir/hstore','hstore_version_diag' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION fetchval(hstore,text) RETURNS text AS '$libdir/hstore','hstore_fetchval' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR -> ( LEFTARG = hstore, RIGHTARG = text, PROCEDURE = fetchval ); CREATE OPERATOR CREATE OR REPLACE FUNCTION slice_array(hstore,text[]) RETURNS text[] AS '$libdir/hstore','hstore_slice_to_array' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR -> ( LEFTARG = hstore, RIGHTARG = text[], PROCEDURE = slice_array ); CREATE OPERATOR CREATE OR REPLACE FUNCTION slice(hstore,text[]) RETURNS hstore AS '$libdir/hstore','hstore_slice_to_hstore' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION isexists(hstore,text) RETURNS bool AS '$libdir/hstore','hstore_exists' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION exist(hstore,text) RETURNS bool AS '$libdir/hstore','hstore_exists' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR ? ( LEFTARG = hstore, RIGHTARG = text, PROCEDURE = exist, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OR REPLACE FUNCTION exists_any(hstore,text[]) RETURNS bool AS '$libdir/hstore','hstore_exists_any' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR ?| ( LEFTARG = hstore, RIGHTARG = text[], PROCEDURE = exists_any, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OR REPLACE FUNCTION exists_all(hstore,text[]) RETURNS bool AS '$libdir/hstore','hstore_exists_all' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR ?& ( LEFTARG = hstore, RIGHTARG = text[], PROCEDURE = exists_all, RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OR REPLACE FUNCTION isdefined(hstore,text) RETURNS bool AS '$libdir/hstore','hstore_defined' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION defined(hstore,text) RETURNS bool AS '$libdir/hstore','hstore_defined' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION delete(hstore,text) RETURNS hstore AS '$libdir/hstore','hstore_delete' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION delete(hstore,text[]) RETURNS hstore AS '$libdir/hstore','hstore_delete_array' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION delete(hstore,hstore) RETURNS hstore AS '$libdir/hstore','hstore_delete_hstore' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR - ( LEFTARG = hstore, RIGHTARG = text, PROCEDURE = delete ); CREATE OPERATOR CREATE OPERATOR - ( LEFTARG = hstore, RIGHTARG = text[], PROCEDURE = delete ); CREATE OPERATOR CREATE OPERATOR - ( LEFTARG = hstore, RIGHTARG = hstore, PROCEDURE = delete ); CREATE OPERATOR CREATE OR REPLACE FUNCTION hs_concat(hstore,hstore) RETURNS hstore AS '$libdir/hstore','hstore_concat' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR || ( LEFTARG = hstore, RIGHTARG = hstore, PROCEDURE = hs_concat ); CREATE OPERATOR CREATE OR REPLACE FUNCTION hs_contains(hstore,hstore) RETURNS bool AS '$libdir/hstore','hstore_contains' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION hs_contained(hstore,hstore) RETURNS bool AS '$libdir/hstore','hstore_contained' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR @> ( LEFTARG = hstore, RIGHTARG = hstore, PROCEDURE = hs_contains, COMMUTATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR <@ ( LEFTARG = hstore, RIGHTARG = hstore, PROCEDURE = hs_contained, COMMUTATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR @ ( LEFTARG = hstore, RIGHTARG = hstore, PROCEDURE = hs_contains, COMMUTATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OPERATOR ~ ( LEFTARG = hstore, RIGHTARG = hstore, PROCEDURE = hs_contained, COMMUTATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR CREATE OR REPLACE FUNCTION tconvert(text,text) RETURNS hstore AS '$libdir/hstore','hstore_from_text' LANGUAGE C IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION hstore(text,text) RETURNS hstore AS '$libdir/hstore','hstore_from_text' LANGUAGE C IMMUTABLE; CREATE FUNCTION CREATE OPERATOR => ( LEFTARG = text, RIGHTARG = text, PROCEDURE = hstore ); psql:func/hstore.sql:228: WARNING: => is deprecated as an operator name DETAIL: This name may be disallowed altogether in future versions of PostgreSQL. CREATE OPERATOR CREATE OR REPLACE FUNCTION hstore(text[],text[]) RETURNS hstore AS '$libdir/hstore', 'hstore_from_arrays' LANGUAGE C IMMUTABLE; CREATE FUNCTION CREATE FUNCTION hstore(text[]) RETURNS hstore AS '$libdir/hstore', 'hstore_from_array' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE CAST (text[] AS hstore) WITH FUNCTION hstore(text[]); CREATE CAST CREATE OR REPLACE FUNCTION hstore(record) RETURNS hstore AS '$libdir/hstore', 'hstore_from_record' LANGUAGE C IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION hstore_to_array(hstore) RETURNS text[] AS '$libdir/hstore','hstore_to_array' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR %% ( RIGHTARG = hstore, PROCEDURE = hstore_to_array ); CREATE OPERATOR CREATE OR REPLACE FUNCTION hstore_to_matrix(hstore) RETURNS text[] AS '$libdir/hstore','hstore_to_matrix' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR %# ( RIGHTARG = hstore, PROCEDURE = hstore_to_matrix ); CREATE OPERATOR CREATE OR REPLACE FUNCTION akeys(hstore) RETURNS text[] AS '$libdir/hstore','hstore_akeys' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION avals(hstore) RETURNS text[] AS '$libdir/hstore','hstore_avals' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION skeys(hstore) RETURNS setof text AS '$libdir/hstore','hstore_skeys' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION svals(hstore) RETURNS setof text AS '$libdir/hstore','hstore_svals' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION each(IN hs hstore, OUT key text, OUT value text) RETURNS SETOF record AS '$libdir/hstore','hstore_each' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION populate_record(anyelement,hstore) RETURNS anyelement AS '$libdir/hstore', 'hstore_populate_record' LANGUAGE C IMMUTABLE; CREATE FUNCTION CREATE OPERATOR #= ( LEFTARG = anyelement, RIGHTARG = hstore, PROCEDURE = populate_record ); CREATE OPERATOR CREATE OR REPLACE FUNCTION hstore_eq(hstore,hstore) RETURNS boolean AS '$libdir/hstore','hstore_eq' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION hstore_ne(hstore,hstore) RETURNS boolean AS '$libdir/hstore','hstore_ne' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION hstore_gt(hstore,hstore) RETURNS boolean AS '$libdir/hstore','hstore_gt' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION hstore_ge(hstore,hstore) RETURNS boolean AS '$libdir/hstore','hstore_ge' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION hstore_lt(hstore,hstore) RETURNS boolean AS '$libdir/hstore','hstore_lt' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION hstore_le(hstore,hstore) RETURNS boolean AS '$libdir/hstore','hstore_le' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OR REPLACE FUNCTION hstore_cmp(hstore,hstore) RETURNS integer AS '$libdir/hstore','hstore_cmp' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR = ( LEFTARG = hstore, RIGHTARG = hstore, PROCEDURE = hstore_eq, COMMUTATOR = =, NEGATOR = <>, RESTRICT = eqsel, JOIN = eqjoinsel, MERGES, HASHES ); CREATE OPERATOR CREATE OPERATOR <> ( LEFTARG = hstore, RIGHTARG = hstore, PROCEDURE = hstore_ne, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); CREATE OPERATOR CREATE OPERATOR #<# ( LEFTARG = hstore, RIGHTARG = hstore, PROCEDURE = hstore_lt, COMMUTATOR = #>#, NEGATOR = #>=#, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR CREATE OPERATOR #<=# ( LEFTARG = hstore, RIGHTARG = hstore, PROCEDURE = hstore_le, COMMUTATOR = #>=#, NEGATOR = #>#, RESTRICT = scalarltsel, JOIN = scalarltjoinsel ); CREATE OPERATOR CREATE OPERATOR #># ( LEFTARG = hstore, RIGHTARG = hstore, PROCEDURE = hstore_gt, COMMUTATOR = #<#, NEGATOR = #<=#, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR CREATE OPERATOR #>=# ( LEFTARG = hstore, RIGHTARG = hstore, PROCEDURE = hstore_ge, COMMUTATOR = #<=#, NEGATOR = #<#, RESTRICT = scalargtsel, JOIN = scalargtjoinsel ); CREATE OPERATOR CREATE OPERATOR CLASS btree_hstore_ops DEFAULT FOR TYPE hstore USING btree AS OPERATOR 1 #<# , OPERATOR 2 #<=# , OPERATOR 3 = , OPERATOR 4 #>=# , OPERATOR 5 #># , FUNCTION 1 hstore_cmp(hstore,hstore); CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION hstore_hash(hstore) RETURNS integer AS '$libdir/hstore','hstore_hash' LANGUAGE C STRICT IMMUTABLE; CREATE FUNCTION CREATE OPERATOR CLASS hash_hstore_ops DEFAULT FOR TYPE hstore USING hash AS OPERATOR 1 = , FUNCTION 1 hstore_hash(hstore); CREATE OPERATOR CLASS CREATE TYPE ghstore; CREATE TYPE CREATE OR REPLACE FUNCTION ghstore_in(cstring) RETURNS ghstore AS '$libdir/hstore' LANGUAGE C STRICT IMMUTABLE; psql:func/hstore.sql:435: NOTICE: return type ghstore is only a shell CREATE FUNCTION CREATE OR REPLACE FUNCTION ghstore_out(ghstore) RETURNS cstring AS '$libdir/hstore' LANGUAGE C STRICT IMMUTABLE; psql:func/hstore.sql:440: NOTICE: argument type ghstore is only a shell CREATE FUNCTION CREATE TYPE ghstore ( INTERNALLENGTH = -1, INPUT = ghstore_in, OUTPUT = ghstore_out ); CREATE TYPE CREATE OR REPLACE FUNCTION ghstore_compress(internal) RETURNS internal AS '$libdir/hstore' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ghstore_decompress(internal) RETURNS internal AS '$libdir/hstore' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ghstore_penalty(internal,internal,internal) RETURNS internal AS '$libdir/hstore' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ghstore_picksplit(internal, internal) RETURNS internal AS '$libdir/hstore' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ghstore_union(internal, internal) RETURNS internal AS '$libdir/hstore' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ghstore_same(internal, internal, internal) RETURNS internal AS '$libdir/hstore' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION ghstore_consistent(internal,internal,int,oid,internal) RETURNS bool AS '$libdir/hstore' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gist_hstore_ops DEFAULT FOR TYPE hstore USING gist AS OPERATOR 7 @> , OPERATOR 9 ?(hstore,text) , OPERATOR 10 ?|(hstore,text[]) , OPERATOR 11 ?&(hstore,text[]) , OPERATOR 13 @ , FUNCTION 1 ghstore_consistent (internal, internal, int, oid, internal), FUNCTION 2 ghstore_union (internal, internal), FUNCTION 3 ghstore_compress (internal), FUNCTION 4 ghstore_decompress (internal), FUNCTION 5 ghstore_penalty (internal, internal, internal), FUNCTION 6 ghstore_picksplit (internal, internal), FUNCTION 7 ghstore_same (internal, internal, internal), STORAGE ghstore; CREATE OPERATOR CLASS CREATE OR REPLACE FUNCTION gin_extract_hstore(internal, internal) RETURNS internal AS '$libdir/hstore' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gin_extract_hstore_query(internal, internal, int2, internal, internal) RETURNS internal AS '$libdir/hstore' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OR REPLACE FUNCTION gin_consistent_hstore(internal, int2, internal, int4, internal, internal) RETURNS bool AS '$libdir/hstore' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION CREATE OPERATOR CLASS gin_hstore_ops DEFAULT FOR TYPE hstore USING gin AS OPERATOR 7 @>, OPERATOR 9 ?(hstore,text), OPERATOR 10 ?|(hstore,text[]), OPERATOR 11 ?&(hstore,text[]), FUNCTION 1 bttextcmp(text,text), FUNCTION 2 gin_extract_hstore(internal, internal), FUNCTION 3 gin_extract_hstore_query(internal, internal, int2, internal, internal), FUNCTION 4 gin_consistent_hstore(internal, int2, internal, int4, internal, internal), STORAGE text; CREATE OPERATOR CLASS ==> Mk func/revpath.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/revpath.sql; then touch func/revpath.ck; else kill 11013; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Converts a ltree rrevpath value into an int[] (_int in postgres * conventions). */ create or replace function rrevpathto_int(a ltree) returns int[] language sql immutable strict as $$ select regexp_split_to_array($1::text, E'\\.')::int[]; $$; CREATE FUNCTION ==> Mk func/tool.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/tool.sql; then touch func/tool.ck; else kill 1726; fi /* * Copyright (c) 2009,2010,2011 Abel Camarillo * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * tool.sql: miscellaneous functions */ CREATE OR REPLACE FUNCTION get_date_split(start_t timestamptz, end_t timestamptz, delta interval) returns setof timestamptz language sql as $$ SELECT ss * interval '1 sec' + timestamptz 'epoch' FROM generate_series(extract(epoch from $1)::int, extract(epoch from $2)::int, extract(epoch from $3)::int) as s(ss); $$; CREATE FUNCTION /* * runs a sql string */ create or replace function sql_exec (sql text) returns boolean language plpgsql as $$ declare begin -- raise notice 'running query : %', sql; execute sql; return true; end; $$; CREATE FUNCTION /* * Print message. Raises a 'level' message. * It's boolean return type makes it useful to use in CASE WHEN ... END */ create or replace function pmsg(level text, msg anyelement) returns boolean language plpgsql as $$ begin case when level = 'EXCEPTION' then raise EXCEPTION '%', msg; when level = 'WARNING' then raise WARNING '%', msg; when level = 'NOTICE' then raise NOTICE '%', msg; when level = 'INFO' then raise INFO '%', msg; when level = 'LOG' then raise LOG '%', msg; when level = 'DEBUG' then raise DEBUG '%', msg; end case; return true; end; $$; CREATE FUNCTION ==> Mk role/auth.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f role/auth.sql; then touch role/auth.ck; else kill 9638; fi select n_srv.creatrolifne('auth'); creatrolifne -------------- f (1 row) alter role "auth" inherit; ALTER ROLE grant usage on schema public, n_srv to "auth"; GRANT grant usage on schema public to auth; GRANT ==> Mk role/cdr.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f role/cdr.sql; then touch role/cdr.ck; else kill 32014; fi select n_srv.creatrolifne('cdr'); creatrolifne -------------- f (1 row) alter role "cdr" inherit; ALTER ROLE grant usage on schema public, n_srv to "cdr"; GRANT ==> Mk role/ext.www.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f role/ext.www.sql; then touch role/ext.www.ck; else kill 8134; fi select n_srv.creatrolifne('ext.www'); creatrolifne -------------- f (1 row) alter role "ext.www" encrypted password 'EXT.WWW_USER_PASSWORD' inherit login; ALTER ROLE grant usage on schema public, n_srv to "ext.www"; GRANT ==> Mk role/int.www.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f role/int.www.sql; then touch role/int.www.ck; else kill 3969; fi select n_srv.creatrolifne('int.www'); creatrolifne -------------- f (1 row) alter role "int.www" encrypted password 'INT_WWW_USER_PASSWORD' inherit login; ALTER ROLE grant usage on schema public, n_srv to "int.www"; GRANT ==> Mk role/n_srv.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f role/n_srv.sql; then touch role/n_srv.ck; else kill 18230; fi select n_srv.creatrolifne('n_srv'); creatrolifne -------------- f (1 row) alter role "n_srv" encrypted password 'N_SRV_USER_PASSWORD' inherit login; ALTER ROLE grant usage on schema public, n_srv to "n_srv"; GRANT ==> Mk role/www.cookie.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f role/www.cookie.sql; then touch role/www.cookie.ck; else kill 17574; fi select n_srv.creatrolifne('www.cookie'); creatrolifne -------------- f (1 row) alter role "www.cookie" inherit; ALTER ROLE grant usage on schema public, n_srv to "www.cookie"; GRANT ==> Mk func/cdrt.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/cdrt.sql; then touch func/cdrt.ck; else kill 5790; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ create or replace function gcdrt(name text) returns bigint strict stable language sql as $$ select cdrtid from cdrt where cdrtna = $1; $$; CREATE FUNCTION ==> Mk table/build.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/build.sql; then touch table/build.ck; else kill 5790; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Contains definitions of buildings. */ drop table if exists build cascade; psql:table/build.sql:21: NOTICE: table "build" does not exist, skipping DROP TABLE create table build ( buildid bigserial not null primary key, buildna varchar(126), buildno varchar(32) not null unique constraint "buildno must not be an empty string" check (length(buildno) > 0), bnumtref bigint not null references numtref (numtrefid) on update cascade on delete restrict, bcdrt bigint references cdrt (cdrtid) on update restrict on delete restrict ); psql:table/build.sql:42: NOTICE: CREATE TABLE will create implicit sequence "build_buildid_seq" for serial column "build.buildid" psql:table/build.sql:42: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "build_pkey" for table "build" psql:table/build.sql:42: NOTICE: CREATE TABLE / UNIQUE will create implicit index "build_buildno_key" for table "build" CREATE TABLE ==> Mk func/numtref.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/numtref.sql; then touch func/numtref.ck; else kill 11856; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ create or replace function gnumtref(name text) returns bigint strict stable language sql as $$ select numtrefid from numtref where numtrefna = $1; $$; CREATE FUNCTION ==> Mk table/numtre.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/numtre.sql; then touch table/numtre.ck; else kill 26290; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Numeration tree (numtre) */ drop table if exists numtre cascade; psql:table/numtre.sql:20: NOTICE: table "numtre" does not exist, skipping DROP TABLE create table numtre ( numtreid bigserial not null primary key, ntnumtref bigint not null references numtref (numtrefid) on update cascade on delete cascade, numtresttm timestamp not null default '-infinity', numtreentm timestamp not null default 'infinity' constraint "numtresttm must be less or equal than numtentm" check (numtresttm <= numtreentm), constraint "numtre: no more than one tree per family valid concurrently" exclude using gist (cube(array[ (case when numtresttm = '-infinity' then '-inf'::float8 when numtresttm = 'infinity' then 'inf'::float8 else extract(epoch from numtresttm)::float8 end), ntnumtref::float8 ], array[ (case when numtreentm = '-infinity' then '-inf'::float8 when numtreentm = 'infinity' then 'inf'::float8 else extract(epoch from numtreentm)::float8 end), ntnumtref::float8 ] ) with &&) ); psql:table/numtre.sql:62: NOTICE: CREATE TABLE will create implicit sequence "numtre_numtreid_seq" for serial column "numtre.numtreid" psql:table/numtre.sql:62: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "numtre_pkey" for table "numtre" psql:table/numtre.sql:62: NOTICE: CREATE TABLE / EXCLUDE will create implicit index "numtre: no more than one tree per family valid concurrently" for table "numtre" CREATE TABLE ==> Mk func/telno.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/telno.sql; then touch func/telno.ck; else kill 26838; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Telephone number: * Ideally we would like to put a lot of constraints on this... as soon as we * know which should be good... */ drop domain if exists telno cascade; psql:func/telno.sql:22: NOTICE: type "telno" does not exist, skipping DROP DOMAIN create domain telno as text; CREATE DOMAIN /* Get ltree */ create or replace function gltree(telno) returns ltree strict immutable language sql as $$ select array_to_string(regexp_split_to_array(a, ''), '.')::ltree from (values (regexp_replace($1::text, '[^[:digit:]]', '', 'g'))) as t(a) $$; CREATE FUNCTION ==> Mk table/rolki.sqlidx if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/rolki.sqlidx; then touch table/rolki.ckidx; else kill 21386; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ drop index if exists rolki_rolkna_idx; psql:table/rolki.sqlidx:17: NOTICE: index "rolki_rolkna_idx" does not exist, skipping DROP INDEX create index rolki_rolkna_idx on rolki (rolkna varchar_pattern_ops); CREATE INDEX ==> Mk table/rolki.sqldata if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/rolki.sqldata; then touch table/rolki.ckdata; else kill 26491; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ select insrolki('ext.www.client'); insrolki -------------------- (1,ext.www.client) (1 row) select insrolki('ext.www.hclient'); insrolki --------------------- (2,ext.www.hclient) (1 row) select insrolki('int.www'); insrolki ------------- (3,int.www) (1 row) ==> Mk func/temporal/period.so ld -Bshareable -o func/temporal/period.so func/temporal/period.o ==> Mk table/place.sqlidx if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/place.sqlidx; then touch table/place.ckidx; else kill 28099; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ drop index if exists place_placena_idx; psql:table/place.sqlidx:17: NOTICE: index "place_placena_idx" does not exist, skipping DROP INDEX create index place_placena_idx on place (placena); CREATE INDEX ==> Mk table/docfile.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/docfile.sql; then touch table/docfile.ck; else kill 28837; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ drop table if exists docfile cascade; psql:table/docfile.sql:17: NOTICE: table "docfile" does not exist, skipping DROP TABLE create table docfile ( docfidoc ltree not null references doc (docpath) on update cascade on delete cascade, docfipa varchar(4096) not null constraint "docfipa must not be empty" check (docfipa != ''), docfidesc text constraint "docfidesc must not be empty" check (docfidesc != '') ); CREATE TABLE ==> Mk table/doc.sqlidx if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/doc.sqlidx; then touch table/doc.ckidx; else kill 7957; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ drop index if exists doc_docpath_idx; psql:table/doc.sqlidx:17: NOTICE: index "doc_docpath_idx" does not exist, skipping DROP INDEX create index doc_docpath_idx on doc using gist(docpath); CREATE INDEX ==> Mk func/docaclt.so ld -Bshareable -o func/docaclt.so func/docaclt.o ==> Mk table/sap_avfcodext.sqlidx if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/sap_avfcodext.sqlidx; then touch table/sap_avfcodext.ckidx; else kill 21486; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ drop index if exists sap_avfcodext_savfid_idx; psql:table/sap_avfcodext.sqlidx:17: NOTICE: index "sap_avfcodext_savfid_idx" does not exist, skipping DROP INDEX drop index if exists sap_avfcodext_savfbuildno_idx; psql:table/sap_avfcodext.sqlidx:18: NOTICE: index "sap_avfcodext_savfbuildno_idx" does not exist, skipping DROP INDEX drop index if exists sap_avfcodext_savfextno_idx; psql:table/sap_avfcodext.sqlidx:19: NOTICE: index "sap_avfcodext_savfextno_idx" does not exist, skipping DROP INDEX drop index if exists sap_avfcodext_savfpass_idx; psql:table/sap_avfcodext.sqlidx:20: NOTICE: index "sap_avfcodext_savfpass_idx" does not exist, skipping DROP INDEX create index sap_avfcodext_savfid_idx on sap_avfcodext (savfid); CREATE INDEX create index sap_avfcodext_savfbuildno_idx on sap_avfcodext (savfbuildno); CREATE INDEX create index sap_avfcodext_savfextno_idx on sap_avfcodext (savfextno); CREATE INDEX create index sap_avfcodext_savfpass_idx on sap_avfcodext (savfpass); CREATE INDEX ==> Mk table/sap_inv.sqlidx if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/sap_inv.sqlidx; then touch table/sap_inv.ckidx; else kill 31339; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ drop index if exists sap_inv_sinvuuid_idx; psql:table/sap_inv.sqlidx:17: NOTICE: index "sap_inv_sinvuuid_idx" does not exist, skipping DROP INDEX create index sap_inv_sinvuuid_idx on sap_inv (sinvuuid); CREATE INDEX ==> Mk table/sap_octr.sqlidx if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/sap_octr.sqlidx; then touch table/sap_octr.ckidx; else kill 20410; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ drop index if exists sap_octr_soctrcos_idx_idx; psql:table/sap_octr.sqlidx:17: NOTICE: index "sap_octr_soctrcos_idx_idx" does not exist, skipping DROP INDEX create index sap_octr_soctrcos_idx on sap_octr (soctrcos); CREATE INDEX ==> Mk func/crypt.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/crypt.sql; then touch func/crypt.ck; else kill 23867; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Returns text salt. */ create or replace function gsalt() returns text language sql as $$ select gen_salt('bf', 7); $$; CREATE FUNCTION ==> Mk func/syncrel.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/syncrel.sql; then touch func/syncrel.ck; else kill 29791; fi /* * Copyright (c) 2009,2010,2011 Abel Camarillo * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Get SQL to sync relationships (tables). * * updates orel with the values of nrel, assuming that they have the * same number of columns , same name, and type of values, this is useful for "SAP" * compatibility tables auto-update, old_table and new_table are the name of * the tables to update, this is supossed to be abstract and arbitrary * * the primary key of the tables (we know that it must exist and must be only * one column) is used for the comparison, you cannot update the primary key of * a row using this method. */ create or replace function gsqlsyncrel(orel regclass, nrel regclass) returns text[] strict language plpgsql as $$ declare ins hstore; upd hstore; del hstore; ret text[]; r record; begin ins := hstore(array['cols', 'selcols', 'join', 'where', 'returning'], null); upd := hstore(array['cols', 'where', 'returning'], null); del := hstore(array['where', 'returning']); ret := array[]::text[]; -- orel keys, columns with a PRIMARY KEY with orelkeys as ( select attname, attnum, contype, conkey from pg_catalog.pg_constraint as cons join pg_catalog.pg_attribute as att on attrelid = conrelid and array[attnum] operator(pg_catalog.<@) conkey where conrelid = orel::regclass and contype = 'p' and attnum >= 0 and attisdropped is false ), -- Columns from orel that aren't key orelcols as ( select attname, attnum from pg_catalog.pg_attribute as att where attrelid = orel::regclass and attnum >= 0 and attisdropped is false except all select attname, attnum from orelkeys ), nrelkeys as ( select attname, attnum, contype, conkey from pg_catalog.pg_constraint as cons join pg_catalog.pg_attribute as att on attrelid = conrelid and array[attnum] operator(pg_catalog.<@) conkey where conrelid = nrel::regclass and contype = 'p' and attnum >= 0 and attisdropped is false ), nrelcols as ( select attname, attnum from pg_catalog.pg_attribute as att where attrelid = nrel::regclass and attnum >= 0 and attisdropped is false except all select attname, attnum from nrelkeys ), relcols as ( -- Non key columns that are in orel _and_ in nrel select attname from orelcols intersect all select attname from nrelcols ) select case when okeys = nkeys then okeys else NULL end as keys, okeys, ocols, nkeys, ncols, cols into strict r from (values ((select array_agg(attname) from orelkeys), (select array_agg(attname) from orelcols), (select array_agg(attname) from nrelkeys), (select array_agg(attname) from nrelcols), (select array_agg(attname) from relcols))) as foo(okeys, ocols, nkeys, ncols, cols); if r.okeys is NULL then raise exception 'table "%" must have a primary key', orel; elsif r.nkeys is NULL then raise exception 'table "%" must have a primary key', nrel; elsif r.keys is NULL then raise exception 'keys from "%" must be equal to keys of "%"', orel, nrel; end if; -- DEBUG -- raise notice 'primary key is : %', pkey; -- generate set assignment lists upd := upd || hstore('cols', (select string_agg(format('%I = %s.%1$I', col, nrel), ', ' order by col) from unnest(r.keys || r.cols) as t(col))); -- generate where conditions, check that primary keys are equal upd := upd || hstore('where', (select string_agg(format('%s.%I = %s.%2$I', orel, key, nrel), ' AND ' order by key) from unnest(r.keys) as t(key))); upd := upd || hstore('returning', (select string_agg(format('%s.%I', orel, key), ', ' order by key) from unnest(r.keys) as t(key))); -- generate the update query ret := ret || format('UPDATE %s SET %s FROM %s WHERE %s RETURNING %s;', orel, upd -> 'cols', nrel, upd -> 'where', upd -> 'returning'); -- generate the new row insert query: insert into orel the rows that -- are on nrel but aren't in orel, searching using the primary keys. ins := ins || hstore('cols', (select string_agg(format('%I', col), ', ' order by col) from unnest(r.keys || r.cols) as t(col))); ins := ins || hstore('selcols', (select string_agg(format('%s.%I', nrel, col), ', ' order by col) from unnest(r.keys || r.cols) as t(col))); ins := ins || hstore('join', (select string_agg(format('%s.%I = %s.%2$I', orel, key, nrel), ' AND ' order by key) from unnest(r.keys) as t(key))); ins := ins || hstore('where', (select string_agg(format('%s.%I IS NULL', orel, key), ' OR ' order by key) from unnest(r.keys) as t(key))); ins := ins || hstore('returning', (select string_agg(format('%s.%I', orel, key), ', ' order by key) from unnest(r.keys) as t(key))); ret := ret || format('INSERT INTO %s (%s) ' || 'SELECT %s FROM %s RIGHT JOIN %s ON %s ' || 'WHERE %s RETURNING %s;', orel, ins -> 'cols', ins -> 'selcols', orel, nrel, ins -> 'join', ins -> 'where', ins -> 'returning'); -- generate the row delete query: delete from orel the rows that are -- on it but aren't on nrel. del := del || hstore('where', (select string_agg(format('%s.%I = %s.%2$I', orel, key, nrel), ' AND ' order by key) from unnest(r.keys) as t(key))); del := del || hstore('returning', (select string_agg(format('%s.%I', orel, key), ', ' order by key) from unnest(r.keys) as t(key))); ret := ret || format('DELETE FROM %s WHERE NOT EXISTS ' || '(SELECT 1 FROM %s WHERE %s) RETURNING %s;', orel, nrel, del -> 'where', del -> 'returning'); return ret; end; $$; CREATE FUNCTION /* * Sync relations using the output of gsqlsyncrel() */ create or replace function syncrel(sql text[], out rows bigint, out query text) returns setof record strict language plpgsql as $$ declare _sql text; r record; begin for _sql in select a from unnest(sql) as foo(a) loop rows := 0; query := _sql; for r in execute _sql loop rows := rows + 1; end loop; return next; end loop; return; end; $$; CREATE FUNCTION ==> Mk func/auth.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/auth.sql; then touch func/auth.ck; else kill 30558; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * If the user have good credentials returns rolid otherwise -1. */ create or replace function auth(una text, upass text, ukna text) returns bigint language plpgsql security definer set search_path = n_srv, public, pg_temp as $$ declare urolid bigint; ukid bigint; -- kind of rol (id) begin -- DEBUG: Show params. -- raise notice 'Calling auth(%, %, %)', una, upass, ukna. urolid := -1; ukid := null; -- Obtain the rolkiid. select rolkiid into ukid from rolki where rolkna = ukna; -- DEBUG: Check if ukid is null. -- raise notice 'Hurr'; -- If ukid is null return false (this avoid overhead for crypt func). if ukid is null then return -1; end if; -- raise notice 'Durr'; -- DEBUG. -- Make auth with crypt function. select rolid into urolid from role where rolna = una and rolkid = ukid and rolpass = crypt(upass, rolpass); -- Sets urolid to -1 bescause query set it to null. if urolid is null then urolid := -1; end if; return urolid; end; $$; CREATE FUNCTION alter function n_srv.auth(text, text, text) owner to "auth"; ALTER FUNCTION /* * Checks if upass hash to the same value as the field rolpass on the table role * for the user una, returns rolid of user una if password is ok, -1 otherwise */ create or replace function auth(una text, upass text) returns bigint language plpgsql security definer set search_path = n_srv, public, pg_temp as $$ declare _rolid bigint; begin select rolid into _rolid from role where rolna = una and rolpass = crypt(upass, rolpass); if _rolid is null then _rolid := -1; end if; return _rolid; end; $$; CREATE FUNCTION alter function n_srv.auth(text, text) owner to "auth"; ALTER FUNCTION ==> Mk role/ext.www.client.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f role/ext.www.client.sql; then touch role/ext.www.client.ck; else kill 10720; fi select n_srv.creatrolifne('ext.www.client'); creatrolifne -------------- f (1 row) alter role "ext.www.client" inherit; ALTER ROLE grant usage on schema public, n_srv to "ext.www.client"; GRANT grant "ext.www.client" to "ext.www"; psql:role/ext.www.client.sql:4: NOTICE: role "ext.www" is already a member of role "ext.www.client" GRANT ROLE ==> Mk role/ext.www.hclient.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f role/ext.www.hclient.sql; then touch role/ext.www.hclient.ck; else kill 31484; fi select n_srv.creatrolifne('ext.www.hclient'); creatrolifne -------------- f (1 row) alter role "ext.www.hclient" inherit; ALTER ROLE grant usage on schema public, n_srv to "ext.www.hclient"; GRANT grant "ext.www.hclient" to "ext.www"; psql:role/ext.www.hclient.sql:4: NOTICE: role "ext.www" is already a member of role "ext.www.hclient" GRANT ROLE ==> Mk table/rolki.sqlgrant if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/rolki.sqlgrant; then touch table/rolki.ckgrant; else kill 19634; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ select revoke_all_on_obj('rolki'::text); revoke_all_on_obj ------------------- 0 (1 row) grant select on rolki to "auth"; GRANT grant select on rolki to "ext.www"; GRANT select insrolki('ext.www.client'); insrolki ---------- (0 rows) select insrolki('ext.www.hclient'); insrolki ---------- (0 rows) select insrolki('int.www'); insrolki ---------- (0 rows) ==> Mk table/sap_octr.sqlgrant if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/sap_octr.sqlgrant; then touch table/sap_octr.ckgrant; else kill 29756; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ select revoke_all_on_obj('sap_octr'::text); revoke_all_on_obj ------------------- 0 (1 row) grant select on sap_octr to "ext.www"; GRANT ==> Mk table/doc.sqlgrant if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/doc.sqlgrant; then touch table/doc.ckgrant; else kill 25087; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ select revoke_all_on_obj('doc'::text); revoke_all_on_obj ------------------- 0 (1 row) grant select, insert, update, delete on doc to "int.www"; GRANT ==> Mk func/cookie.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/cookie.sql; then touch func/cookie.ck; else kill 32238; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * If the cookie was write returns true otherwise false. */ create or replace function wrt_ck(usessid text, uexpiry timestamp, urolid bigint) returns boolean language plpgsql security definer set search_path = n_srv, public, pg_temp as $$ declare status boolean; begin status := false; begin insert into cookie (sessid, expiry, rolid) values (usessid, uexpiry, urolid) returning true into status; exception when foreign_key_violation then status := false; end; if status is null then status := false; end if; return status; end; $$; CREATE FUNCTION alter function wrt_ck(text, timestamp, bigint) owner to "www.cookie"; ALTER FUNCTION /* * Check if the cookie is valid and return rolid otherwise return -1. */ create or replace function chk_ck(usessid text) returns bigint language plpgsql security definer set search_path = n_srv, public, pg_temp as $$ declare urolid bigint; begin urolid := -1; select rolid into urolid from cookie where sessid = usessid and expiry > now() at time zone 'utc' and active; if urolid is null then urolid = -1; end if; return urolid; end; $$; CREATE FUNCTION alter function chk_ck(text) owner to "www.cookie"; ALTER FUNCTION /* * If cookie is deleted returns true otherwise false. */ create or replace function rm_ck(usessid text) returns boolean language plpgsql security definer set search_path = n_srv, public, pg_temp as $$ declare status boolean; begin status := false; delete from cookie where sessid = usessid returning true into status; if status is null then status := false; end if; return status; end; $$; CREATE FUNCTION alter function rm_ck(text) owner to "www.cookie"; ALTER FUNCTION /* * Set cookie not active. */ create or replace function out_ck(usessid text) returns boolean language plpgsql security definer set search_path = n_srv, public, pg_temp as $$ declare status boolean; begin status := false; update cookie set active = false, entm = timezone('utc', now()) where sessid = usessid returning true into status; if status is null then status := false; end if; return status; end; $$; CREATE FUNCTION alter function out_ck(text) owner to "www.cookie"; ALTER FUNCTION ==> Mk table/ext.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/ext.sql; then touch table/ext.ck; else kill 8652; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Contains the extension numbers. */ drop table if exists ext cascade; psql:table/ext.sql:21: NOTICE: table "ext" does not exist, skipping DROP TABLE create table ext ( extid bigserial not null primary key check (extid >= 0), extno varchar(32) not null constraint "extno must be only digits" check (extno ~ '^[[:digit:]]+$'), extbuild bigint not null references build (buildid) on update cascade on delete cascade, unique (extno, extbuild) ); psql:table/ext.sql:36: NOTICE: CREATE TABLE will create implicit sequence "ext_extid_seq" for serial column "ext.extid" psql:table/ext.sql:36: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "ext_pkey" for table "ext" psql:table/ext.sql:36: NOTICE: CREATE TABLE / UNIQUE will create implicit index "ext_extno_extbuild_key" for table "ext" CREATE TABLE ==> Mk table/build.sqlidx if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/build.sqlidx; then touch table/build.ckidx; else kill 14949; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ drop index if exists build_buildno_idx; psql:table/build.sqlidx:17: NOTICE: index "build_buildno_idx" does not exist, skipping DROP INDEX create index build_buildno_idx on build (buildno); CREATE INDEX ==> Mk func/build.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/build.sql; then touch func/build.ck; else kill 8654; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ create or replace function gbuild (text) returns bigint language sql stable returns null on null input as $$ select buildid from build where buildno = $1; $$; CREATE FUNCTION ==> Mk func/numtre.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/numtre.sql; then touch func/numtre.ck; else kill 32711; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Search for a valid numeration tree member of some numeration tree family on a * determinated date. * 'date' must be in UTC. */ create or replace function gnumtre(trefid bigint, date timestamp) returns bigint strict stable language sql as $$ select numtreid from numtre where ntnumtref = $1 and $2 between numtresttm and numtreentm; $$; CREATE FUNCTION /* * Same as gnumtre(bigint, timestamp) but first converts 'date' from timestamptz * to timestamp using 'UTC' as time zone. */ create or replace function gnumtre(trefid bigint, date timestamptz) returns bigint strict stable language sql as $$ select gnumtre($1, ($2 at time zone 'utc')::timestamp); $$; CREATE FUNCTION /* * Same as gnumtre(bigint, timestamp) but with timestamp defaulting to now() */ create or replace function gnumtre(trefid bigint) returns bigint strict stable language sql as $$ select gnumtre($1, (now() at time zone 'utc')::timestamp); $$; CREATE FUNCTION ==> Mk table/num.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/num.sql; then touch table/num.ck; else kill 26637; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Numeration: stores numeration forest. */ drop table if exists num cascade; psql:table/num.sql:20: NOTICE: table "num" does not exist, skipping DROP TABLE create table num ( numid serial not null primary key, constraint "numid must be non-negative" check (numid >= 0), nnumtre bigint not null references numtre (numtreid) on update cascade on delete cascade, nnum ltree not null constraint "nnum must use single number paths" check (nnum::text ~ E'^([[:digit:]]\\.)*[[:digit:]]$'), numpl bigint references place (placeid) on update cascade on delete cascade, numsrv bigint references srv (srvid) on update cascade on delete cascade, unique (nnumtre, nnum) ); psql:table/num.sql:43: NOTICE: CREATE TABLE will create implicit sequence "num_numid_seq" for serial column "num.numid" psql:table/num.sql:43: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "num_pkey" for table "num" psql:table/num.sql:43: NOTICE: CREATE TABLE / UNIQUE will create implicit index "num_nnumtre_nnum_key" for table "num" CREATE TABLE ==> Mk table/sap_avfdtcall.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/sap_avfdtcall.sql; then touch table/sap_avfdtcall.ck; else kill 13634; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * sap_avfdtcall */ drop table if exists sap_avfdtcall cascade; psql:table/sap_avfdtcall.sql:20: NOTICE: table "sap_avfdtcall" does not exist, skipping DROP TABLE /* * from sap's 'avfdtcall' table */ create table sap_avfdtcall ( scallid bigint primary key, scallcos varchar(126) not null check (scallcos like '_____'), scallsttm timestamp without time zone not null, scallsrv bigint not null, scallbill time not null, scallcost money not null, scalldest telno not null, scallext varchar(32) not null constraint "scallext must be only digits" check (scallext ~ '^[[:digit:]]+$'), scallcode bigint not null ); psql:table/sap_avfdtcall.sql:46: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "sap_avfdtcall_pkey" for table "sap_avfdtcall" CREATE TABLE mv func/temporal/period.so func/lib/period.so ==> Mk table/docfile.sqlgrant if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/docfile.sqlgrant; then touch table/docfile.ckgrant; else kill 28284; fi /* * Copyright (c) 2011 Rafael Diaz de Leon Plata * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ select revoke_all_on_obj('docfile'::text); revoke_all_on_obj ------------------- 0 (1 row) grant select, insert, update, delete on docfile to "int.www"; GRANT mv func/docaclt.so func/lib/docaclt.so ==> Mk table/sap_avfcodext.sqlgrant if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/sap_avfcodext.sqlgrant; then touch table/sap_avfcodext.ckgrant; else kill 30604; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ select revoke_all_on_obj('sap_avfcodext'::text); revoke_all_on_obj ------------------- 0 (1 row) grant select on sap_avfcodext to "ext.www"; GRANT ==> Mk table/srv.sqlgrant if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/srv.sqlgrant; then touch table/srv.ckgrant; else kill 14051; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ select revoke_all_on_obj('srv'::text); revoke_all_on_obj ------------------- 0 (1 row) grant select on srv to "ext.www.client"; GRANT ==> Mk table/ast.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/ast.sql; then touch table/ast.ck; else kill 30497; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ drop table if exists ast cascade; psql:table/ast.sql:17: NOTICE: table "ast" does not exist, skipping DROP TABLE /* * asterisk cdr table, this is a forest of one-by-one relationships between * calls. */ create table ast ( astid bigserial primary key constraint "astid must be non-negative" check (astid >= 0), astold bigint unique references ast (astid) on update cascade on delete cascade, astcode varchar(126) constraint "astcode must be digits" check (astcode ~ '^[[:digit:]]+$') constraint "astcode must not be an empty string" check (astcode != ''), astcost money constraint "astcost must be non-negative" check (astcost >= '0.0'), astorig varchar(126) constraint "astorig must be upper case" check (upper(astorig) = astorig) constraint "astorig must not be an empty string" check (astorig != ''), astdest telno not null constraint "astdest must be upper case" check (upper(astdest) = astdest) constraint "astdest must not be an empty string" check (astdest != ''), astdnum int[], astdcont varchar(126) not null constraint "astdcont must be upper case" check (upper(astdcont) = astdcont) constraint "astdcont must not be an empty string" check (astdcont != ''), astcli varchar(126) not null constraint "astcli must be upper case" check (upper(astcli) = astcli) constraint "astcli must not be an empty string" check (astcli != ''), astchan varchar(126) not null constraint "astchan must be upper case" check (upper(astchan) = astchan) constraint "astchan must not be an empty string" check (astchan != ''), asttrunk varchar(126) constraint "asttrunk must be upper case" check (upper(asttrunk) = asttrunk) constraint "asttrunk must not be an empty string" check (asttrunk != ''), astlapp varchar(126) constraint "astlapp must be upper case" check (upper(astlapp) = astlapp) constraint "astlapp must not be an empty string" check (astlapp != ''), astldata varchar(126) constraint "astldata must be upper case" check (upper(astldata) = astldata) constraint "astldata must not be an empty string" check (astldata != ''), aststtm timestamptz not null, astdur int not null constraint "astdur must be non negative" check (astdur >= 0), astbill int not null constraint "astbill must be non negative" check (astbill >= 0), astdispo varchar(126) not null constraint "astdispo must be upper case" check (upper(astdispo) = astdispo) constraint "astdispo must not be an empty string" check (astdispo != ''), astamafl varchar(126) not null constraint "astamafl must be upper case" check (upper(astamafl) = astamafl) constraint "astamafl must not be an empty string" check (astamafl != ''), astext bigint not null references ext (extid) on update cascade on delete cascade, astvalid boolean, astsrv bigint references srv (srvid) on update cascade on delete cascade, astexcep bigint references excep (excepid) on update cascade on delete cascade, constraint "astid must not be equal to astold" check (astid != astold), constraint "astbill must be less or equal to astdur" check (astbill <= astdur), constraint "ast must be unique" exclude ( (case when astold is null then '-1'::bigint else astold end) with =, aststtm with =, astext with =) ); psql:table/ast.sql:150: NOTICE: CREATE TABLE will create implicit sequence "ast_astid_seq" for serial column "ast.astid" psql:table/ast.sql:150: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "ast_pkey" for table "ast" psql:table/ast.sql:150: NOTICE: CREATE TABLE / UNIQUE will create implicit index "ast_astold_key" for table "ast" psql:table/ast.sql:150: NOTICE: CREATE TABLE / EXCLUDE will create implicit index "ast must be unique" for table "ast" CREATE TABLE ==> Mk table/did.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/did.sql; then touch table/did.ck; else kill 17929; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * DID: Direct Inward Dialing number */ drop table if exists did cascade; psql:table/did.sql:20: NOTICE: table "did" does not exist, skipping DROP TABLE create table did ( didid bigserial primary key, didno varchar(126) not null unique, didext bigint not null references ext (extid) on update cascade on delete cascade ); psql:table/did.sql:29: NOTICE: CREATE TABLE will create implicit sequence "did_didid_seq" for serial column "did.didid" psql:table/did.sql:29: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "did_pkey" for table "did" psql:table/did.sql:29: NOTICE: CREATE TABLE / UNIQUE will create implicit index "did_didno_key" for table "did" CREATE TABLE ==> Mk table/ext.sqlidx if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/ext.sqlidx; then touch table/ext.ckidx; else kill 32625; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ drop index if exists ext_extno_idx; psql:table/ext.sqlidx:17: NOTICE: index "ext_extno_idx" does not exist, skipping DROP INDEX create index ext_extno_idx on ext (extno); CREATE INDEX ==> Mk func/ext.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/ext.sql; then touch func/ext.ck; else kill 26209; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ create or replace function gext(_extno text, _buildid bigint) returns bigint language plpgsql volatile strict as $$ declare eid bigint; -- Extension ID begin select extid into eid from ext where extno = _extno and extbuild = _buildid; if found then return eid; end if; begin insert into ext (extno, extbuild) values (_extno, _buildid) returning extid into strict eid; return eid; exception /* Somebody inserted it between our select and our insert */ when unique_violation then select extid into strict eid from ext where extno = _extno and extbuild = _buildid; return eid; end; return eid; end; $$; CREATE FUNCTION ==> Mk table/dest_num.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/dest_num.sql; then touch table/dest_num.ck; else kill 11788; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * This table caches the values of getnumerations(number), in a future we * need to real materialize this table */ drop table if exists dest_num cascade; psql:table/dest_num.sql:22: NOTICE: table "dest_num" does not exist, skipping DROP TABLE create table dest_num ( dndest varchar(126), dnnumid bigint not null references num (numid) on update cascade on delete cascade, primary key (dndest, dnnumid) ); psql:table/dest_num.sql:32: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "dest_num_pkey" for table "dest_num" CREATE TABLE ==> Mk table/num.sqlgrant if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/num.sqlgrant; then touch table/num.ckgrant; else kill 27165; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * the normal user will only be able to edit the num data through our * restricted view, that make a lot of consistency validations */ grant all on num to cdr; GRANT grant usage on num_numid_seq to cdr; GRANT ==> Mk table/num.sqlidx if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/num.sqlidx; then touch table/num.ckidx; else kill 14050; fi /* * Copyright (c) 2011 Abel Abraham Camarillo Ojeda * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ drop index if exists num_nnum_gist_idx; psql:table/num.sqlidx:17: NOTICE: index "num_nnum_gist_idx" does not exist, skipping DROP INDEX create index num_nnum_gist_idx on num using gist(nnum); CREATE INDEX ==> Mk table/sap_avfdtcall.sqlgrant if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/sap_avfdtcall.sqlgrant; then touch table/sap_avfdtcall.ckgrant; else kill 19720; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ select revoke_all_on_obj('sap_avfdtcall'::text); revoke_all_on_obj ------------------- 0 (1 row) grant select on sap_avfdtcall to "ext.www.client"; GRANT ==> Mk table/sap_avfdtcall.sqlidx if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f table/sap_avfdtcall.sqlidx; then touch table/sap_avfdtcall.ckidx; else kill 17519; fi /* * Copyright (c) 2011 Anibal Ezau Limon Belmares * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ drop index if exists sap_avfdtcall_scallcos_idx; psql:table/sap_avfdtcall.sqlidx:17: NOTICE: index "sap_avfdtcall_scallcos_idx" does not exist, skipping DROP INDEX drop index if exists sap_avfdtcall_scallext_idx; psql:table/sap_avfdtcall.sqlidx:18: NOTICE: index "sap_avfdtcall_scallext_idx" does not exist, skipping DROP INDEX drop index if exists sap_avfdtcall_scallsrv_idx; psql:table/sap_avfdtcall.sqlidx:19: NOTICE: index "sap_avfdtcall_scallsrv_idx" does not exist, skipping DROP INDEX create index sap_avfdtcall_scallcos_idx on sap_avfdtcall (scallcos); CREATE INDEX create index sap_avfdtcall_scallext_idx on sap_avfdtcall (scallext); CREATE INDEX create index sap_avfdtcall_scallsrv_idx on sap_avfdtcall (scallsrv); CREATE INDEX ==> Mk func/temporal/period.sql if psql -1Xwe --set ON_ERROR_STOP= -d _n_srv -U _postgresql -f func/temporal/period.sql; then touch func/temporal/period.ck; else kill 31835; fi CREATE TYPE period; CREATE TYPE CREATE OR REPLACE FUNCTION period_in(cstring) RETURNS period LANGUAGE C IMMUTABLE STRICT AS 'period','period_in'; psql:func/temporal/period.sql:11: NOTICE: return type period is only a shell psql:func/temporal/period.sql:11: ERROR: could not access file "period": No such file or directory mk: sqlf=func/temporal/period.sql echo "==> ... : exit status=exit(143)