postgresql/doc/src/sgml
Tom Lane f833c847b8 Allow psql variable substitution to occur in backtick command strings.
Previously, text between backquotes in a psql metacommand's arguments
was always passed to the shell literally.  That considerably hobbles
the usefulness of the feature for scripting, so we'd foreseen for a long
time that we'd someday want to allow substitution of psql variables into
the shell command.  IMO the addition of \if metacommands has brought us to
that point, since \if can greatly benefit from some sort of client-side
expression evaluation capability, and psql itself is not going to grow any
such thing in time for v10.  Hence, this patch.  It allows :VARIABLE to be
replaced by the exact contents of the named variable, while :'VARIABLE'
is replaced by the variable's contents suitably quoted to become a single
shell-command argument.  (The quoting rules for that are different from
those for SQL literals, so this is a bit of an abuse of the :'VARIABLE'
notation, but I doubt anyone will be confused.)

As with other situations in psql, no substitution occurs if the word
following a colon is not a known variable name.  That limits the risk of
compatibility problems for existing psql scripts; but the risk isn't zero,
so this needs to be called out in the v10 release notes.

Discussion: https://postgr.es/m/9561.1490895211@sss.pgh.pa.us
2017-04-01 21:44:54 -04:00
..
ref Allow psql variable substitution to occur in backtick command strings. 2017-04-01 21:44:54 -04:00
.gitignore Improve gitignore file 2017-03-10 10:16:04 -05:00
acronyms.sgml Document LSN acronym in WAL Internals 2016-09-05 09:47:49 +01:00
adminpack.sgml Doc: write some for adminpack. 2016-08-10 21:39:50 -04:00
advanced.sgml
amcheck.sgml Add amcheck extension to contrib. 2017-03-09 16:33:02 -08:00
arch-dev.sgml
array.sgml
auth-delay.sgml
auto-explain.sgml
backup.sgml Expose waitforarchive option through pg_stop_backup() 2017-03-22 23:44:58 -04:00
bgworker.sgml Don't use bgw_main even to specify in-core bgworker entrypoints. 2017-03-31 20:43:32 -04:00
biblio.sgml doc: Clean up bibliography rendering for XSLT 2017-03-26 14:54:56 -04:00
bki.sgml
bloom.sgml docs: re-add spaces before units removed 2016-08-05 14:36:17 -04:00
brin.sgml BRIN de-summarization 2017-04-01 16:10:04 -03:00
btree-gin.sgml Document btree_gin support for enums 2017-03-21 11:11:42 -04:00
btree-gist.sgml Add btree_gist support for enum types. 2017-03-21 10:43:27 -04:00
catalogs.sgml Default monitoring roles 2017-03-30 14:18:53 -04:00
charset.sgml doc: add missing closing 'sect3' tag for ICU patch 2017-03-23 16:59:24 -04:00
chkpass.sgml
citext.sgml Support the new regexp_match() function for citext. 2016-08-18 10:52:31 -04:00
client-auth.sgml Allow SCRAM authentication, when pg_hba.conf says 'md5'. 2017-03-24 13:32:21 +02:00
config.sgml Change default of log_directory to 'log' 2017-03-27 10:34:33 -04:00
contacts.sgml
contrib-spi.sgml
contrib.sgml Add amcheck extension to contrib. 2017-03-09 16:33:02 -08:00
cube.sgml
custom-scan.sgml Allow custom and foreign scans to have shutdown callbacks. 2017-02-26 13:41:12 +05:30
datatype.sgml doc: adjust 'Infinity' example to include minus 2017-03-20 22:22:18 -04:00
datetime.sgml Don't require dynamic timezone abbreviations to match underlying time zone. 2016-09-02 17:30:02 -04:00
dblink.sgml Establish conventions about global object names used in regression tests. 2016-07-17 18:42:43 -04:00
ddl.sgml Improve documentation for table partitioning. 2017-03-31 17:33:34 -04:00
dfunc.sgml Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
dict-int.sgml
dict-xsyn.sgml
diskusage.sgml
dml.sgml Doc: add a section in Part II concerning RETURNING. 2016-11-22 14:02:52 -05:00
docguide.sgml doc: Update tool sets documentation for modern FreeBSD 2017-03-21 22:11:49 -04:00
earthdistance.sgml
ecpg.sgml doc: Fix a few typos and awkward links 2017-03-18 23:43:47 -04:00
errcodes.sgml
event-trigger.sgml
extend.sgml Delete deleteWhatDependsOn() in favor of more performDeletion() flag bits. 2016-12-02 14:57:55 -05:00
external-projects.sgml doc: Update URL for plr 2017-02-21 12:37:30 -05:00
fdwhandler.sgml Allow custom and foreign scans to have shutdown callbacks. 2017-02-26 13:41:12 +05:30
features.sgml
file-fdw.sgml Change default of log_directory to 'log' 2017-03-27 10:34:33 -04:00
filelist.sgml Add amcheck extension to contrib. 2017-03-09 16:33:02 -08:00
fixrtf
func.sgml BRIN de-summarization 2017-04-01 16:10:04 -03:00
fuzzystrmatch.sgml
generate-errcodes-table.pl Clean up Perl code according to perlcritic 2017-03-27 08:18:22 -04:00
generic-wal.sgml
geqo.sgml
gin.sgml Replace the built-in GIN array opclasses with a single polymorphic opclass. 2016-09-26 14:52:44 -04:00
gist.sgml
high-availability.sgml doc: Fix a few typos and awkward links 2017-03-18 23:43:47 -04:00
history.sgml
hstore.sgml
indexam.sgml Allow index AMs to return either HeapTuple or IndexTuple format during IOS. 2017-02-27 17:20:34 -05:00
indices.sgml hash: Add write-ahead logging support. 2017-03-14 13:27:02 -04:00
info.sgml
information_schema.sgml Add CREATE SEQUENCE AS <data type> clause 2017-02-10 15:34:35 -05:00
install-windows.sgml doc: Update URL for Microsoft download site 2017-01-17 10:05:01 -05:00
installation.sgml ICU support 2017-03-23 15:28:48 -04:00
intagg.sgml
intarray.sgml doc: remove GIN vs. GiST performance mention 2016-06-28 16:00:40 -04:00
intro.sgml
isn.sgml
jadetex.cfg
json.sgml
keywords.sgml Add keywords for partitioning 2017-02-10 09:07:18 +00:00
legal.sgml Update manual set of copyright files for 2017 2017-01-03 13:45:17 -05:00
libpq.sgml Document new libpq connection statuses for target_session_attrs. 2017-02-15 11:05:44 -05:00
lo.sgml
lobj.sgml Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
logical-replication.sgml Logical replication support for initial data copy 2017-03-23 08:55:37 -04:00
logicaldecoding.sgml Add option to control snapshot export to CREATE_REPLICATION_SLOT 2017-03-14 17:34:22 -04:00
ltree.sgml docs: properly capitalize and space kB, MB, GB, TB 2016-07-30 12:27:39 -04:00
maintenance.sgml Rename "pg_clog" directory to "pg_xact". 2017-03-17 09:48:38 -04:00
Makefile Create INSTALL file via XSLT 2017-03-08 08:41:23 -05:00
manage-ag.sgml
mk_feature_tables.pl Clean up Perl code according to perlcritic 2017-03-27 08:18:22 -04:00
monitoring.sgml Show more processes in pg_stat_activity. 2017-03-26 22:02:22 -04:00
mvcc.sgml ICU support 2017-03-23 15:28:48 -04:00
nls.sgml
notation.sgml
oid2name.sgml
pageinspect.sgml pageinspect: Add page_checksum function 2017-03-17 10:55:17 -04:00
parallel.sgml Document some new parallel query capabilities. 2017-03-09 13:06:18 -05:00
passwordcheck.sgml
perform.sgml Rename "pg_xlog" directory to "pg_wal". 2016-10-20 11:32:18 -04:00
pgbuffercache.sgml Default monitoring roles 2017-03-30 14:18:53 -04:00
pgcrypto.sgml Remove support for OpenSSL versions older than 0.9.8. 2016-08-29 20:16:02 +03:00
pgfreespacemap.sgml Default monitoring roles 2017-03-30 14:18:53 -04:00
pgprewarm.sgml
pgrowlocks.sgml Default monitoring roles 2017-03-30 14:18:53 -04:00
pgstandby.sgml Replace references to "xlog" with "wal" in docs. 2017-02-14 02:30:46 +09:00
pgstatstatements.sgml Fix broken markup. 2017-03-30 17:13:44 -04:00
pgstattuple.sgml Default monitoring roles 2017-03-30 14:18:53 -04:00
pgtrgm.sgml Docs: assorted minor cleanups. 2016-09-12 19:19:41 -04:00
pgvisibility.sgml Default monitoring roles 2017-03-30 14:18:53 -04:00
planstats.sgml Fix typo: pg_statistics -> pg_statistic 2017-01-25 14:38:33 -05:00
plhandler.sgml Make UNKNOWN into an actual pseudo-type. 2017-01-25 09:27:09 -05:00
plperl.sgml Remove createlang and droplang 2017-03-23 14:16:45 -04:00
plpgsql.sgml doc: Put callouts in SQL comments 2017-03-03 15:03:03 -05:00
plpython.sgml PL/Python: Add cursor and execute methods to plan object 2017-03-27 11:37:22 -04:00
pltcl.sgml Remove createlang and droplang 2017-03-23 14:16:45 -04:00
postgres-fdw.sgml postgres_fdw: Teach IMPORT FOREIGN SCHEMA about partitioning. 2017-03-31 15:06:34 -04:00
postgres.sgml Logical replication 2017-01-20 09:04:49 -05:00
problems.sgml
protocol.sgml Cleanup slots during drop database 2017-03-28 10:05:21 -04:00
queries.sgml Make UNKNOWN into an actual pseudo-type. 2017-01-25 09:27:09 -05:00
query.sgml doc: Put callouts in SQL comments 2017-03-03 15:03:03 -05:00
rangetypes.sgml
README.links
recovery-config.sgml Remove all references to "xlog" from SQL-callable functions in pg_proc. 2017-02-09 15:10:09 -05:00
reference.sgml Implement multivariate n-distinct coefficients 2017-03-24 14:06:10 -03:00
regress.sgml doc: Mention --enable-tap-tests in regression test chapter 2017-03-28 21:12:30 -04:00
release-7.4.sgml Fix typo: pg_statistics -> pg_statistic 2017-01-25 14:38:33 -05:00
release-8.0.sgml Refer to OS X as "macOS", except for the port name which is still "darwin". 2016-09-25 15:40:57 -04:00
release-8.1.sgml Refer to OS X as "macOS", except for the port name which is still "darwin". 2016-09-25 15:40:57 -04:00
release-8.2.sgml Refer to OS X as "macOS", except for the port name which is still "darwin". 2016-09-25 15:40:57 -04:00
release-8.3.sgml Refer to OS X as "macOS", except for the port name which is still "darwin". 2016-09-25 15:40:57 -04:00
release-8.4.sgml Spelling fixes 2017-03-14 12:58:39 -04:00
release-9.0.sgml Spelling fixes 2017-03-14 12:58:39 -04:00
release-9.1.sgml Remove createlang and droplang 2017-03-23 14:16:45 -04:00
release-9.2.sgml Spelling fixes 2017-03-14 12:58:39 -04:00
release-9.3.sgml Spelling fixes 2017-03-14 12:58:39 -04:00
release-9.4.sgml Spelling fixes 2017-03-14 12:58:39 -04:00
release-9.5.sgml Rename user-facing tools with "xlog" in the name to say "wal". 2017-02-09 16:23:46 -05:00
release-9.6.sgml Spelling fixes 2017-03-14 12:58:39 -04:00
release-old.sgml Spelling fixes 2017-03-14 12:58:39 -04:00
release.sgml
replication-origins.sgml
rowtypes.sgml Doc: improve documentation about composite-value usage. 2016-11-22 17:56:42 -05:00
rules.sgml
runtime.sgml Improve postmaster's logging of listen socket creation. 2017-03-10 16:32:25 -05:00
seg.sgml
sepgsql.sgml doc: Fix typos 2016-07-14 22:28:58 -04:00
sourcerepo.sgml
sources.sgml Fix typo in sources.sgml. 2016-10-31 07:33:00 +09:00
spgist.sgml Make another editorial pass over the 9.6 release notes. 2016-08-28 17:40:06 -04:00
spi.sgml Add infrastructure to support EphemeralNamedRelation references. 2017-03-31 23:17:18 -05:00
sql.sgml
sslinfo.sgml
standalone-install.sgml
start.sgml
storage.sgml Rename "pg_clog" directory to "pg_xact". 2017-03-17 09:48:38 -04:00
stylesheet-common.xsl doc: Tweak reference page header style 2017-03-18 14:17:28 -04:00
stylesheet-fo.xsl doc: Improve rendering of notes/cautions using XSL-FO 2017-03-27 13:33:36 -04:00
stylesheet-hh.xsl
stylesheet-man.xsl doc: Supply XSLT template for superscript element in man pages 2016-07-17 17:01:07 -04:00
stylesheet-speedup-common.xsl doc: Further speed improvements for HTML XSLT build 2016-12-22 15:41:44 -05:00
stylesheet-speedup-xhtml.xsl doc: Further speed improvements for HTML XSLT build 2016-12-22 15:41:44 -05:00
stylesheet-text.xsl Create INSTALL file via XSLT 2017-03-08 08:41:23 -05:00
stylesheet.css Build HTML documentation using XSLT stylesheets by default 2016-11-15 23:00:38 -08:00
stylesheet.dsl Create INSTALL file via XSLT 2017-03-08 08:41:23 -05:00
stylesheet.xsl doc: Clean up bibliography rendering for XSLT 2017-03-26 14:54:56 -04:00
syntax.sgml Doc: remove duplicate index entry. 2017-02-16 11:30:07 -05:00
tablefunc.sgml
tablesample-method.sgml
tcn.sgml
test-decoding.sgml
textsearch.sgml Remove contrib/tsearch2. 2017-02-13 11:06:11 -05:00
trigger.sgml doc: Add missing include in example code 2017-02-02 16:50:28 -05:00
tsm-system-rows.sgml
tsm-system-time.sgml
typeconv.sgml Change unknown-type literals to type text in SELECT and RETURNING lists. 2017-01-25 09:17:24 -05:00
unaccent.sgml
user-manag.sgml Default monitoring roles 2017-03-30 14:18:53 -04:00
uuid-ossp.sgml Refer to OS X as "macOS", except for the port name which is still "darwin". 2016-09-25 15:40:57 -04:00
vacuumlo.sgml
wal.sgml Rename "pg_clog" directory to "pg_xact". 2017-03-17 09:48:38 -04:00
xaggr.sgml Improve speed of aggregates that use array_append as transition function. 2016-10-30 12:27:41 -04:00
xfunc.sgml Try to fix xml docs build broken in 5ded4bd. 2017-03-30 09:42:07 -07:00
xindex.sgml Replace the built-in GIN array opclasses with a single polymorphic opclass. 2016-09-26 14:52:44 -04:00
xml2.sgml Delete contrib/xml2's legacy implementation of xml_is_well_formed(). 2016-11-04 18:29:53 -04:00
xoper.sgml
xplang.sgml Remove createlang and droplang 2017-03-23 14:16:45 -04:00
xtypes.sgml

<!-- doc/src/sgml/README.links -->

Linking within SGML documents can be confusing, so here is a summary:


Intra-document Linking
----------------------

<xref>
	use to get chapter/section number from the title of the target
	link, or xreflabel if defined at the target, or refentrytitle if target
        is a refentry;  has no close tag
	http://www.oasis-open.org/docbook/documentation/reference/html/xref.html

<link>
	use to supply text for the link, requires </link>
	http://www.oasis-open.org/docbook/documentation/reference/html/link.html

linkend=
	controls the target of the link/xref, required

endterm=
	for <xref>, allows the text of the link/xref to be taken from a
	different link target title


External Linking
----------------

<ulink>
	like <link>, but uses a URL (not a document target);  requires
	</ulink>; if no text is specified, the URL appears as the link
	text
	http://www.oasis-open.org/docbook/documentation/reference/html/ulink.html

url=
	used by <ulink> to specify the URL, required


Guidelines
----------

o  If you want to supply text, use <link>, else <xref>
o  Do not use text with <ulink> so the URL appears in printed output
o  Specific nouns like GUC variables, SQL commands, and contrib modules
   usually have xreflabels