summaryrefslogtreecommitdiff
path: root/src/include/libpq
Commit message (Collapse)AuthorAgeFilesLines
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-0511-22/+22
| | | | back-stamped for this.
* Fix recently-understood problems with handling of XID freezing, particularlyTom Lane2006-11-051-3/+2
| | | | | | | | | | | | | | | in PITR scenarios. We now WAL-log the replacement of old XIDs with FrozenTransactionId, so that such replacement is guaranteed to propagate to PITR slave databases. Also, rather than relying on hint-bit updates to be preserved, pg_clog is not truncated until all instances of an XID are known to have been replaced by FrozenTransactionId. Add new GUC variables and pg_autovacuum columns to allow management of the freezing policy, so that users can trade off the size of pg_clog against the amount of freezing work done. Revise the already-existing code that forces autovacuum of tables approaching the wraparound point to make it more bulletproof; also, revise the autovacuum logic so that anti-wraparound vacuuming is done per-table rather than per-database. initdb forced because of changes in pg_class, pg_database, and pg_autovacuum catalogs. Heikki Linnakangas, Simon Riggs, and Tom Lane.
* pgindent run for 8.2.Bruce Momjian2006-10-042-5/+5
|
* Specify lo_write() to take a _const_ buffer, to match documentation.Bruce Momjian2006-09-071-2/+2
|
* Allow include files to compile own their own.Bruce Momjian2006-07-131-2/+1
| | | | | | | Strip unused include files out unused include files, and add needed includes to C files. The next step is to remove unused include files in C files.
* Improve vacuum code to track minimum Xids per table instead of per database.Alvaro Herrera2006-07-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | To this end, add a couple of columns to pg_class, relminxid and relvacuumxid, based on which we calculate the pg_database columns after each vacuum. We now force all databases to be vacuumed, even template ones. A backend noticing too old a database (meaning pg_database.datminxid is in danger of falling behind Xid wraparound) will signal the postmaster, which in turn will start an autovacuum iteration to process the offending database. In principle this is only there to cope with frozen (non-connectable) databases without forcing users to set them to connectable, but it could force regular user database to go through a database-wide vacuum at any time. Maybe we should warn users about this somehow. Of course the real solution will be to use autovacuum all the time ;-) There are some additional improvements we could have in this area: for example the vacuum code could be smarter about not updating pg_database for each table when called by autovacuum, and do it only once the whole autovacuum iteration is done. I updated the system catalogs documentation, but I didn't modify the maintenance section. Also having some regression tests for this would be nice but it's not really a very straightforward thing to do. Catalog version bumped due to system catalog changes.
* Remove redundant gettimeofday() calls to the extent practical withoutTom Lane2006-06-201-3/+6
| | | | | | | | | | | changing semantics too much. statement_timestamp is now set immediately upon receipt of a client command message, and the various places that used to do their own gettimeofday() calls to mark command startup are referenced to that instead. I have also made stats_command_string use that same value for pg_stat_activity.query_start for both the command itself and its eventual replacement by <IDLE> or <idle in transaction>. There was some debate about that, but no argument that seemed convincing enough to justify an extra gettimeofday() call.
* Split definitions for md5.c out of crypt.h and into their own headerTom Lane2006-06-203-14/+34
| | | | | | | | | libpq/md5.h, so that there's a clear separation between backend-only definitions and shared frontend/backend definitions. (Turns out this is reversing a bad decision from some years ago...) Fix up references to crypt.h as needed. I looked into moving the code into src/port, but the headers in src/include/libpq are sufficiently intertwined that it seems more work than it's worth to do that.
* Prepare code to be built by MSVC:Bruce Momjian2006-06-071-10/+1
| | | | | | | | | | o remove many WIN32_CLIENT_ONLY defines o add WIN32_ONLY_COMPILER define o add 3rd argument to open() for portability o add include/port/win32_msvc directory for system includes Magnus Hagander
* Rename macro parameter, for clarity.Bruce Momjian2006-05-171-3/+3
|
* This patch adds native LDAP auth, for those platforms that don't haveBruce Momjian2006-03-061-1/+4
| | | | | | | PAM (such as Win32, but also unixen without PAM). On Unix, uses OpenLDAP. On win32, uses the builin WinLDAP library. Magnus Hagander
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-0510-20/+20
|
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-223-21/+21
| | | | | | | | | 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.
* Repair an error introduced by log_line_prefix patch: it is not acceptableTom Lane2005-11-051-2/+1
| | | | | | | | | | | to assume that the string pointer passed to set_ps_display is good forever. There's no need to anyway since ps_status.c itself saves the string, and we already had an API (get_ps_display) to return it. I believe this explains Jim Nasby's report of intermittent crashes in elog.c when %i format code is in use in log_line_prefix. While at it, repair a previously unnoticed problem: on some platforms such as Darwin, the string returned by get_ps_display was blank-padded to the maximum length, meaning that lock.c's attempt to append " waiting" to it never worked.
* Clean up libpq's pollution of application namespace by renaming theTom Lane2005-10-173-26/+20
| | | | | | exported routines of ip.c, md5.c, and fe-auth.c to begin with 'pg_'. Also get rid of the vestigial fe_setauthsvc/fe_getauthsvc routines altogether.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-156-40/+35
|
* Tweak TCP-keepalive code so that an invalid setting doesn't cause usTom Lane2005-09-121-19/+16
| | | | | | | to drop connections unceremoniously. Also some other marginal cleanups: don't query getsockopt() repeatedly if it fails, and avoid having the apparent definition of struct Port depend on which system headers you might have included or not. Oliver Jowett and Tom Lane.
* Autovacuum loose end mop-up. Provide autovacuum-specific vacuum costTom Lane2005-08-111-2/+3
| | | | | | | delay and limit, both as global GUCs and as table-specific entries in pg_autovacuum. stats_reset_on_server_start is now OFF by default, but a reset is forced if we did WAL replay. XID-wrap vacuums do not ANALYZE, but do FREEZE if it's a template database. Alvaro Herrera
* Add GUC variables to control keep-alive times for idle, interval, andBruce Momjian2005-07-301-1/+32
| | | | | | count. Oliver Jowett
* Clean up a number of autovacuum loose ends. Make the stats collectorTom Lane2005-07-291-3/+3
| | | | | | | | track shared relations in a separate hashtable, so that operations done from different databases are counted correctly. Add proper support for anti-XID-wraparound vacuuming, even in databases that are never connected to and so have no stats entries. Miscellaneous other bug fixes. Alvaro Herrera, some additional fixes by Tom Lane.
* Replace pg_shadow and pg_group by new role-capable catalogs pg_authidTom Lane2005-06-281-4/+3
| | | | | | | | and pg_auth_members. There are still many loose ends to finish in this patch (no documentation, no regression tests, no pg_dump support for instance). But I'm going to commit it now anyway so that Alvaro can make some progress on shared dependencies. The catalog changes should be pretty much done.
* Remove support for Kerberos V4. It seems no one is using this, it hasNeil Conway2005-06-273-7/+5
| | | | | some security issues, and upstream has declared it "dead". Patch from Magnus Hagander, minor editorialization from Neil Conway.
* Add GUC krb_server_hostname so the server hostname can be specified asBruce Momjian2005-06-141-1/+2
| | | | | | | | | part of service principal. If not set, any service principal matching an entry in the keytab can be used. NEW KERBEROS MATCHING BEHAVIOR FOR 8.1. Todd Kover
* Adjust lo_open() so that specifying INV_READ without INV_WRITE createsTom Lane2005-06-131-1/+2
| | | | | | | | | | a descriptor that uses the current transaction snapshot, rather than SnapshotNow as it did before (and still does if INV_WRITE is set). This means pg_dump will now dump a consistent snapshot of large object contents, as it never could do before. Also, add a lo_create() function that is similar to lo_creat() but allows the desired OID of the large object to be specified. This will simplify pg_restore considerably (but I'll fix that in a separate commit).
* Allow kerberos name and username case sensitivity to be specified fromBruce Momjian2005-06-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | postgresql.conf. --------------------------------------------------------------------------- Here's an updated version of the patch, with the following changes: 1) No longer uses "service name" as "application version". It's instead hardcoded as "postgres". It could be argued that this part should be backpatched to 8.0, but it doesn't make a big difference until you can start changing it with GUC / connection parameters. This change only affects kerberos 5, not 4. 2) Now downcases kerberos usernames when the client is running on win32. 3) Adds guc option for "krb_caseins_users" to make the server ignore case mismatch which is required by some KDCs such as Active Directory. Off by default, per discussion with Tom. This change only affects kerberos 5, not 4. 4) Updated so it doesn't conflict with the rendevouz/bonjour patch already in ;-) Magnus Hagander
* Add parentheses to macros when args are used in computations. WithoutBruce Momjian2005-05-251-2/+2
| | | | them, the executation behavior could be unexpected.
* Finish up the flat-files project: get rid of GetRawDatabaseInfo() hackTom Lane2005-02-261-6/+5
| | | | | | | | | | | in favor of looking at the flat file copy of pg_database during backend startup. This should finally eliminate the various corner cases in which backend startup fails unexpectedly because it isn't able to distinguish live and dead tuples in pg_database. Simplify locking on pg_database to be similar to the rules used with pg_shadow and pg_group, and eliminate FlushRelationBuffers operations that were used only to reduce the odds of failure of GetRawDatabaseInfo. initdb forced due to addition of a trigger to pg_database.
* Some more missed copyright notices. Many of these look like theyTom Lane2005-01-011-2/+2
| | | | | should have been caught by the src/tools/copyright script ... why weren't they?
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-319-18/+18
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Remove references to the ODBC driver from the main source tree. From KrisNeil Conway2004-09-271-3/+1
| | | | Jurka.
* Repair bug that would allow libpq to think a command had succeeded whenTom Lane2004-09-261-1/+2
| | | | | it really hadn't, due to double output of previous command's response. Fix prevents recursive entry to libpq routines. Found by Jan Wieck.
* Restructure subtransaction handling to reduce resource consumption,Tom Lane2004-09-161-3/+3
| | | | | | | | | | | | | | | | | as per recent discussions. Invent SubTransactionIds that are managed like CommandIds (ie, counter is reset at start of each top transaction), and use these instead of TransactionIds to keep track of subtransaction status in those modules that need it. This means that a subtransaction does not need an XID unless it actually inserts/modifies rows in the database. Accordingly, don't assign it an XID nor take a lock on the XID until it tries to do that. This saves a lot of overhead for subtransactions that are only used for error recovery (eg plpgsql exceptions). Also, arrange to release a subtransaction's XID lock as soon as the subtransaction exits, in both the commit and abort cases. This avoids holding many unique locks after a long series of subtransactions. The price is some additional overhead in XactLockTableWait, but that seems acceptable. Finally, restructure the state machine in xact.c to have a more orthogonal set of states for subtransactions.
* Pgindent run for 8.0.Bruce Momjian2004-08-293-13/+14
|
* Update copyright to 2004.Bruce Momjian2004-08-299-18/+18
|
* Fix subtransaction behavior for large objects, temp namespace, files,Tom Lane2004-07-281-3/+5
| | | | | | | password/group files. Also allow read-only subtransactions of a read-write parent, but not vice versa. These are the reasonably noncontroversial parts of Alvaro's recent mop-up patch, plus further work on large objects to minimize use of the TopTransactionResourceOwner.
* Avoid including <sys/time.h> on platforms that don't have it.Tom Lane2004-06-241-2/+3
| | | | Per trouble report from Andreas Pflug.
* Integrate src/timezone library for all platforms. There is more we canTom Lane2004-05-211-3/+2
| | | | | | and should do now that we control our own destiny for timezone handling, but this commit gets the bulk of the picayune diffs in place. Magnus Hagander and Tom Lane.
* Here's an attempt at new socket and signal code for win32.Bruce Momjian2004-04-121-21/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It works on the principle of turning sockets into non-blocking, and then emulate blocking behaviour on top of that, while allowing signals to run. Signals are now implemented using an event instead of APCs, thus getting rid of the issue of APCs not being compatible with "old style" sockets functions. It also moves the win32 specific code away from pqsignal.h/c into port/win32, and also removes the "thread style workaround" of the APC issue previously in place. In order to make things work, a few things are also changed in pgstat.c: 1) There is now a separate pipe to the collector and the bufferer. This is required because the pipe will otherwise only be signalled in one of the processes when the postmaster goes down. The MS winsock code for select() must have some kind of workaround for this behaviour, but I have found no stable way of doing that. You really are not supposed to use the same socket from more than one process (unless you use WSADuplicateSocket(), in which case the docs specifically say that only one will be flagged). 2) The check for "postmaster death" is moved into a separate select() call after the main loop. The previous behaviour select():ed on the postmaster pipe, while later explicitly saying "we do NOT check for postmaster exit inside the loop". The issue was that the code relies on the same select() call seeing both the postmaster pipe *and* the pgstat pipe go away. This does not always happen, and it appears that useing WSAEventSelect() makes it even more common that it does not. Since it's only called when the process exits, I don't think using a separate select() call will have any significant impact on how the stats collector works. Magnus Hagander
* Corrects issues recently posted by Dann Corbit, allowing libpq/psql toBruce Momjian2004-04-051-1/+3
| | | | | | be built under VC++. Moves a pgstat win32 #def to port.h Claudio Natoli
* Code review for log_line_prefix patch. Cooperate with StringInfo insteadTom Lane2004-03-191-3/+9
| | | | | | of fighting it, avoid hard-wired (and wrong) assumption about max length of prefix, cause %l to actually work as documented, don't compute data we may not need.
* Add:Bruce Momjian2004-03-091-1/+2
| | | | | | | | | | | | | #log_line_prefix = '' # e.g. '<%u%%%d> ' # %u=user name %d=database name # %r=remote host and port # %p=PID %t=timestamp %i=command tag # %c=session id %l=session line number # %s=session start timestamp # %x=stop here in non-session processes # %%='%' Andrew Dunstan
* Fix random build breakage from log_disconnections patch.Tom Lane2004-02-211-4/+5
|
* This patch brings up to date what I did last year (now unfortunatelyBruce Momjian2004-02-171-1/+4
| | | | | | | bitrotted) to allow the logging of the end of a session, enabled by the config setting "log_disconnections". Andrew Dunstan
* Win32 signals cleanup. Patch by Magnus Hagander, with input from ClaudioNeil Conway2004-02-081-110/+9
| | | | | | | | | | | | | | | | | | | | | | Natoli and Bruce Momjian (and some cosmetic fixes from Neil Conway). Changes: - remove duplicate signal definitions from pqsignal.h - replace pqkill() with kill() and redefine kill() in Win32 - use ereport() in place of fprintf() in some error handling in pqsignal.c - export pg_queue_signal() and make use of it where necessary - add a console control handler for Ctrl-C and similar handling on Win32 - do WaitForSingleObjectEx() in CHECK_FOR_INTERRUPTS() on Win32; query cancelling should now work on Win32 - various other fixes and cleanups
* Fix a read of uninitialized memory in next_token() of hba.c, spotted viaNeil Conway2004-02-021-13/+1
| | | | | | valgrind: a buffer passed to strncmp() had to be NUL-terminated. Original report and patch from Dennis Bjorkland, some cleanup by Andrew Dunstan, and finally some editorializing from Neil Conway.
* Here's the latest win32 signals code, this time in the form of a patchBruce Momjian2004-01-271-2/+128
| | | | | | | | | | | | | | | | | against the latest shapshot. It also includes the replacement of kill() with pqkill() and sigsetmask() with pqsigsetmask(). Passes all tests fine on my linux machine once applied. Still doesn't link completely on Win32 - there are a few things still required. But much closer than before. At Bruce's request, I'm goint to write up a README file about the method of signals delivery chosen and why the others were rejected (basically a summary of the mailinglist discussions). I'll finish that up once/if the patch is accepted. Magnus Hagander
* This patch is the next step towards (re)allowing fork/exec.Bruce Momjian2003-12-201-1/+7
| | | | Claudio Natoli
* make sure the $Id tags are converted to $PostgreSQL as well ...PostgreSQL Daemon2003-11-2911-11/+11
|
* Second try at IPv4-to-v6 mapping code; avoid assuming that the structTom Lane2003-09-051-2/+2
| | | | returned by getaddrinfo_all will have enough room for an IPv6 address.
* Allow IPv4-format entries in pg_hba.conf to match IPv6 connectionsTom Lane2003-09-051-1/+6
| | | | that have IPv4-embedded-in-IPv6 addresses. Per idea of Andreas Pflug.