Keep all old extension install scripts around

We need them to test upgrades.
This commit is contained in:
Peter Eisentraut 2015-10-02 23:53:32 -04:00
parent cd80642413
commit 817deaaa30
4 changed files with 203 additions and 8 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
*.o
*.so
/results/
/*--*.sql

View File

@ -1,13 +1,10 @@
PG_CONFIG = pg_config
PKG_CONFIG = pkg-config
extension_version = 1
EXTENSION = uri
MODULE_big = uri
OBJS = uri.o
DATA = uri--0--1.sql
DATA_built = uri--$(extension_version).sql
DATA = uri--0.sql uri--1.sql uri--0--1.sql
ifeq (no,$(shell $(PKG_CONFIG) liburiparser || echo no))
$(warning liburiparser not registed with pkg-config, build might fail)
@ -21,6 +18,3 @@ REGRESS_OPTS = --inputdir=test
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
uri--$(extension_version).sql: uri.sql
cat $^ >$@

202
uri--0.sql Normal file
View File

@ -0,0 +1,202 @@
SET client_min_messages = warning;
CREATE TYPE uri;
CREATE FUNCTION uri_in(cstring) RETURNS uri
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_out(uri) RETURNS cstring
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE TYPE uri (
INTERNALLENGTH = -1,
INPUT = uri_in,
OUTPUT = uri_out
);
CREATE CAST (uri AS text) WITH INOUT AS ASSIGNMENT;
CREATE CAST (text AS uri) WITH INOUT AS ASSIGNMENT;
CREATE FUNCTION uri_scheme(uri) RETURNS text
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_userinfo(uri) RETURNS text
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_host(uri) RETURNS text
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_host_inet(uri) RETURNS inet
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_port(uri) RETURNS integer
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_query(uri) RETURNS text
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_fragment(uri) RETURNS text
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_path(uri) RETURNS text
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_path_array(uri) RETURNS text[]
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_normalize(uri) RETURNS uri
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_lt(uri, uri) RETURNS boolean
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_le(uri, uri) RETURNS boolean
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_eq(uri, uri) RETURNS boolean
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_ne(uri, uri) RETURNS boolean
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_ge(uri, uri) RETURNS boolean
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_gt(uri, uri) RETURNS boolean
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE FUNCTION uri_cmp(uri, uri) RETURNS integer
IMMUTABLE
STRICT
LANGUAGE C
AS '$libdir/uri';
CREATE OPERATOR < (
LEFTARG = uri,
RIGHTARG = uri,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel,
PROCEDURE = uri_lt
);
CREATE OPERATOR <= (
LEFTARG = uri,
RIGHTARG = uri,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel,
PROCEDURE = uri_le
);
CREATE OPERATOR = (
LEFTARG = uri,
RIGHTARG = uri,
COMMUTATOR = =,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
HASHES,
MERGES,
PROCEDURE = uri_eq
);
CREATE OPERATOR <> (
LEFTARG = uri,
RIGHTARG = uri,
COMMUTATOR = <>,
NEGATOR = =,
RESTRICT = neqsel,
JOIN = neqjoinsel,
PROCEDURE = uri_ne
);
CREATE OPERATOR >= (
LEFTARG = uri,
RIGHTARG = uri,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel,
PROCEDURE = uri_ge
);
CREATE OPERATOR > (
LEFTARG = uri,
RIGHTARG = uri,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel,
PROCEDURE = uri_gt
);
CREATE OPERATOR CLASS uri_ops
DEFAULT FOR TYPE uri USING btree AS
OPERATOR 1 < ,
OPERATOR 2 <= ,
OPERATOR 3 = ,
OPERATOR 4 >= ,
OPERATOR 5 > ,
FUNCTION 1 uri_cmp(uri, uri);

View File