postgresql/contrib/dblink/dblink--unpackaged--1.0.sql
Tom Lane 458857cc9d 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.
2011-10-12 15:45:03 -04:00

47 lines
2.8 KiB
SQL

/* contrib/dblink/dblink--unpackaged--1.0.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION dblink" to load this file. \quit
ALTER EXTENSION dblink ADD function dblink_connect(text);
ALTER EXTENSION dblink ADD function dblink_connect(text,text);
ALTER EXTENSION dblink ADD function dblink_connect_u(text);
ALTER EXTENSION dblink ADD function dblink_connect_u(text,text);
ALTER EXTENSION dblink ADD function dblink_disconnect();
ALTER EXTENSION dblink ADD function dblink_disconnect(text);
ALTER EXTENSION dblink ADD function dblink_open(text,text);
ALTER EXTENSION dblink ADD function dblink_open(text,text,boolean);
ALTER EXTENSION dblink ADD function dblink_open(text,text,text);
ALTER EXTENSION dblink ADD function dblink_open(text,text,text,boolean);
ALTER EXTENSION dblink ADD function dblink_fetch(text,integer);
ALTER EXTENSION dblink ADD function dblink_fetch(text,integer,boolean);
ALTER EXTENSION dblink ADD function dblink_fetch(text,text,integer);
ALTER EXTENSION dblink ADD function dblink_fetch(text,text,integer,boolean);
ALTER EXTENSION dblink ADD function dblink_close(text);
ALTER EXTENSION dblink ADD function dblink_close(text,boolean);
ALTER EXTENSION dblink ADD function dblink_close(text,text);
ALTER EXTENSION dblink ADD function dblink_close(text,text,boolean);
ALTER EXTENSION dblink ADD function dblink(text,text);
ALTER EXTENSION dblink ADD function dblink(text,text,boolean);
ALTER EXTENSION dblink ADD function dblink(text);
ALTER EXTENSION dblink ADD function dblink(text,boolean);
ALTER EXTENSION dblink ADD function dblink_exec(text,text);
ALTER EXTENSION dblink ADD function dblink_exec(text,text,boolean);
ALTER EXTENSION dblink ADD function dblink_exec(text);
ALTER EXTENSION dblink ADD function dblink_exec(text,boolean);
ALTER EXTENSION dblink ADD type dblink_pkey_results;
ALTER EXTENSION dblink ADD function dblink_get_pkey(text);
ALTER EXTENSION dblink ADD function dblink_build_sql_insert(text,int2vector,integer,text[],text[]);
ALTER EXTENSION dblink ADD function dblink_build_sql_delete(text,int2vector,integer,text[]);
ALTER EXTENSION dblink ADD function dblink_build_sql_update(text,int2vector,integer,text[],text[]);
ALTER EXTENSION dblink ADD function dblink_current_query();
ALTER EXTENSION dblink ADD function dblink_send_query(text,text);
ALTER EXTENSION dblink ADD function dblink_is_busy(text);
ALTER EXTENSION dblink ADD function dblink_get_result(text);
ALTER EXTENSION dblink ADD function dblink_get_result(text,boolean);
ALTER EXTENSION dblink ADD function dblink_get_connections();
ALTER EXTENSION dblink ADD function dblink_cancel_query(text);
ALTER EXTENSION dblink ADD function dblink_error_message(text);
ALTER EXTENSION dblink ADD function dblink_get_notify();
ALTER EXTENSION dblink ADD function dblink_get_notify(text);