aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/libpq-int.h
Commit message (Collapse)AuthorAge
...
* Rewrite PQping to be more like what we agreed to last week.Tom Lane2010-11-27
| | | | | | | | | | | | | | | | | | | | | | | Basically, we want to distinguish all cases where the connection was not made from those where it was. A convenient proxy for this is to see if we got a message with a SQLSTATE code back from the postmaster. This presumes that the postmaster will always send us a SQLSTATE in a failure message, which is true for 7.4 and later postmasters in every case except fork failure. (We could possibly complicate the postmaster code to do something about that, but it seems not worth the trouble, especially since pg_ctl's response for that case should be to keep waiting anyway.) If we did get a SQLSTATE from the postmaster, there are basically only two cases, as per last week's discussion: ERRCODE_CANNOT_CONNECT_NOW and everything else. Any other error code implies that the postmaster is in principle willing to accept connections, it just didn't like or couldn't handle this particular request. We want to make a special case for ERRCODE_CANNOT_CONNECT_NOW so that "pg_ctl start -w" knows it should keep waiting. In passing, pick names for the enum constants that are a tad less likely to present collision hazards in future.
* Remove cvs keywords from all files.Magnus Hagander2010-09-20
|
* Add server authentication over Unix-domain socketsPeter Eisentraut2010-07-18
| | | | | | | This adds a libpq connection parameter requirepeer that specifies the user name that the server process is expected to run under. reviewed by KaiGai Kohei
* Allow full SSL certificate verification (wherein libpq checks its host nameTom Lane2010-07-14
| | | | | | | | | | | | | | | parameter against server cert's CN field) to succeed in the case where both host and hostaddr are specified. As with the existing precedents for Kerberos, GSSAPI, SSPI, it is the calling application's responsibility that host and hostaddr match up --- we just use the host name as given. Per bug #5559 from Christopher Head. In passing, make the error handling and messages for the no-host-name-given failure more consistent among these four cases, and correct a lie in the documentation: we don't attempt to reverse-lookup host from hostaddr if host is missing. Back-patch to 8.4 where SSL cert verification was introduced.
* pgindent run for 9.0, second runBruce Momjian2010-07-06
|
* Add TCP keepalive support to libpq.Robert Haas2010-06-23
| | | | | | | | | | | | | | | | This adds four additional connection parameters to libpq: keepalives, keepalives_idle, keepalives_count, and keepalives_interval. keepalives default to on, per discussion, but can be turned off by specifying keepalives=0. The remaining parameters, where supported, can be used to adjust how often keepalives are sent and how many can be lost before the connection is broken. The immediate motivation for this patch is to make sure that walreceiver will eventually notice if the master reboots without closing the connection cleanly, but it should be helpful in other cases as well. Tollef Fog Heen, Fujii Masao, and me.
* Add libpq warning message if the .pgpass-retrieved password fails.Bruce Momjian2010-03-13
| | | | Add ERRCODE_INVALID_PASSWORD sqlstate error code.
* pgindent run for 9.0Bruce Momjian2010-02-26
|
* Introduce Streaming Replication.Heikki Linnakangas2010-01-15
| | | | | | | | | | | | | | | | | | | | This includes two new kinds of postmaster processes, walsenders and walreceiver. Walreceiver is responsible for connecting to the primary server and streaming WAL to disk, while walsender runs in the primary server and streams WAL from disk to the client. Documentation still needs work, but the basics are there. We will probably pull the replication section to a new chapter later on, as well as the sections describing file-based replication. But let's do that as a separate patch, so that it's easier to see what has been added/changed. This patch also adds a new section to the chapter about FE/BE protocol, documenting the protocol used by walsender/walreceivxer. Bump catalog version because of two new functions, pg_last_xlog_receive_location() and pg_last_xlog_replay_location(), for monitoring the progress of replication. Fujii Masao, with additional hacking by me
* Update copyright for the year 2010.Bruce Momjian2010-01-02
|
* Instead of sending application_name as a SET command after the connectionTom Lane2009-12-02
| | | | | | | | | | | is made, include it in the startup-packet options. This makes it work more like every other libpq connection option, in particular it now has the same response to RESET ALL as the rest. This also saves one network round trip for new applications using application_name. The cost is that if the server is pre-8.5, it'll reject the startup packet altogether, forcing us to retry the entire connection cycle. But on balance we shouldn't be optimizing that case in preference to the behavior with a new server, especially when doing so creates visible behavioral oddities. Per discussion.
* Add support for an application_name parameter, which is displayed inTom Lane2009-11-28
| | | | | | pg_stat_activity and recorded in log entries. Dave Page, reviewed by Andres Freund
* Avoid extra system calls to block SIGPIPE if the platform provides eitherTom Lane2009-07-24
| | | | | | | | | | | | | sockopt(SO_NOSIGPIPE) or the MSG_NOSIGNAL flag to send(). We assume these features are available if (1) the symbol is defined at compile time and (2) the kernel doesn't reject the call at runtime. It might turn out that there are some platforms where (1) and (2) are true and yet the signal isn't really blocked, in which case applications would die on server crash. If that sort of thing gets reported, then we'll have to add additional defenses of some kind. Jeremy Kerr
* Properly initialize SSL engines when used from libpq. This is required forMagnus Hagander2009-06-23
| | | | | | most external engines. Per report and initial code from Lars Kanis
* 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian2009-06-11
| | | | provided by Andrew.
* Remove sslverify parameter again, replacing it with two new sslmode values:Magnus Hagander2009-04-24
| | | | | | | "verify-ca" and "verify-full". Since "prefer" remains the default, this will make certificate validation off by default, which should lead to less upgrade issues.
* Assorted portability fixes for Borland C, from Pavel Golub.Tom Lane2009-04-19
|
* Update copyright for 2009.Bruce Momjian2009-01-01
|
* Support specifying filename for SSL certificate, key, root certificate storeMagnus Hagander2008-12-15
| | | | | | | | and certificate revokation list by using connection parameters or environment variables. Original patch by Mark Woodward, heavily reworked by Alvaro Herrera and Magnus Hagander.
* Fix libpq certificate validation for SSL connections.Magnus Hagander2008-11-13
| | | | | | | Add config parameter "sslverify" to control the verification. Default is to do full verification. Clean up some old SSL code that never really worked.
* Remove support for (insecure) crypt authentication.Magnus Hagander2008-10-28
| | | | This breaks compatibility with pre-7.2 versions.
* Add support for multiple error messages from libpq, by simply appending themMagnus Hagander2008-10-27
| | | | | | | | | after each other (since we already add a newline on each, this makes them multiline). Previously a new error would just overwrite the old one, so for example any error caused when trying to connect with SSL enabled would be overwritten by the error message form the non-SSL connection when using sslmode=prefer.
* Get rid of pgpass_from_client tracking inside libpq --- given the conclusionTom Lane2008-09-22
| | | | | | | that presence of the password in the conninfo string must be checked *before* risking a connection attempt, there is no point in checking it afterwards. This makes the specification of PQconnectionUsedPassword() a bit simpler and perhaps more generally useful, too.
* Improve the recently-added libpq events code to provide more consistentTom Lane2008-09-19
| | | | | | | | guarantees about whether event procedures will receive DESTROY events. They no longer need to defend themselves against getting a DESTROY without a successful prior CREATE. Andrew Chernow
* Add an "events" system to libpq, whereby applications can get callbacks thatTom Lane2008-09-17
| | | | | | enable them to manage private data associated with PGconns and PGresults. Andrew Chernow and Merlin Moncure
* Tweak libpq to avoid crashing due to incorrect buffer size calculation whenTom Lane2008-05-29
| | | | | | | | | | | | | | we are on a 64-bit machine (ie, size_t is wider than int) and someone passes in a query string that approaches or exceeds INT_MAX bytes. Also, just for paranoia's sake, guard against similar overflows in sizing the input buffer. The backend will not in the foreseeable future be prepared to send or receive strings exceeding 1GB, so I didn't take the more invasive step of switching all the buffer index variables from int to size_t; though someday we might want to do that. I have a suspicion that this is not the only such bug in libpq, but this fix is enough to take care of the crash reported by Francisco Reyes.
* Implement error checking for pthreads calls in thread-safe mode. They reallyMagnus Hagander2008-05-16
| | | | | | | | | should always succeed, but in the likely event of a failure we would previously fall through *without locking* - the new code will exit(1). Printing the error message on stderr will not work for all applications, but it's better than nothing at all - and our API doesn't provide a way to return the error to the caller.
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-01
|
* Fix up the PQconnectionUsedPassword mess: create a separateTom Lane2007-12-09
| | | | | | | | PQconnectionNeedsPassword function that tells the right thing for whether to prompt for a password, and improve PQconnectionUsedPassword so that it checks whether the password used by the connection was actually supplied as a connection argument, instead of coming from environment or a password file. Per bug report from Mark Cave-Ayland and subsequent discussion.
* pgindent run for 8.3.Bruce Momjian2007-11-15
|
* Just noticed that libpq thinks the maximum command tag length is 40,Tom Lane2007-07-23
| | | | | | whereas in the backend it's been 64 for some time. Hasn't mattered because no actual tags exceed 40 bytes, but for consistency they should be alike.
* Use PQExpBuffer for error message in fe-auth.c.Magnus Hagander2007-07-23
| | | | | In passing, change functions that passedin both PGconn and parts of it to just pass in the PGconn.
* SSPI authentication on Windows. GSSAPI compatible client when doing KerberosMagnus Hagander2007-07-23
| | | | | | | against a Unix server, and Windows-specific server-side authentication using SSPI "negotiate" method (Kerberos or NTLM). Only builds properly with MSVC for now.
* Support GSSAPI builds where the header is <gssapi.h> and not <gssapi/gssapi.h>,Magnus Hagander2007-07-12
| | | | | | such as OpenBSD (possibly all Heimdal). Stefan Kaltenbrunner
* Add support for GSSAPI authentication.Magnus Hagander2007-07-10
| | | | | | Documentation still being written, will be committed later. Henry B. Hotz and Magnus Hagander
* Closer code review for PQconnectionUsedPassword() patch: in particular,Tom Lane2007-07-08
| | | | | not OK to include postgres_fe.h into libpq-fe.h, hence declare it as returning int not bool.
* Arrange for the authentication request type to be preserved inJoe Conway2007-07-08
| | | | | | | | | PGconn. Invent a new libpq connection-status function, PQconnectionUsedPassword() that returns true if the server demanded a password during authentication, false otherwise. This may be useful to clients in general, but is immediately useful to help plug a privilege escalation path in dblink. Per list discussion and design proposed by Tom Lane.
* Add lo_truncate() to backend and libpq for large object truncation.Bruce Momjian2007-03-03
| | | | Kris Jurka
* Squelch some VC++ compiler warnings. Mark float literals with the "f"Neil Conway2007-01-26
| | | | | | | suffix, to distinguish them from doubles. Make some function declarations and definitions use the "const" qualifier for arguments consistently. Ignore warning 4102 ("unreferenced label"), because such warnings are always emitted by bison-generated code. Patch from Magnus Hagander.
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05
| | | | back-stamped for this.
* pgindent run for 8.2.Bruce Momjian2006-10-04
|
* Add PQdescribePrepared, PQdescribePortal, and related functions to libpqTom Lane2006-08-18
| | | | | to allow obtaining information about previously prepared statements and open cursors. Volkan Yazici
* #ifdef fix for MSVC builds of libpq.Bruce Momjian2006-08-04
| | | | Hiroshi Saito
* Modify libpq's string-escaping routines to be aware of encoding considerationsTom Lane2006-05-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and standard_conforming_strings. The encoding changes are needed for proper escaping in multibyte encodings, as per the SQL-injection vulnerabilities noted in CVE-2006-2313 and CVE-2006-2314. Concurrent fixes are being applied to the server to ensure that it rejects queries that may have been corrupted by attempted SQL injection, but this merely guarantees that unpatched clients will fail rather than allow injection. An actual fix requires changing the client-side code. While at it we have also fixed these routines to understand about standard_conforming_strings, so that the upcoming changeover to SQL-spec string syntax can be somewhat transparent to client code. Since the existing API of PQescapeString and PQescapeBytea provides no way to inform them which settings are in use, these functions are now deprecated in favor of new functions PQescapeStringConn and PQescapeByteaConn. The new functions take the PGconn to which the string will be sent as an additional parameter, and look inside the connection structure to determine what to do. So as to provide some functionality for clients using the old functions, libpq stores the latest encoding and standard_conforming_strings values received from the backend in static variables, and the old functions consult these variables. This will work reliably in clients using only one Postgres connection at a time, or even multiple connections if they all use the same encoding and string syntax settings; which should cover many practical scenarios. Clients that use homebrew escaping methods, such as PHP's addslashes() function or even hardwired regexp substitution, will require extra effort to fix :-(. It is strongly recommended that such code be replaced by use of PQescapeStringConn/PQescapeByteaConn if at all feasible.
* Improve parser so that we can show an error cursor position for errorsTom Lane2006-03-14
| | | | | | | | | | | during parse analysis, not only errors detected in the flex/bison stages. This is per my earlier proposal. This commit includes all the basic infrastructure, but locations are only tracked and reported for errors involving column references, function calls, and operators. More could be done later but this seems like a good set to start with. I've also moved the ReportSyntaxErrorPosition logic out of psql and into libpq, which should make it available to more people --- even within psql this is an improvement because warnings weren't handled by ReportSyntaxErrorPosition.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Add positive defense against trying to connect when the connectionTom Lane2006-02-13
| | | | | | option state hasn't been fully set up. This is possible via PQreset() and might occur in other code paths too, so a state flag seems the most robust solution. Per report from Arturs Zoldners.
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-22
| | | | | | | | | comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* The attached patch updates the thread test program to run stand-alone onBruce Momjian2005-08-23
| | | | | | | | Windows. The test itself is bypassed in configure as discussed, and libpq has been updated appropriately to allow it to build in thread-safe mode. Dave Page