aboutsummaryrefslogtreecommitdiff
path: root/src/backend
Commit message (Collapse)AuthorAge
* Modify error context callback functions to not assume that they can fetchTom Lane2010-03-19
| | | | | | | | | | | | | | | | | | catalog entries via SearchSysCache and related operations. Although, at the time that these callbacks are called by elog.c, we have not officially aborted the current transaction, it still seems rather risky to initiate any new catalog fetches. In all these cases the needed information is readily available in the caller and so it's just a matter of a bit of extra notation to pass it to the callback. Per crash report from Dennis Koegel. I've concluded that the real fix for his problem is to clear the error context stack at entry to proc_exit, but it still seems like a good idea to make the callbacks a bit less fragile for other cases. Backpatch to 8.4. We could go further back, but the patch doesn't apply cleanly. In the absence of proof that this fixes something and isn't just paranoia, I'm not going to expend the effort.
* Add connection messages for streaming replication. log_connectionsSimon Riggs2010-03-19
| | | | | | | was broken for a replication connection and no messages were displayed on either standby or primary, at any debug level. Connection messages needed to diagnose session drop/reconnect events. Use LOG mode for now, discuss lowering in later releases.
* Minor tweaks on libpqrcv_connect(): ensure conninfo_repl[] isSimon Riggs2010-03-19
| | | | | correctly sized and expand comment to explain otherwise undocumented use of replication connection parameter.
* Adjust comment in .history file to match recovery target specified. CommentSimon Riggs2010-03-19
| | | | | | | | present since 8.0 was never fully meaningful, since two recovery targets cannot be specified. Refactor recovery target type to make this change and associated code easier to understand. No change in function. Bug report arising from internal support question.
* Reset btpo.xact following recovery of btree delete page. Add btpo_xactSimon Riggs2010-03-19
| | | | | | | field into WAL record and reset it from there, rather than using FrozenTransactionId which can lead to some corner case bugs. Problem report and suggested route to a fix from Heikki, details by me.
* Add restartpoint_command option to recovery.conf. Fix bug in %r handlingHeikki Linnakangas2010-03-18
| | | | | | | | | in recovery_end_command, it always came out as 0 because InRedo was cleared before recovery_end_command was executed. Also, always take ControlFileLock when reading checkpoint location for %r. The recovery_end_command bug and the missing locking was present in 8.4 as well, that part of this patch will be backported separately.
* Add vacuum_defer_cleanup_age to postgresql.conf.sample.Simon Riggs2010-03-18
|
* Pass incompletely-transformed aggregate argument lists as separate parametersTom Lane2010-03-17
| | | | | | to transformAggregateCall, instead of abusing fields in Aggref to carry them temporarily. No change in functionality but hopefully the code is a bit clearer now. Per gripe from Gokulakannan Somasundaram.
* Throw a nicer error message if a standby server attempts to connect whileHeikki Linnakangas2010-03-16
| | | | | | the master is still in recovery. We don't support cascading slaves yet. Patch by Fujii Masao, with slightly changed wording.
* Remove incorrect comment from GetWriteRecPtr(): the return value is alwaysSimon Riggs2010-03-15
| | | | correct, as described in comments at start of xlog.c
* Revert all keepalive moves, reevaluate.Bruce Momjian2010-03-13
|
* Move more tcp keepalive macros to be consistent.Bruce Momjian2010-03-13
|
* Move TCP keepalive macro definitionBruce Momjian2010-03-13
| | | | Jaime Casanova
* Add libpq warning message if the .pgpass-retrieved password fails.Bruce Momjian2010-03-13
| | | | Add ERRCODE_INVALID_PASSWORD sqlstate error code.
* Allow underscores in tsearch email addressses, per RFC 5322 and reportBruce Momjian2010-03-13
| | | | | | by Dan O'Hara. Patch by Teodor Sigaev
* Add some logging code for unexpected cases in pgstat.c, particularly beingTom Lane2010-03-12
| | | | | | | | | | unable to read a stats file for reasons other than ENOENT, and having to reset last_statrequest because it's later than current time in the collector. Not clear if this will shed any light on the "pgstat wait timeout" business, but it seems like a good idea in general. In passing, do some message-style-police work on recently-added pgstat_reset_shared_counters code.
* Add missing reset of need_initialization in reloptions code.Tom Lane2010-03-11
| | | | | This resulted in useless extra work during every call of parseRelOptions, but no bad effects other than that. Noted by Alvaro.
* Fix bug in KnownAssignedXidsMany(). I saw this when looking at theHeikki Linnakangas2010-03-11
| | | | | assertion failure reported by Erik Rijkers, but this alone doesn't explain the failure.
* Fix comment which was apparently copy-pasted from another function.Heikki Linnakangas2010-03-11
|
* Fix incorrect comment about permissions checking being done in utility.c.Robert Haas2010-03-10
| | | | Noted while reviewing a patch from KaiGai Kohei.
* pg_start_backup() can use a share lock to lock ControlFileLockItagaki Takahiro2010-03-10
| | | | | | | | | instead of an exclusive lock. The change is almost for code cleanup. Since there seems to be no performance benefits from it, backports should not be needed. Fujii Masao
* Disallow gssapi authentication on local connections, since itMagnus Hagander2010-03-08
| | | | | | requires a hostname to function. Noted by Zdenek Kotala
* Fix warning messages in restrict_and_check_grant() to include the column nameTom Lane2010-03-06
| | | | | | | | | | when warning about column-level privileges. This is more useful than before and makes the apparent duplication complained of by Piyush Newe not so duplicate. Also fix lack of quote marks in a related message text. Back-patch to 8.4, where column-level privileges were introduced. Stephen Frost
* When reading pg_hba.conf and similar files, do not treat @file as an inclusionTom Lane2010-03-06
| | | | | | | | | | | | | | | | | | | | | | | unless (1) the @ isn't quoted and (2) the filename isn't empty. This guards against unexpectedly treating usernames or other strings in "flat files" as inclusion requests, as seen in a recent trouble report from Ed L. The empty-filename case would be guaranteed to misbehave anyway, because our subsequent path-munging behavior results in trying to read the directory containing the current input file. I think this might finally explain the report at http://archives.postgresql.org/pgsql-bugs/2004-05/msg00132.php of a crash after printing "authentication file token too long, skipping", since I was able to duplicate that message (though not a crash) on a platform where stdio doesn't refuse to read directories. We never got far in investigating that problem, but now I'm suspicious that the trigger condition was an @ in the flat password file. Back-patch to all active branches since the problem can be demonstrated in all branches except HEAD. The test case, creating a user named "@", doesn't cause a problem in HEAD since we got rid of the flat password file. Nonetheless it seems like a good idea to not consider quoted @ as a file inclusion spec, so I changed HEAD too.
* Fix IsBinaryCoercible to not confuse a cast using in/out functionsHeikki Linnakangas2010-03-04
| | | | | | with binary compatibility. Backpatch to 8.4 where INOUT casts were introduced.
* Document that "Q" is ignored by to_date and to_timestamp. Add C commentBruce Momjian2010-03-03
| | | | | | | about the behavior. Document that quotes in to_date, to_timestamp, to_number skip input characters.
* Fix a couple of places that would loop forever if attempts to read a stdio fileTom Lane2010-03-03
| | | | | | | set ferror() but never set feof(). This is known to be the case for recent glibc when trying to read a directory as a file, and might be true for other platforms/cases too. Per report from Ed L. (There is more that we ought to do about his report, but this is one easily identifiable issue.)
* Export xml.c's libxml-error-handling support so that contrib/xml2 can use itTom Lane2010-03-03
| | | | | | | | | too, instead of duplicating the functionality (badly). I renamed xml_init to pg_xml_init, because the former seemed just a bit too generic to be safe as a global symbol. I considered likewise renaming xml_ereport to pg_xml_ereport, but felt that the reference to ereport probably made it sufficiently PG-centric already.
* It's clearly now pointless to do backwards compatible parsing of this,Magnus Hagander2010-03-01
| | | | | since we released a version without it, so remove the comment that says we might want to do that.
* Insert a hack into get_float8_nan (both core and ecpg copies) to deal withTom Lane2010-02-27
| | | | | | | | | | the fact that NetBSD/mips is currently broken, as per buildfarm member pika. Also add regression tests to ensure that get_float8_nan and get_float4_nan are exercised even on platforms where they are not needed by float8in/float4in. Zoltán Böszörményi and Tom Lane
* Back out unintended change to pg_locale.c.Bruce Momjian2010-02-27
|
* Document ATAPI FLUSH CACHE EXT.Bruce Momjian2010-02-27
|
* Undo some more pgindent breakage. Per buildfarm.Tom Lane2010-02-27
|
* pgindent run for 9.0Bruce Momjian2010-02-26
|
* Allow predicate_refuted_by() to deduce that NOT A refutes A.Tom Lane2010-02-25
| | | | | | | | | | | | | | | | | | | | | We had originally made the stronger assumption that NOT A refutes any B if B implies A, but this fails in three-valued logic, because we need to prove B is false not just that it's not true. However the logic does go through if B is equal to A. Recognizing this limited case is enough to handle examples that arise when we have simplified "bool_var = true" or "bool_var = false" to just "bool_var" or "NOT bool_var". If we had not done that simplification then the btree-operator proof logic would have been able to prove that the expressions were contradictory, but only for identical expressions being compared to the constants; so handling identical A and B covers all the same cases. The motivation for doing this is to avoid unexpected asymmetrical behavior when a partitioned table uses a boolean partitioning column, as in today's gripe from Dominik Sander. Back-patch to 8.2, which is as far back as predicate_refuted_by attempts to do anything at all with NOTs.
* Add C comment that do_to_timestamp() lacks error checking.Bruce Momjian2010-02-25
|
* Add configuration parameter ssl_renegotiation_limit to controlMagnus Hagander2010-02-25
| | | | | | | | how often we do SSL session key renegotiation. Can be set to 0 to disable renegotiation completely, which is required if a broken SSL library is used (broken patches to CVE-2009-3555 a known cause) or when using a client library that can't do renegotiation.
* Fix streaming replication starting at the very first WAL segment.Heikki Linnakangas2010-02-25
| | | | Per complaint from Greg Stark.
* Make pg_stop_backup's reporting a bit more verbose in hopes of makingTom Lane2010-02-25
| | | | | | error cases less intimidating for novices. Per discussion. Greg Smith
* Add an OR REPLACE option to CREATE LANGUAGE.Tom Lane2010-02-23
| | | | | | | | | | | | | | | This operates in the same way as other CREATE OR REPLACE commands, ie, it replaces everything but the ownership and ACL lists of an existing entry, and requires the caller to have owner privileges for that entry. While modifying an existing language has some use in development scenarios, in typical usage all the "replaced" values come from pg_pltemplate so there will be no actual change in the language definition. The reason for adding this is mainly to allow programs to ensure that a language exists without triggering an error if it already does exist. This commit just adds and documents the new option. A followon patch will use it to clean up some unpleasant cases in pg_dump and pg_regress.
* Revert recent change of to_char('HH12') handling for intervals; insteadBruce Momjian2010-02-23
| | | | improve documentation, and add C comment.
* Secondary patch to fix interval to_char() for "HH" where hours >= 12.Bruce Momjian2010-02-23
|
* Supress convertion of zero hours to '12' for intervals when usingBruce Momjian2010-02-23
| | | | | | | | | | | | | | to_char with HH, e.g. to_char(interval '0d 0h 12m 44s', 'DD HH24 MI SS'); now returns: 00 00 12 44 not: 00 12 12 44
* Adjust pg_fsync_writethrough so that it will set errno when failingTom Lane2010-02-22
| | | | | | | on a platform that doesn't support this operation. The former coding would allow an unrelated errno to be reported, which would be quite misleading. Not sure if this has anything to do with the current buildfarm failures, but it's certainly bogus as-is.
* Clean up handling of XactReadOnly and RecoveryInProgress checks.Tom Lane2010-02-20
| | | | | | | | | | | | | | | | | | Add some checks that seem logically necessary, in particular let's make real sure that HS slave sessions cannot create temp tables. (If they did they would think that temp tables belonging to the master's session with the same BackendId were theirs. We *must* not allow myTempNamespace to become set in a slave session.) Change setval() and nextval() so that they are only allowed on temp sequences in a read-only transaction. This seems consistent with what we allow for table modifications in read-only transactions. Since an HS slave can't have a temp sequence, this also provides a nicer cure for the setval PANIC reported by Erik Rijkers. Make the error messages more uniform, and have them mention the specific command being complained of. This seems worth the trifling amount of extra code, since people are likely to see such messages a lot more than before.
* Reduce the rescan cost estimate for Materialize nodes to cpu_operator_cost perTom Lane2010-02-19
| | | | | | | | | | | | | | | | tuple, instead of the former cpu_tuple_cost. It is sane to charge less than cpu_tuple_cost because Materialize never does any qual-checking or projection, so it's got less overhead than most plan node types. In particular, we want to have the same charge here as is charged for readout in cost_sort. That avoids the problem recently exhibited by Teodor wherein the planner prefers a useless sort over a materialize step in a context where a lot of rescanning will happen. The rescan costs should be just about the same for both node types, so make their estimates the same. Not back-patching because all of the current logic for rescan cost estimates is new in 9.0. The old handling of rescans is sufficiently not-sane that changing this in that structure is a bit pointless, and might indeed cause regressions.
* Don't use O_DIRECT when writing WAL files if archiving or streaming isHeikki Linnakangas2010-02-19
| | | | | | | | | | enabled. Bypassing the kernel cache is counter-productive in that case, because the archiver/walsender process will read from the WAL file soon after it's written, and if it's not cached the read will cause a physical read, eating I/O bandwidth available on the WAL drive. Also, walreceiver process does unaligned writes, so disable O_DIRECT in walreceiver process for that reason too.
* Forbid setval() during recovery. This prevents the PANIC reported byHeikki Linnakangas2010-02-19
| | | | Erik Rijkers. Patch by Andres Freund.
* Fix STOP WAL LOCATION in backup history files no to return the nextItagaki Takahiro2010-02-19
| | | | | | | | | | | segment of XLOG_BACKUP_END record even if the the record is placed at a segment boundary. Furthermore the previous implementation could return nonexistent segment file name when the boundary is in segments that has "FE" suffix; We never use segments with "FF" suffix. Backpatch to 8.0, where hot backup was introduced. Reported by Fujii Masao.
* Translation updates for 9.0alpha4Peter Eisentraut2010-02-19
|