From 10f6716566fce9d9c38f3dd99419595b2a1cba4c Mon Sep 17 00:00:00 2001
From: Mate Bartus <mate.bartus@gmail.com>
Date: Tue, 30 Jun 2015 16:36:34 +0200
Subject: [ticket/13740] Restore original install folder

This reverts commit 934e2821f1cef5e2e21ad6d96f7beb45647ed81c.

PHPBB3-13740
---
 phpBB/install/schemas/postgres_schema.sql | 80 +++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 phpBB/install/schemas/postgres_schema.sql

(limited to 'phpBB/install/schemas/postgres_schema.sql')

diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
new file mode 100644
index 0000000000..65caba8d1c
--- /dev/null
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -0,0 +1,80 @@
+
+BEGIN;
+
+/*
+	Domain definition
+*/
+CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying;
+
+/*
+	Operation Functions
+*/
+CREATE FUNCTION _varchar_ci_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) = LOWER($2)' LANGUAGE SQL STRICT;
+CREATE FUNCTION _varchar_ci_not_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) != LOWER($2)' LANGUAGE SQL STRICT;
+CREATE FUNCTION _varchar_ci_less_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) < LOWER($2)' LANGUAGE SQL STRICT;
+CREATE FUNCTION _varchar_ci_less_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) <= LOWER($2)' LANGUAGE SQL STRICT;
+CREATE FUNCTION _varchar_ci_greater_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) > LOWER($2)' LANGUAGE SQL STRICT;
+CREATE FUNCTION _varchar_ci_greater_equals(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) >= LOWER($2)' LANGUAGE SQL STRICT;
+
+/*
+	Operators
+*/
+CREATE OPERATOR <(
+  PROCEDURE = _varchar_ci_less_than,
+  LEFTARG = varchar_ci,
+  RIGHTARG = varchar_ci,
+  COMMUTATOR = >,
+  NEGATOR = >=,
+  RESTRICT = scalarltsel,
+  JOIN = scalarltjoinsel);
+
+CREATE OPERATOR <=(
+  PROCEDURE = _varchar_ci_less_equal,
+  LEFTARG = varchar_ci,
+  RIGHTARG = varchar_ci,
+  COMMUTATOR = >=,
+  NEGATOR = >,
+  RESTRICT = scalarltsel,
+  JOIN = scalarltjoinsel);
+
+CREATE OPERATOR >(
+  PROCEDURE = _varchar_ci_greater_than,
+  LEFTARG = varchar_ci,
+  RIGHTARG = varchar_ci,
+  COMMUTATOR = <,
+  NEGATOR = <=,
+  RESTRICT = scalargtsel,
+  JOIN = scalargtjoinsel);
+
+CREATE OPERATOR >=(
+  PROCEDURE = _varchar_ci_greater_equals,
+  LEFTARG = varchar_ci,
+  RIGHTARG = varchar_ci,
+  COMMUTATOR = <=,
+  NEGATOR = <,
+  RESTRICT = scalargtsel,
+  JOIN = scalargtjoinsel);
+
+CREATE OPERATOR <>(
+  PROCEDURE = _varchar_ci_not_equal,
+  LEFTARG = varchar_ci,
+  RIGHTARG = varchar_ci,
+  COMMUTATOR = <>,
+  NEGATOR = =,
+  RESTRICT = neqsel,
+  JOIN = neqjoinsel);
+
+CREATE OPERATOR =(
+  PROCEDURE = _varchar_ci_equal,
+  LEFTARG = varchar_ci,
+  RIGHTARG = varchar_ci,
+  COMMUTATOR = =,
+  NEGATOR = <>,
+  RESTRICT = eqsel,
+  JOIN = eqjoinsel,
+  HASHES,
+  MERGES,
+  SORT1= <);
+
+COMMIT;
+
-- 
cgit v1.2.1

