Skip to content

Commit 458857c

Browse files
committed
Throw a useful error message if an extension script file is fed to psql.
We have seen one too many reports of people trying to use 9.1 extension files in the old-fashioned way of sourcing them in psql. Not only does that usually not work (due to failure to substitute for MODULE_PATHNAME and/or @extschema@), but if it did work they'd get a collection of loose objects not an extension. To prevent this, insert an \echo ... \quit line that prints a suitable error message into each extension script file, and teach commands/extension.c to ignore lines starting with \echo. That should not only prevent any adverse consequences of loading a script file the wrong way, but make it crystal clear to users that they need to do it differently now. Tom Lane, following an idea of Andrew Dunstan's. Back-patch into 9.1 ... there is not going to be much value in this if we wait till 9.2.
1 parent e0d2735 commit 458857c

File tree

78 files changed

+274
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+274
-17
lines changed

contrib/adminpack/adminpack--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/adminpack/adminpack--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION adminpack" to load this file. \quit
5+
36
/* ***********************************************
47
* Administrative functions for PostgreSQL
58
* *********************************************** */

contrib/btree_gin/btree_gin--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/btree_gin/btree_gin--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION btree_gin" to load this file. \quit
5+
36
CREATE FUNCTION gin_btree_consistent(internal, int2, anyelement, int4, internal, internal)
47
RETURNS bool
58
AS 'MODULE_PATHNAME'

contrib/btree_gin/btree_gin--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/btree_gin/btree_gin--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION btree_gin" to load this file. \quit
5+
36
ALTER EXTENSION btree_gin ADD function gin_btree_consistent(internal,smallint,anyelement,integer,internal,internal);
47
ALTER EXTENSION btree_gin ADD function gin_extract_value_int2(smallint,internal);
58
ALTER EXTENSION btree_gin ADD function gin_compare_prefix_int2(smallint,smallint,smallint,internal);

contrib/btree_gist/btree_gist--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/btree_gist/btree_gist--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION btree_gist" to load this file. \quit
5+
36
CREATE FUNCTION gbtreekey4_in(cstring)
47
RETURNS gbtreekey4
58
AS 'MODULE_PATHNAME', 'gbtreekey_in'

contrib/btree_gist/btree_gist--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/btree_gist/btree_gist--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION btree_gist" to load this file. \quit
5+
36
ALTER EXTENSION btree_gist ADD type gbtreekey4;
47
ALTER EXTENSION btree_gist ADD function gbtreekey4_in(cstring);
58
ALTER EXTENSION btree_gist ADD function gbtreekey4_out(gbtreekey4);

contrib/chkpass/chkpass--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/chkpass/chkpass--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION chkpass" to load this file. \quit
5+
36
--
47
-- Input and output functions and the type itself:
58
--

contrib/chkpass/chkpass--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/chkpass/chkpass--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION chkpass" to load this file. \quit
5+
36
ALTER EXTENSION chkpass ADD type chkpass;
47
ALTER EXTENSION chkpass ADD function chkpass_in(cstring);
58
ALTER EXTENSION chkpass ADD function chkpass_out(chkpass);

contrib/citext/citext--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/citext/citext--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION citext" to load this file. \quit
5+
36
--
47
-- PostgreSQL code for CITEXT.
58
--

contrib/citext/citext--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/citext/citext--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION citext" to load this file. \quit
5+
36
ALTER EXTENSION citext ADD type citext;
47
ALTER EXTENSION citext ADD function citextin(cstring);
58
ALTER EXTENSION citext ADD function citextout(citext);

contrib/cube/cube--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/cube/cube--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION cube" to load this file. \quit
5+
36
-- Create the user-defined type for N-dimensional boxes
47

58
CREATE FUNCTION cube_in(cstring)

contrib/cube/cube--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/cube/cube--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION cube" to load this file. \quit
5+
36
ALTER EXTENSION cube ADD type cube;
47
ALTER EXTENSION cube ADD function cube_in(cstring);
58
ALTER EXTENSION cube ADD function cube(double precision[],double precision[]);

contrib/dblink/dblink--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/dblink/dblink--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION dblink" to load this file. \quit
5+
36
-- dblink_connect now restricts non-superusers to password
47
-- authenticated connections
58
CREATE FUNCTION dblink_connect (text)

contrib/dblink/dblink--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/dblink/dblink--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION dblink" to load this file. \quit
5+
36
ALTER EXTENSION dblink ADD function dblink_connect(text);
47
ALTER EXTENSION dblink ADD function dblink_connect(text,text);
58
ALTER EXTENSION dblink ADD function dblink_connect_u(text);

