postgresql/doc/src/sgml
Alvaro Herrera a44e54cf4b psql: fix \connect with URIs and conninfo strings
psql was already accepting conninfo strings as the first parameter in
\connect, but the way it worked wasn't sane; some of the other
parameters would get the previous connection's values, causing it to
connect to a completely unexpected server or, more likely, not finding
any server at all because of completely wrong combinations of
parameters.

Fix by explicitely checking for a conninfo-looking parameter in the
dbname position; if one is found, use its complete specification rather
than mix with the other arguments.  Also, change tab-completion to not
try to complete conninfo/URI-looking "dbnames" and document that
conninfos are accepted as first argument.

There was a weak consensus to backpatch this, because while the behavior
of using the dbname as a conninfo is nowhere documented for \connect, it
is reasonable to expect that it works because it does work in many other
contexts.  Therefore this is backpatched all the way back to 9.0.

To implement this, routines previously private to libpq have been
duplicated so that psql can decide what looks like a conninfo/URI
string.  In back branches, just duplicate the same code all the way back
to 9.2, where URIs where introduced; 9.0 and 9.1 have a simpler version.
In master, the routines are moved to src/common and renamed.

Author: David Fetter, Andrew Dunstan.  Some editorialization by me
(probably earning a Gierth's "Sloppy" badge in the process.)
Reviewers: Andrew Gierth, Erik Rijkers, Pavel Stěhule, Stephen Frost,
Robert Haas, Andrew Dunstan.
2015-04-01 20:00:07 -03:00
..
ref psql: fix \connect with URIs and conninfo strings 2015-04-01 20:00:07 -03:00
.gitignore Don't generate plain-text HISTORY and src/test/regress/README anymore. 2014-02-10 20:48:04 -05:00
acronyms.sgml Add SP-GiST (space-partitioned GiST) index access method. 2011-12-17 16:42:30 -05:00
adminpack.sgml Add xreflabels to /contrib manuals so links appear correct. Also update 2011-05-07 22:29:20 -04:00
advanced.sgml doc: split long query into multiple lines 2013-12-04 10:03:13 -05:00
arch-dev.sgml doc: Fix claim that query is passed as ASCII text 2013-05-30 21:09:27 -04:00
array.sgml Add a cardinality function for arrays. 2014-01-21 12:38:53 -05:00
auth-delay.sgml doc: Fix DocBook XML validity 2014-05-06 21:28:58 -04:00
auto-explain.sgml Fix failure of contrib/auto_explain to print per-node timing information. 2014-09-19 13:18:59 -04:00
backup.sgml upgrade docs: highlight pg_upgrade, warn about globals preservation 2014-08-25 15:35:35 -04:00
bgworker.sgml Fix typo in docs. 2014-10-14 09:48:45 +03:00
biblio.sgml Properly capitalize hyphenated words in documentation titles. 2011-02-01 17:00:26 -05:00
bki.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
btree-gin.sgml Add xreflabels to /contrib manuals so links appear correct. Also update 2011-05-07 22:29:20 -04:00
btree-gist.sgml Spell checking and markup refinement 2011-05-19 01:14:45 +03:00
catalogs.sgml doc: Spell checking 2014-07-16 22:20:15 -04:00
charset.sgml doc: Remove i18ngurus.com link 2013-07-02 20:32:09 -04:00
chkpass.sgml Add xreflabels to /contrib manuals so links appear correct. Also update 2011-05-07 22:29:20 -04:00
citext.sgml Make citext's equality and hashing functions collation-insensitive. 2011-06-08 15:25:02 -04:00
client-auth.sgml Remove code to match IPv4 pg_hba.conf entries to IPv4-in-IPv6 addresses. 2015-02-17 12:49:18 -05:00
config.sgml Improve documentation around parameter-setting and ALTER SYSTEM. 2014-12-14 18:09:55 -05:00
contacts.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
contrib-spi.sgml Add xreflabels to /contrib manuals so links appear correct. Also update 2011-05-07 22:29:20 -04:00
contrib.sgml Introduce logical decoding. 2014-03-03 16:32:18 -05:00
cube.sgml Add xreflabels to /contrib manuals so links appear correct. Also update 2011-05-07 22:29:20 -04:00
datatype.sgml Update 9.4 release notes. 2014-12-14 14:58:06 -05:00
datetime.sgml Support timezone abbreviations that sometimes change. 2014-10-16 15:22:13 -04:00
dblink.sgml doc: Improve DocBook XML validity 2014-02-23 21:31:08 -05:00
ddl.sgml Document use of partial indexes for partial unique constraints 2014-09-03 14:34:46 -04:00
dfunc.sgml doc: Reflect renaming of Mac OS X to OS X 2014-09-09 13:58:50 -04:00
dict-int.sgml Add xreflabels to /contrib manuals so links appear correct. Also update 2011-05-07 22:29:20 -04:00
dict-xsyn.sgml Add xreflabels to /contrib manuals so links appear correct. Also update 2011-05-07 22:29:20 -04:00
diskusage.sgml Get rid of pg_class.reltoastidxid. 2013-07-04 03:24:09 +09:00
dml.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
docguide.sgml doc: Reflect renaming of Mac OS X to OS X 2014-09-09 13:58:50 -04:00
dummy-seclabel.sgml Fix typo in dummy_seclabel documentation. 2011-10-13 12:16:07 -04:00
earthdistance.sgml Add contrib function references in the doc index 2013-07-04 11:33:11 -04:00
ecpg.sgml Fixed array handling in ecpg. 2015-02-11 10:57:02 +01:00
errcodes.sgml Provide database object names as separate fields in error messages. 2013-01-29 17:08:26 -05:00
event-trigger.sgml Fix whitespace issues found by git diff --check, add gitattributes 2013-11-10 14:48:29 -05:00
extend.sgml Fix pg_dump handling of extension config tables 2015-03-02 14:12:28 -05:00
external-projects.sgml doc: Correct psycopg URL 2013-10-02 21:33:26 -04:00
fdwhandler.sgml doc: Spell checking 2014-07-16 22:20:15 -04:00
features.sgml Update SQL features/conformance information to SQL:2011 2012-05-17 09:50:04 +03:00
file-fdw.sgml Provide a FORCE NULL option to COPY in CSV mode. 2014-03-04 17:31:59 -05:00
filelist.sgml Initial version of Postgres 9.4 release notes 2014-05-03 23:16:24 -04:00
fixrtf Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
func.sgml doc: Fix typos in make_timestamp{,tz} examples 2015-01-19 12:43:58 -03:00
fuzzystrmatch.sgml Add contrib function references in the doc index 2013-07-04 11:33:11 -04:00
generate-errcodes-table.pl Update copyright for 2014 2014-01-07 16:05:30 -05:00
geqo.sgml doc: Improve setup for documentation building with FOP 2013-10-21 06:43:08 -04:00
gin.sgml Fix the return type of GIN triConsistent support functions to "char". 2014-09-16 09:23:55 +03:00
gist.sgml Add an in-core GiST index opclass for inet/cidr types. 2014-04-08 15:46:43 -04:00
high-availability.sgml doc: Spell checking 2014-07-16 22:20:15 -04:00
history.sgml Add small doc mention that libpq is named after POSTQUEL. 2012-09-02 08:42:03 -04:00
hstore.sgml doc: fix hstore_to_json_loose() doc wording 2013-10-02 19:25:30 -04:00
indexam.sgml doc: Spell checking 2014-07-16 22:20:15 -04:00
indices.sgml Add an in-core GiST index opclass for inet/cidr types. 2014-04-08 15:46:43 -04:00
info.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
information_schema.sgml Implement information_schema.parameters.parameter_default column 2013-11-26 23:21:35 -05:00
install-windows.sgml Add missing documentation for some vcregress modes 2014-12-17 11:15:32 +01:00
installation.sgml Fix duplicated platforms due to copy/paste error 2014-11-16 15:47:10 +01:00
intagg.sgml Add contrib function references in the doc index 2013-07-04 11:33:11 -04:00
intarray.sgml Add contrib function references in the doc index 2013-07-04 11:33:11 -04:00
intro.sgml Support automatically-updatable views. 2012-12-08 18:26:21 -05:00
isn.sgml Update URL reference material in /contrib/isn docs 2014-09-03 17:22:20 -04:00
jadetex.cfg Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
json.sgml Fix jsonb Unicode escape processing, and in consequence disallow \u0000. 2015-01-30 14:44:49 -05:00
keywords.sgml Update key words table for 9.4 2014-07-08 14:54:32 -04:00
legal.sgml Update copyright for 2015 2015-01-06 11:43:46 -05:00
libpq.sgml Fix documentation for libpq's PQfn(). 2015-03-08 13:35:37 -04:00
lo.sgml Add more limited large object trigger example. 2012-08-14 23:25:20 -04:00
lobj.sgml Rename lo_create(oid, bytea) to lo_from_bytea(). 2014-06-12 15:39:16 -04:00
logicaldecoding.sgml Fix typo in logicaldecoding.sgml. 2015-02-12 01:25:36 +01:00
ltree.sgml Add contrib function references in the doc index 2013-07-04 11:33:11 -04:00
maintenance.sgml Don't balance vacuum cost delay when per-table settings are in effect 2014-10-03 13:01:27 -03:00
Makefile Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
manage-ag.sgml docs: tablespaces cannot be accessed independently 2014-04-19 10:52:49 -04:00
mk_feature_tables.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:49 -04:00
monitoring.sgml doc: Reflect renaming of Mac OS X to OS X 2014-09-09 13:58:50 -04:00
mvcc.sgml Tweak row-level locking documentation 2014-11-13 14:45:58 -03:00
nls.sgml Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
notation.sgml doc: Remove paragraph about typesetting conventions 2013-05-31 22:45:03 -04:00
oid2name.sgml doc: Improve DocBook XML validity 2014-02-23 21:31:08 -05:00
pageinspect.sgml Fix documentation oversights about pageinspect and initialization fork. 2014-08-11 22:52:48 +09:00
passwordcheck.sgml Remove support for native krb5 authentication 2014-01-19 17:05:01 +01:00
perform.sgml Print planning time only in EXPLAIN ANALYZE, not plain EXPLAIN. 2014-10-15 18:50:16 -04:00
pg_xlogdump.sgml Add -f/--follow option to pg_xlogdump. 2014-03-26 13:48:20 +02:00
pgarchivecleanup.sgml doc: Improve DocBook XML validity 2014-02-23 21:31:08 -05:00
pgbench.sgml Change the way latency is calculated with pgbench --rate option. 2014-09-11 12:57:21 +03:00
pgbuffercache.sgml pg_buffercache docs: adjust order of fields 2013-11-27 22:33:59 -05:00
pgcrypto.sgml Docs: fix incorrect spelling of contrib/pgcrypto option. 2014-11-03 11:11:43 -05:00
pgfreespacemap.sgml doc: Fix DocBook XML validity 2014-05-06 21:28:58 -04:00
pgprewarm.sgml Fix whitespace 2014-07-08 23:29:09 -04:00
pgrowlocks.sgml docs: remove unnecessary references to old PG versions 2014-02-24 12:56:37 -05:00
pgstandby.sgml doc: Improve DocBook XML validity 2014-02-23 21:31:08 -05:00
pgstatstatements.sgml doc: Spell checking 2014-07-16 22:20:15 -04:00
pgstattuple.sgml doc: Fix DocBook XML validity 2014-05-06 21:28:58 -04:00
pgtestfsync.sgml doc: Improve DocBook XML validity 2014-02-23 21:31:08 -05:00
pgtesttiming.sgml doc: Improve DocBook XML validity 2014-02-23 21:31:08 -05:00
pgtrgm.sgml Add contrib function references in the doc index 2013-07-04 11:33:11 -04:00
pgupgrade.sgml Limit pg_upgrade authentication advice to always-secure techniques. 2014-07-18 16:05:26 -04:00
planstats.sgml Documentation spell checking and markup improvements 2013-05-20 21:13:13 -04:00
plhandler.sgml Document security implications of check_function_bodies. 2014-02-17 09:33:31 -05:00
plperl.sgml doc: Fix DocBook XML validity 2014-05-06 21:28:58 -04:00
plpgsql.sgml Update 9.4 release notes. 2014-12-14 14:58:06 -05:00
plpython.sgml PL/Python: Fix example 2014-11-01 11:33:30 -04:00
pltcl.sgml doc: Various typo/grammar fixes 2014-08-30 11:01:47 -05:00
postgres-fdw.sgml Add some examples to the postgres_fdw documentation. 2014-01-31 17:28:02 -05:00
postgres.sgml Documentation for logical decoding. 2014-03-18 13:20:01 -04:00
problems.sgml Use "backend process" rather than "backend server", where appropriate. 2011-03-12 09:38:56 -05:00
protocol.sgml Report WAL flush, not insert, position in replication IDENTIFY_SYSTEM 2015-02-06 11:27:12 +02:00
queries.sgml Improve documentation's description of JOIN clauses. 2014-11-19 16:00:27 -05:00
query.sgml Use "backend process" rather than "backend server", where appropriate. 2011-03-12 09:38:56 -05:00
rangetypes.sgml Improve Range Types and Exclusion Constraints example. 2013-09-04 23:30:27 -07:00
README.links docs: improve xref description for xreflabel and refentry links 2014-01-30 12:26:18 -05:00
recovery-config.sgml Treat negative values of recovery_min_apply_delay as having no effect. 2015-01-03 13:14:12 -05:00
reference.sgml Documentation for logical decoding. 2014-03-18 13:20:01 -04:00
regress.sgml Lock down regression testing temporary clusters on Windows. 2014-12-17 22:48:45 -05:00
release-7.4.sgml doc: Various typo/grammar fixes 2014-08-30 11:01:47 -05:00
release-8.0.sgml Improve cross-references between minor version release notes. 2014-02-12 19:09:18 -05:00
release-8.1.sgml Improve cross-references between minor version release notes. 2014-02-12 19:09:18 -05:00
release-8.2.sgml doc: Various typo/grammar fixes 2014-08-30 11:01:47 -05:00
release-8.3.sgml Improve cross-references between minor version release notes. 2014-02-12 19:09:18 -05:00
release-8.4.sgml Release notes for 9.3.5, 9.2.9, 9.1.14, 9.0.18, 8.4.22. 2014-07-21 14:59:25 -04:00
release-9.0.sgml Last-minute updates for release notes. 2015-02-02 11:24:02 -05:00
release-9.1.sgml Last-minute updates for release notes. 2015-02-02 11:24:02 -05:00
release-9.2.sgml Last-minute updates for release notes. 2015-02-02 11:24:02 -05:00
release-9.3.sgml Last-minute updates for release notes. 2015-02-02 11:24:02 -05:00
release-9.4.sgml Last-minute updates for release notes. 2015-02-02 11:24:02 -05:00
release-old.sgml doc: Various typo/grammar fixes 2014-08-30 11:01:47 -05:00
release.sgml Initial version of Postgres 9.4 release notes 2014-05-03 23:16:24 -04:00
rowtypes.sgml Further review of range-types patch. 2011-11-18 18:24:32 -05:00
rules.sgml doc: Fix DocBook XML validity 2014-05-06 21:28:58 -04:00
runtime.sgml doc: Reflect renaming of Mac OS X to OS X 2014-09-09 13:58:50 -04:00
seg.sgml Add xreflabels to /contrib manuals so links appear correct. Also update 2011-05-07 22:29:20 -04:00
sepgsql.sgml doc: Fix DocBook XML validity 2014-05-06 21:28:58 -04:00
sourcerepo.sgml Properly capitalize documentation headings; some only had initial-word 2011-01-29 13:01:48 -05:00
sources.sgml Show PIDs of lock holders and waiters in log_lock_waits log message. 2014-03-13 03:26:47 +09:00
spgist.sgml Add an in-core GiST index opclass for inet/cidr types. 2014-04-08 15:46:43 -04:00
spi.sgml doc: Spell checking 2014-07-16 22:20:15 -04:00
sql.sgml doc: Fix for too many brackets in command synopses on man pages 2012-05-03 22:58:00 +03:00
sslinfo.sgml doc: Fix DocBook XML validity 2014-05-06 21:28:58 -04:00
standalone-install.sgml Don't generate plain-text HISTORY and src/test/regress/README anymore. 2014-02-10 20:48:04 -05:00
start.sgml Remove mention of using "man" from the tutorial. 2011-04-03 19:49:05 -04:00
storage.sgml Fix documentation oversights about pageinspect and initialization fork. 2014-08-11 22:52:48 +09:00
stylesheet-common.xsl doc: Disable preface.autolabel in XSLT 2013-12-01 17:13:23 -05:00
stylesheet-fo.xsl doc: Improve setup for documentation building with FOP 2013-10-21 06:43:08 -04:00
stylesheet-hh.xsl Fix display of <command> elements on man pages 2012-04-30 21:18:03 +03:00
stylesheet-man.xsl doc: Work around stylesheet bug for man build 2014-08-17 09:14:32 -04:00
stylesheet.css Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
stylesheet.dsl doc: Various typo/grammar fixes 2014-08-30 11:01:47 -05:00
stylesheet.xsl doc: Disable indentation of XHTML output 2014-02-05 23:49:25 -05:00
syntax.sgml Fix incorrect markup in documentation of window frame clauses. 2015-03-31 20:03:42 -04:00
tablefunc.sgml Add contrib function references in the doc index 2013-07-04 11:33:11 -04:00
tcn.sgml Reduce messages about implicit indexes and sequences to DEBUG1. 2012-07-04 20:35:29 -04:00
test-decoding.sgml doc: Fix spacing in verbatim environments 2014-07-08 11:39:07 -04:00
test-parser.sgml Add xreflabels to /contrib manuals so links appear correct. Also update 2011-05-07 22:29:20 -04:00
test-shm-mq.sgml Fix typo in test_shm_mq document. 2014-05-13 01:41:54 +09:00
textsearch.sgml doc: Various typo/grammar fixes 2014-08-30 11:01:47 -05:00
trigger.sgml Offer triggers on foreign tables. 2014-03-23 02:16:34 -04:00
tsearch2.sgml Add xreflabels to /contrib manuals so links appear correct. Also update 2011-05-07 22:29:20 -04:00
typeconv.sgml Clarify type resolution behavior for domain types. 2014-08-10 16:13:16 -04:00
unaccent.sgml Add xreflabels to /contrib manuals so links appear correct. Also update 2011-05-07 22:29:20 -04:00
user-manag.sgml Make superuser imply replication privilege. The idea of a privilege that 2012-01-14 18:22:16 +02:00
uuid-ossp.sgml doc: Reflect renaming of Mac OS X to OS X 2014-09-09 13:58:50 -04:00
vacuumlo.sgml doc: Improve DocBook XML validity 2014-02-23 21:31:08 -05:00
wal.sgml Fix missing space in documentation 2014-12-01 12:12:23 +01:00
xaggr.sgml doc: Spell checking 2014-07-16 22:20:15 -04:00
xfunc.sgml Docs: clarify treatment of variadic functions with zero variadic arguments. 2014-12-21 15:31:09 -05:00
xindex.sgml doc: Spell checking 2014-07-16 22:20:15 -04:00
xml2.sgml doc: Various typo/grammar fixes 2014-08-30 11:01:47 -05:00
xoper.sgml doc: Various typo/grammar fixes 2014-08-30 11:01:47 -05:00
xplang.sgml Update documentation to reflect that standard PLs are now extensions. 2011-03-05 01:08:38 -05:00
xtypes.sgml Add more use of psprintf() 2014-01-06 21:30:26 -05:00

<!-- 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