From 9ceae18200888c8334088a83d3df6abb2a46d451 Mon Sep 17 00:00:00 2001 From: Gilles Darold Date: Tue, 26 Dec 2023 13:08:20 +0100 Subject: [PATCH] Add missing SQL files for version 3.1.0 --- sql/pgtt--3.1.0.sql | 26 ++++++++++++++++++++++++++ updates/pgtt--3.0.0--3.1.0.sql | 9 +++++++++ 2 files changed, 35 insertions(+) create mode 100644 sql/pgtt--3.1.0.sql create mode 100644 updates/pgtt--3.0.0--3.1.0.sql diff --git a/sql/pgtt--3.1.0.sql b/sql/pgtt--3.1.0.sql new file mode 100644 index 0000000..aeb3b7e --- /dev/null +++ b/sql/pgtt--3.1.0.sql @@ -0,0 +1,26 @@ +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION pgtt" to load this file. \quit + +---- +-- Fix privileges on schema dedicated to the global temporary table +---- +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--3.0.0--3.1.0.sql b/updates/pgtt--3.0.0--3.1.0.sql new file mode 100644 index 0000000..0dd5b68 --- /dev/null +++ b/updates/pgtt--3.0.0--3.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'; +