contrib/dict_int/dict_int--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/dict_int/dict_int--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION dict_int" to load this file. \quit
5+
36
CREATE FUNCTION dintdict_init(internal)
47
RETURNS internal
58
AS 'MODULE_PATHNAME'

contrib/dict_int/dict_int--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/dict_int/dict_int--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION dict_int" to load this file. \quit
5+
36
ALTER EXTENSION dict_int ADD function dintdict_init(internal);
47
ALTER EXTENSION dict_int ADD function dintdict_lexize(internal,internal,internal,internal);
58
ALTER EXTENSION dict_int ADD text search template intdict_template;

contrib/dict_xsyn/dict_xsyn--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/dict_xsyn/dict_xsyn--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION dict_xsyn" to load this file. \quit
5+
36
CREATE FUNCTION dxsyn_init(internal)
47
RETURNS internal
58
AS 'MODULE_PATHNAME'

contrib/dict_xsyn/dict_xsyn--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/dict_xsyn/dict_xsyn--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION dict_xsyn" to load this file. \quit
5+
36
ALTER EXTENSION dict_xsyn ADD function dxsyn_init(internal);
47
ALTER EXTENSION dict_xsyn ADD function dxsyn_lexize(internal,internal,internal,internal);
58
ALTER EXTENSION dict_xsyn ADD text search template xsyn_template;

