From 6c1c7f2f442090399658b769020eb3655dbe9e7b Mon Sep 17 00:00:00 2001 From: Gilles Darold Date: Thu, 1 Apr 2021 23:45:06 +0200 Subject: [PATCH] Update version to 1.3 and add upgrade/downgrade files --- META.json | 8 ++++---- pgtt.control | 2 +- sql/pgtt--2.0.0.sql | 0 sql/pgtt--2.1.0.sql | 28 +++++++++++++++++++++++++++- sql/pgtt--2.2.0.sql | 28 +++++++++++++++++++++++++++- sql/pgtt--2.3.0.sql | 27 +++++++++++++++++++++++++++ updates/pgtt--2.0.0--2.1.0.sql | 9 +++++++++ updates/pgtt--2.1.0--2.0.0.sql | 9 +++++++++ updates/pgtt--2.1.0--2.2.0.sql | 9 +++++++++ updates/pgtt--2.2.0--2.1.0.sql | 9 +++++++++ updates/pgtt--2.2.0--2.3.0.sql | 9 +++++++++ updates/pgtt--2.3.0--2.2.0.sql | 9 +++++++++ 12 files changed, 140 insertions(+), 7 deletions(-) mode change 100755 => 100644 sql/pgtt--2.0.0.sql mode change 120000 => 100644 sql/pgtt--2.1.0.sql mode change 120000 => 100644 sql/pgtt--2.2.0.sql create mode 100644 sql/pgtt--2.3.0.sql create mode 100644 updates/pgtt--2.0.0--2.1.0.sql create mode 100644 updates/pgtt--2.1.0--2.0.0.sql create mode 100644 updates/pgtt--2.1.0--2.2.0.sql create mode 100644 updates/pgtt--2.2.0--2.1.0.sql create mode 100644 updates/pgtt--2.2.0--2.3.0.sql create mode 100644 updates/pgtt--2.3.0--2.2.0.sql diff --git a/META.json b/META.json index 79d95fa..ccaf8d1 100755 --- a/META.json +++ b/META.json @@ -2,7 +2,7 @@ "name": "pgtt", "abstract": "Extension to add Global Temporary Tables feature to PostgreSQL", "description": "pgtt is a PostgreSQL extension to add Oracle-style Global Temporary Tables feature. It is based on unlogged table, partitioning and views.", - "version": "2.2.0", + "version": "2.3.0", "maintainer": "Gilles Darold ", "license": { "PostgreSQL": "http://www.postgresql.org/about/licence" @@ -17,14 +17,14 @@ }, "provides": { "pgtt": { - "file": "sql/pgtt--2.2.0.sql", + "file": "sql/pgtt--2.3.0.sql", "docfile": "doc/pgtt.md", - "version": "2.2.0", + "version": "2.3.0", "abstract": "Extension to manage Global Temporary Tables" } }, "meta-spec": { - "version": "2.2.0", + "version": "2.3.0", "url": "http://pgxn.org/meta/spec.txt" }, "tags": [ diff --git a/pgtt.control b/pgtt.control index 445c32e..b2d2dfd 100755 --- a/pgtt.control +++ b/pgtt.control @@ -1,4 +1,4 @@ -default_version = '2.2.0' +default_version = '2.3.0' comment = 'Extension to add Global Temporary Tables feature to PostgreSQL' module_pathname = '$libdir/pgtt' schema = 'pgtt_schema' diff --git a/sql/pgtt--2.0.0.sql b/sql/pgtt--2.0.0.sql old mode 100755 new mode 100644 diff --git a/sql/pgtt--2.1.0.sql b/sql/pgtt--2.1.0.sql deleted file mode 120000 index 3441ac9..0000000 --- a/sql/pgtt--2.1.0.sql +++ /dev/null @@ -1 +0,0 @@ -pgtt--2.0.0.sql \ No newline at end of file diff --git a/sql/pgtt--2.1.0.sql b/sql/pgtt--2.1.0.sql new file mode 100644 index 0000000..6a2bd0b --- /dev/null +++ b/sql/pgtt--2.1.0.sql @@ -0,0 +1,27 @@ +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION pgtt" to load this file. \quit + +---- +-- Create schema dedicated to the global temporary table +---- +CREATE SCHEMA IF NOT EXISTS @extschema@; +REVOKE ALL ON SCHEMA @extschema@ FROM PUBLIC; +GRANT USAGE ON SCHEMA @extschema@ TO PUBLIC; + +---- +-- Table used to store information about Global Temporary Tables. +-- Content will be loaded in memory by the pgtt extension. +---- +CREATE TABLE @extschema@.pg_global_temp_tables ( + relid integer NOT NULL, + nspname name NOT NULL, + relname name NOT NULL, + preserved boolean, + code text, + UNIQUE (nspname, relname) +); +GRANT ALL ON TABLE @extschema@.pg_global_temp_tables TO PUBLIC; + +-- Include tables into pg_dump +SELECT pg_catalog.pg_extension_config_dump('pg_global_temp_tables', ''); + diff --git a/sql/pgtt--2.2.0.sql b/sql/pgtt--2.2.0.sql deleted file mode 120000 index 3441ac9..0000000 --- a/sql/pgtt--2.2.0.sql +++ /dev/null @@ -1 +0,0 @@ -pgtt--2.0.0.sql \ No newline at end of file diff --git a/sql/pgtt--2.2.0.sql b/sql/pgtt--2.2.0.sql new file mode 100644 index 0000000..6a2bd0b --- /dev/null +++ b/sql/pgtt--2.2.0.sql @@ -0,0 +1,27 @@ +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION pgtt" to load this file. \quit + +---- +-- Create schema dedicated to the global temporary table +---- +CREATE SCHEMA IF NOT EXISTS @extschema@; +REVOKE ALL ON SCHEMA @extschema@ FROM PUBLIC; +GRANT USAGE ON SCHEMA @extschema@ TO PUBLIC; + +---- +-- Table used to store information about Global Temporary Tables. +-- Content will be loaded in memory by the pgtt extension. +---- +CREATE TABLE @extschema@.pg_global_temp_tables ( + relid integer NOT NULL, + nspname name NOT NULL, + relname name NOT NULL, + preserved boolean, + code text, + UNIQUE (nspname, relname) +); +GRANT ALL ON TABLE @extschema@.pg_global_temp_tables TO PUBLIC; + +-- Include tables into pg_dump +SELECT pg_catalog.pg_extension_config_dump('pg_global_temp_tables', ''); + diff --git a/sql/pgtt--2.3.0.sql b/sql/pgtt--2.3.0.sql new file mode 100644 index 0000000..6a2bd0b --- /dev/null +++ b/sql/pgtt--2.3.0.sql @@ -0,0 +1,27 @@ +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION pgtt" to load this file. \quit + +---- +-- Create schema dedicated to the global temporary table +---- +CREATE SCHEMA IF NOT EXISTS @extschema@; +REVOKE ALL ON SCHEMA @extschema@ FROM PUBLIC; +GRANT USAGE ON SCHEMA @extschema@ TO PUBLIC; + +---- +-- Table used to store information about Global Temporary Tables. +-- Content will be loaded in memory by the pgtt extension. +---- +CREATE TABLE @extschema@.pg_global_temp_tables ( + relid integer NOT NULL, + nspname name NOT NULL, + relname name NOT NULL, + preserved boolean, + code text, + UNIQUE (nspname, relname) +); +GRANT ALL ON TABLE @extschema@.pg_global_temp_tables TO PUBLIC; + +-- Include tables into pg_dump +SELECT pg_catalog.pg_extension_config_dump('pg_global_temp_tables', ''); + diff --git a/updates/pgtt--2.0.0--2.1.0.sql b/updates/pgtt--2.0.0--2.1.0.sql new file mode 100644 index 0000000..0dd5b68 --- /dev/null +++ b/updates/pgtt--2.0.0--2.1.0.sql @@ -0,0 +1,9 @@ +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION pgtt" to load this file. \quit + +-- check the functions bodies as creation time, enabled by default +SET LOCAL check_function_bodies = on ; + +-- make sure of client encoding +SET LOCAL client_encoding = 'UTF8'; + diff --git a/updates/pgtt--2.1.0--2.0.0.sql b/updates/pgtt--2.1.0--2.0.0.sql new file mode 100644 index 0000000..0dd5b68 --- /dev/null +++ b/updates/pgtt--2.1.0--2.0.0.sql @@ -0,0 +1,9 @@ +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION pgtt" to load this file. \quit + +-- check the functions bodies as creation time, enabled by default +SET LOCAL check_function_bodies = on ; + +-- make sure of client encoding +SET LOCAL client_encoding = 'UTF8'; + diff --git a/updates/pgtt--2.1.0--2.2.0.sql b/updates/pgtt--2.1.0--2.2.0.sql new file mode 100644 index 0000000..0dd5b68 --- /dev/null +++ b/updates/pgtt--2.1.0--2.2.0.sql @@ -0,0 +1,9 @@ +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION pgtt" to load this file. \quit + +-- check the functions bodies as creation time, enabled by default +SET LOCAL check_function_bodies = on ; + +-- make sure of client encoding +SET LOCAL client_encoding = 'UTF8'; + diff --git a/updates/pgtt--2.2.0--2.1.0.sql b/updates/pgtt--2.2.0--2.1.0.sql new file mode 100644 index 0000000..0dd5b68 --- /dev/null +++ b/updates/pgtt--2.2.0--2.1.0.sql @@ -0,0 +1,9 @@ +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION pgtt" to load this file. \quit + +-- check the functions bodies as creation time, enabled by default +SET LOCAL check_function_bodies = on ; + +-- make sure of client encoding +SET LOCAL client_encoding = 'UTF8'; + diff --git a/updates/pgtt--2.2.0--2.3.0.sql b/updates/pgtt--2.2.0--2.3.0.sql new file mode 100644 index 0000000..0dd5b68 --- /dev/null +++ b/updates/pgtt--2.2.0--2.3.0.sql @@ -0,0 +1,9 @@ +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION pgtt" to load this file. \quit + +-- check the functions bodies as creation time, enabled by default +SET LOCAL check_function_bodies = on ; + +-- make sure of client encoding +SET LOCAL client_encoding = 'UTF8'; + diff --git a/updates/pgtt--2.3.0--2.2.0.sql b/updates/pgtt--2.3.0--2.2.0.sql new file mode 100644 index 0000000..0dd5b68 --- /dev/null +++ b/updates/pgtt--2.3.0--2.2.0.sql @@ -0,0 +1,9 @@ +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION pgtt" to load this file. \quit + +-- check the functions bodies as creation time, enabled by default +SET LOCAL check_function_bodies = on ; + +-- make sure of client encoding +SET LOCAL client_encoding = 'UTF8'; +