File: pgtt--4.1.0.sql

package info (click to toggle)
pgtt 4.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 536 kB
  • sloc: ansic: 1,547; sql: 569; makefile: 27; sh: 1
file content (26 lines) | stat: -rw-r--r-- 794 bytes parent folder | download | duplicates (26)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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', '');