postgresql/src/interfaces/libpq
Alvaro Herrera e146ca6820 psql: fix \connect with URIs and conninfo strings
This is the second try at this, after fcef161729 failed miserably and
had to be reverted: as it turns out, libpq cannot depend on libpgcommon
after all. Instead of shuffling code in the master branch, make that one
just like 9.4 and accept the duplication.  (This was all my own mistake,
not the patch submitter's).

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.

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-02 12:30:57 -03:00
..
po Translation updates 2015-02-01 23:23:40 -05:00
test Fix libpq test expected output file 2015-03-11 17:04:27 -03:00
.gitignore Include files copied from libpqport in .gitignore 2014-05-08 10:59:09 +03:00
bcc32.mak Replace SYSTEMQUOTEs with Windows-specific wrapper functions. 2014-05-05 16:07:40 +03:00
exports.txt Add API functions to libpq to interrogate SSL related stuff. 2015-02-03 19:57:52 +02:00
fe-auth.c Fix libpq's behavior when /etc/passwd isn't readable. 2015-01-11 12:35:44 -05:00
fe-auth.h Fix libpq's behavior when /etc/passwd isn't readable. 2015-01-11 12:35:44 -05:00
fe-connect.c psql: fix \connect with URIs and conninfo strings 2015-04-02 12:30:57 -03:00
fe-exec.c Fix documentation for libpq's PQfn(). 2015-03-08 13:35:28 -04:00
fe-lobj.c Cast to (void *) rather than (int *) when passing int64's to PQfn(). 2015-03-08 13:58:28 -04:00
fe-misc.c Fix potential deadlock with libpq non-blocking mode. 2015-02-23 13:34:21 +02:00
fe-print.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
fe-protocol2.c Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
fe-protocol3.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
fe-secure-openssl.c Fix comment in libpq OpenSSL code about why a substitue BIO is used. 2015-02-16 23:05:20 +02:00
fe-secure.c Add dummy PQsslAttributes function for non-SSL builds. 2015-02-04 09:13:15 +02:00
libpq-events.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
libpq-events.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
libpq-fe.h Add API functions to libpq to interrogate SSL related stuff. 2015-02-03 19:57:52 +02:00
libpq-int.h Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
libpq.rc.in Update copyright for 2015 2015-01-06 11:43:47 -05:00
Makefile Install shared libraries also in bin on cygwin, mingw 2015-01-18 22:36:40 -05:00
nls.mk Translation updates 2013-09-02 02:43:18 -04:00
pg_service.conf.sample Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
pqexpbuffer.c Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
pqexpbuffer.h Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
pthread-win32.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
README Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
win32.c Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
win32.h Enable compiling with the mingw-w64 32 bit compiler. 2011-12-10 15:35:41 -05:00
win32.mak MinGW: Link with shell32.dll instead of shfolder.dll. 2014-10-21 22:55:43 -04:00

src/interfaces/libpq/README

This directory contains the C version of Libpq, the POSTGRES frontend library.