contrib/earthdistance/earthdistance--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/earthdistance/earthdistance--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION earthdistance" to load this file. \quit
5+
36
-- earth() returns the radius of the earth in meters. This is the only
47
-- place you need to change things for the cube base distance functions
58
-- in order to use different units (or a better value for the Earth's radius).

contrib/earthdistance/earthdistance--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/earthdistance/earthdistance--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION earthdistance" to load this file. \quit
5+
36
ALTER EXTENSION earthdistance ADD function earth();
47
ALTER EXTENSION earthdistance ADD type earth;
58
ALTER EXTENSION earthdistance ADD function sec_to_gc(double precision);

contrib/file_fdw/file_fdw--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/file_fdw/file_fdw--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION file_fdw" to load this file. \quit
5+
36
CREATE FUNCTION file_fdw_handler()
47
RETURNS fdw_handler
58
AS 'MODULE_PATHNAME'

contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION fuzzystrmatch" to load this file. \quit
5+
36
CREATE FUNCTION levenshtein (text,text) RETURNS int
47
AS 'MODULE_PATHNAME','levenshtein'
58
LANGUAGE C IMMUTABLE STRICT;

contrib/fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION fuzzystrmatch" to load this file. \quit
5+
36
ALTER EXTENSION fuzzystrmatch ADD function levenshtein(text,text);
47
ALTER EXTENSION fuzzystrmatch ADD function levenshtein(text,text,integer,integer,integer);
58
ALTER EXTENSION fuzzystrmatch ADD function metaphone(text,integer);

contrib/hstore/hstore--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/hstore/hstore--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION hstore" to load this file. \quit
5+
36
CREATE TYPE hstore;
47

58
CREATE FUNCTION hstore_in(cstring)

contrib/hstore/hstore--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/hstore/hstore--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION hstore" to load this file. \quit
5+
36
ALTER EXTENSION hstore ADD type hstore;
47
ALTER EXTENSION hstore ADD function hstore_in(cstring);
58
ALTER EXTENSION hstore ADD function hstore_out(hstore);

contrib/intagg/intagg--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/intagg/intagg--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION intagg" to load this file. \quit
5+
36
-- Internal function for the aggregate
47
-- Is called for each item in an aggregation
58
CREATE FUNCTION int_agg_state (internal, int4)

contrib/intagg/intagg--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/intagg/intagg--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION intagg" to load this file. \quit
5+
36
ALTER EXTENSION intagg ADD function int_agg_state(internal,integer);
47
ALTER EXTENSION intagg ADD function int_agg_final_array(internal);
58
ALTER EXTENSION intagg ADD function int_array_aggregate(integer);

contrib/intarray/intarray--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/intarray/intarray--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION intarray" to load this file. \quit
5+
36
--
47
-- Create the user-defined type for the 1-D integer arrays (_int4)
58
--

contrib/intarray/intarray--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/intarray/intarray--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION intarray" to load this file. \quit
5+
36
ALTER EXTENSION intarray ADD type query_int;
47
ALTER EXTENSION intarray ADD function bqarr_in(cstring);
58
ALTER EXTENSION intarray ADD function bqarr_out(query_int);

contrib/isn/isn--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/isn/isn--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION isn" to load this file. \quit
5+
36
-- Example:
47
-- create table test ( id isbn );
58
-- insert into test values('978-0-393-04002-9');

contrib/isn/isn--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/isn/isn--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION isn" to load this file. \quit
5+
36
ALTER EXTENSION isn ADD type ean13;
47
ALTER EXTENSION isn ADD function ean13_in(cstring);
58
ALTER EXTENSION isn ADD function ean13_out(ean13);

contrib/lo/lo--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/lo/lo--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION lo" to load this file. \quit
5+
36
--
47
-- Create the data type ... now just a domain over OID
58
--

contrib/lo/lo--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/lo/lo--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION lo" to load this file. \quit
5+
36
ALTER EXTENSION lo ADD domain lo;
47
ALTER EXTENSION lo ADD function lo_oid(lo);
58
ALTER EXTENSION lo ADD function lo_manage();

contrib/ltree/ltree--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/ltree/ltree--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION ltree" to load this file. \quit
5+
36
CREATE FUNCTION ltree_in(cstring)
47
RETURNS ltree
58
AS 'MODULE_PATHNAME'

contrib/ltree/ltree--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/ltree/ltree--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION ltree" to load this file. \quit
5+
36
ALTER EXTENSION ltree ADD type ltree;
47
ALTER EXTENSION ltree ADD function ltree_in(cstring);
58
ALTER EXTENSION ltree ADD function ltree_out(ltree);

contrib/pageinspect/pageinspect--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/pageinspect/pageinspect--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION pageinspect" to load this file. \quit
5+
36
--
47
-- get_raw_page()
58
--

contrib/pageinspect/pageinspect--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/pageinspect/pageinspect--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION pageinspect" to load this file. \quit
5+
36
DROP FUNCTION heap_page_items(bytea);
47
CREATE FUNCTION heap_page_items(IN page bytea,
58
OUT lp smallint,

contrib/pg_buffercache/pg_buffercache--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/pg_buffercache/pg_buffercache--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION pg_buffercache" to load this file. \quit
5+
36
-- Register the function.
47
CREATE FUNCTION pg_buffercache_pages()
58
RETURNS SETOF RECORD
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
/* contrib/pg_buffercache/pg_buffercache--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION pg_buffercache" to load this file. \quit
5+
36
ALTER EXTENSION pg_buffercache ADD function pg_buffercache_pages();
47
ALTER EXTENSION pg_buffercache ADD view pg_buffercache;

contrib/pg_freespacemap/pg_freespacemap--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/pg_freespacemap/pg_freespacemap--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION pg_freespacemap" to load this file. \quit
5+
36
-- Register the C function.
47
CREATE FUNCTION pg_freespace(regclass, bigint)
58
RETURNS int2
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
/* contrib/pg_freespacemap/pg_freespacemap--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION pg_freespacemap" to load this file. \quit
5+
36
ALTER EXTENSION pg_freespacemap ADD function pg_freespace(regclass,bigint);
47
ALTER EXTENSION pg_freespacemap ADD function pg_freespace(regclass);

contrib/pg_stat_statements/pg_stat_statements--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/pg_stat_statements/pg_stat_statements--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION pg_stat_statements" to load this file. \quit
5+
36
-- Register functions.
47
CREATE FUNCTION pg_stat_statements_reset()
58
RETURNS void
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/pg_stat_statements/pg_stat_statements--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION pg_stat_statements" to load this file. \quit
5+
36
ALTER EXTENSION pg_stat_statements ADD function pg_stat_statements_reset();
47
ALTER EXTENSION pg_stat_statements ADD function pg_stat_statements();
58
ALTER EXTENSION pg_stat_statements ADD view pg_stat_statements;

contrib/pg_trgm/pg_trgm--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/pg_trgm/pg_trgm--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION pg_trgm" to load this file. \quit
5+
36
CREATE FUNCTION set_limit(float4)
47
RETURNS float4
58
AS 'MODULE_PATHNAME'

contrib/pg_trgm/pg_trgm--unpackaged--1.0.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* contrib/pg_trgm/pg_trgm--unpackaged--1.0.sql */
22

3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION pg_trgm" to load this file. \quit
5+
36
ALTER EXTENSION pg_trgm ADD function set_limit(real);
47
ALTER EXTENSION pg_trgm ADD function show_limit();
58
ALTER EXTENSION pg_trgm ADD function show_trgm(text);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy