aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Modify pgrminclude -v to report include files that can't be compiled onBruce Momjian2011-08-28
| | | | | | | | | their own. Avoid compile problems with defines being redefined after the removal of the #if blocks. Change script to use shell functions for simplicity.
* Don't assume that "E" response to NEGOTIATE_SSL_CODE means pre-7.0 server.Tom Lane2011-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | These days, such a response is far more likely to signify a server-side problem, such as fork failure. Reporting "server does not support SSL" (in sslmode=require) could be quite misleading. But the results could be even worse in sslmode=prefer: if the problem was transient and the next connection attempt succeeds, we'll have silently fallen back to protocol version 2.0, possibly disabling features the user needs. Hence, it seems best to just eliminate the assumption that backing off to non-SSL/2.0 protocol is the way to recover from an "E" response, and instead treat the server error the same as we would in non-SSL cases. I tested this change against a pre-7.0 server, and found that there was a second logic bug in the "prefer" path: the test to decide whether to make a fallback connection attempt assumed that we must have opened conn->ssl, which in fact does not happen given an "E" response. After fixing that, the code does indeed connect successfully to pre-7.0, as long as you didn't set sslmode=require. (If you did, you get "Unsupported frontend protocol", which isn't completely off base given the server certainly doesn't support SSL.) Since there seems no reason to believe that pre-7.0 servers exist anymore in the wild, back-patch to all supported branches.
* Ensure we discard unread/unsent data when abandoning a connection attempt.Tom Lane2011-08-27
| | | | | | | | | | | | | | | | | There are assorted situations wherein PQconnectPoll() will abandon a connection attempt and try again with different parameters (eg, SSL versus not SSL). However, the code forgot to discard any pending data in libpq's I/O buffers when doing this. In at least one case (server returns E message during SSL negotiation), there is unread input data which bollixes the next connection attempt. I have not checked to see whether this is possible in the other cases where we close the socket and retry, but it seems like a matter of good defensive programming to add explicit buffer-flushing code to all of them. This is one of several issues exposed by Daniel Farina's report of misbehavior after a server-side fork failure. This has been wrong since forever, so back-patch to all supported branches.
* Allow more include files to be compiled in their own by adding missingBruce Momjian2011-08-27
| | | | | | include dependencies. Modify pgcompinclude to skip a common fcinfo error.
* Add support for #elif to pgrminclude.Bruce Momjian2011-08-27
|
* Implement the information schema with_hierarchy columnPeter Eisentraut2011-08-27
| | | | | In PostgreSQL, this is included in the SELECT privilege, so show YES or NO depending on whether SELECT is granted.
* Add another pgdefine path check, and a cvs-git change.Bruce Momjian2011-08-26
|
* Change references of CVS to .git.Bruce Momjian2011-08-26
|
* Fix missing pgdefine detection in pgrminclude.Bruce Momjian2011-08-26
|
* Modify pgrminclude to include all code, even in #if blocks. ProcessBruce Momjian2011-08-26
| | | | | | .h include files before .c files. Mark some includes as needed to be ignored by pgrminclude.
* Cleanup of script.Bruce Momjian2011-08-26
|
* Add missing includes after pgrminclude run.Bruce Momjian2011-08-26
|
* do include files firstBruce Momjian2011-08-26
|
* Add markers.Bruce Momjian2011-08-26
|
* Add another marker.Bruce Momjian2011-08-26
|
* Add markers for skips.Bruce Momjian2011-08-26
|
* Fix #if blocks.Bruce Momjian2011-08-26
|
* Fix potential memory clobber in tsvector_concat().Tom Lane2011-08-26
| | | | | | | | | | | | | | | tsvector_concat() allocated its result workspace using the "conservative" estimate of the sum of the two input tsvectors' sizes. Unfortunately that wasn't so conservative as all that, because it supposed that the number of pad bytes required could not grow. Which it can, as per test case from Jesper Krogh, if there's a mix of lexemes with positions and lexemes without them in the input data. The fix is to assume that we might add a not-previously-present pad byte for each and every lexeme in the two inputs; which really is conservative, but it doesn't seem worthwhile to try to be more precise. This is an aboriginal bug in tsvector_concat, so back-patch to all versions containing it.
* Improve comments describing tsvector data structure.Tom Lane2011-08-26
|
* Clean up weird corner cases in lexing of psql meta-command arguments.Tom Lane2011-08-26
| | | | | | | | | | | | | | These changes allow backtick command evaluation and psql variable interpolation to happen on substrings of a single meta-command argument. Formerly, no such evaluations happened at all if the backtick or colon wasn't the first character of the argument, and we considered an argument completed as soon as we'd processed one backtick, variable reference, or quoted substring. A string like 'FOO'BAR was thus taken as two arguments not one, not exactly what one would expect. In the new coding, an argument is considered terminated only by unquoted whitespace or backslash. Also, clean up a bunch of omissions, infelicities and outright errors in the psql documentation of variables and metacommand argument syntax.
* Support non-ASCII letters in psql variable names.Tom Lane2011-08-26
| | | | | As in the backend, the implementation actually accepts any non-ASCII character, but we only document that you can use letters.
* Fix pgrminclude regex pattern.Bruce Momjian2011-08-26
|
* Unbreak MSVC build broken by my port of flex check.Andrew Dunstan2011-08-26
| | | | | flex puts lex.backup in the current working directory regardless of where the input and output are.
* In pgrminclude, add code to skip includes with a marker comment.Bruce Momjian2011-08-26
|
* In pgrminclude, make skipped include names constent and skip files withBruce Momjian2011-08-26
| | | | #if/#ifdefs.
* Port backup check on psql lexer to MSVC.Andrew Dunstan2011-08-25
|
* Add expected isolationtester output when prepared xacts are disabledAlvaro Herrera2011-08-25
| | | | | | | | This was deemed unnecessary initially but in later discussion it was agreed otherwise. Original file from Kevin Grittner, allegedly from Dan Ports. I had to clean up whitespace a bit per changes from Heikki.
* Add makefile rules to check for backtracking in backend and psql lexers.Tom Lane2011-08-25
| | | | | Per discussion, we should enforce the policy of "no backtracking" in these performance-sensitive scanners.
* Fix psql lexer to avoid use of backtracking.Tom Lane2011-08-25
| | | | | | | | | | Per previous experimentation, backtracking slows down lexing performance significantly (by about a third). It's usually pretty easy to avoid, just need to have rules that accept an incomplete construct and do whatever the lexer would have done otherwise. The backtracking was introduced by the patch that added quoted variable substitution. Back-patch to 9.0 where that was added.
* Add "%option warn" to all flex input files that lacked it.Tom Lane2011-08-25
| | | | | This is recommended in the flex manual, and there seems no good reason not to use it everywhere.
* Change format of SQL/MED generic options in psql backslash commands.Robert Haas2011-08-25
| | | | | | | | Rather than dumping out the raw array as PostgreSQL represents it internally, we now print it out in a format similar to the one in which the user input it, which seems a lot more user friendly. Shigeru Hanada
* Properly quote SQL/MED generic options in pg_dump output.Robert Haas2011-08-25
| | | | Shigeru Hanada
* Tweak postgresql.conf.sample's comments on listen_addresess.Robert Haas2011-08-25
| | | | | | | This makes it slightly more clear that '*' is not part of the default value, in case that wasn't obvious. As requested by Dougal Sutherland.
* Update FK alternative test output to new whitespace rulesAlvaro Herrera2011-08-24
| | | | | | | With these changes, the isolation tests pass again on isolation levels serializable and repeatable read. Author: Kevin Grittner
* Fix pgxs.mk to always add --dbname=$(CONTRIB_TESTDB) to REGRESS_OPTS.Tom Lane2011-08-24
| | | | | | | | | | | | | | The previous coding resulted in contrib modules unintentionally overriding the use of CONTRIB_TESTDB. There seems no particularly good reason to allow that (after all, the makefile can set CONTRIB_TESTDB if that's really what it intends). In passing, document REGRESS_OPTS where the other pgxs.mk options are documented. Back-patch to 9.1 --- in prior versions, there were no cases of contrib modules setting REGRESS_OPTS without including the --dbname switch, so while the coding was fragile there was no actual bug.
* Fix multiple bugs in extension dropping.Tom Lane2011-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | When we implemented extensions, we made findDependentObjects() treat EXTENSION dependency links similarly to INTERNAL links. However, that logic contained an implicit assumption that an object could have at most one INTERNAL dependency, so it did not work correctly for objects having both INTERNAL and DEPENDENCY links. This led to failure to drop some extension member objects when dropping the extension. Furthermore, we'd never actually exercised the case of recursing to an internally-referenced (owning) object from anything other than a NORMAL dependency, and it turns out that passing the incoming dependency's flags to the owning object is the Wrong Thing. This led to sometimes dropping a whole extension silently when we should have rejected the drop command for lack of CASCADE. Since we obviously were under-testing extension drop scenarios, add some regression test cases. Unfortunately, such test cases require some extensions (duh), so we can't test for problems in the core regression tests. I chose to add them to the earthdistance contrib module, which is a good test case because it has a dependency on the cube contrib module. Back-patch to 9.1. Arguably these are pre-existing bugs in INTERNAL dependency handling, but since it appears that the cases can never arise pre-9.1, I'll refrain from back-patching the logic changes further than that.
* Make CREATE EXTENSION check schema creation permissions.Tom Lane2011-08-23
| | | | | | | | | | | | When creating a new schema for a non-relocatable extension, we neglected to check whether the calling user has permission to create schemas. That didn't matter in the original coding, since we had already checked superuserness, but in the new dispensation where users need not be superusers, we should check it. Use CreateSchemaCommand() rather than calling NamespaceCreate() directly, so that we also enforce the rules about reserved schema names. Per complaint from KaiGai Kohei, though this isn't the same as his patch.
* Fix overoptimistic assumptions in column width estimation for subqueries.Tom Lane2011-08-23
| | | | | | | | | | | | | | | | | | | | | | | set_append_rel_pathlist supposed that, while computing per-column width estimates for the appendrel, it could ignore child rels for which the translated reltargetlist entry wasn't a Var. This gave rise to completely silly estimates in some common cases, such as constant outputs from some or all of the arms of a UNION ALL. Instead, fall back on get_typavgwidth to estimate from the value's datatype; which might be a poor estimate but at least it's not completely wacko. That problem was exposed by an Assert in set_subquery_size_estimates, which unfortunately was still overoptimistic even with that fix, since we don't compute attr_widths estimates for appendrels that are entirely excluded by constraints. So remove the Assert; we'll just fall back on get_typavgwidth in such cases. Also, since set_subquery_size_estimates calls set_baserel_size_estimates which calls set_rel_width, there's no need for set_subquery_size_estimates to call get_typavgwidth; set_rel_width will handle it for us if we just leave the estimate set to zero. Remove the unnecessary code. Per report from Erik Rijkers and subsequent investigation.
* Use consistent format for reporting GetLastError()Peter Eisentraut2011-08-23
| | | | | | Use something like "error code %lu" for reporting GetLastError() values on Windows. Previously, a mix of different wordings and formats were in use.
* Add missing include so include file compiles cleanly on its own.Bruce Momjian2011-08-22
|
* Mark cpluspluscheck as excutable in git.Bruce Momjian2011-08-22
|
* Typo fix.Robert Haas2011-08-22
|
* Fix handling of extension membership when filling in a shell operator.Tom Lane2011-08-22
| | | | | | | | | | | | The previous coding would result in deleting and not re-creating the extension membership pg_depend rows, since there was no CommandCounterIncrement that would allow recordDependencyOnCurrentExtension to see that the deletion had happened. Make it work like the shell type case, ie, keep the existing entries (and then throw an error if they're for the wrong extension). Per bug #6172 from Hitoshi Harada. Investigation and fix by Dimitri Fontaine.
* Properly call strerror() in thread test; add comments.Bruce Momjian2011-08-22
|
* Simplify errno generating in thread testing program.Bruce Momjian2011-08-21
|
* Fix trigger WHEN conditions when both BEFORE and AFTER triggers exist.Tom Lane2011-08-21
| | | | | | | | | Due to tuple-slot mismanagement, evaluation of WHEN conditions for AFTER ROW UPDATE triggers could crash if there had been a BEFORE ROW trigger fired for the same update. Fix by not trying to overload the use of estate->es_trig_tuple_slot. Per report from Yoran Heling. Back-patch to 9.0, when trigger WHEN conditions were introduced.
* Have thread_test create its test files in the current directory, ratherBruce Momjian2011-08-20
| | | | | | than /tmp. Also cleanup C defines and add comments. Per report by Alex Soto
* Fix performance problem when building a lossy tidbitmap.Tom Lane2011-08-20
| | | | | | | | | | | As pointed out by Sergey Koposov, repeated invocations of tbm_lossify can make building a large tidbitmap into an O(N^2) operation. To fix, make sure we remove more than the minimum amount of information per call, and add a fallback path to behave sanely if we're unable to fit the bitmap within the requested amount of memory. This has been wrong since the tidbitmap code was written, so back-patch to all supported branches.
* Fix copyright.pl to properly us 'tie' function.Bruce Momjian2011-08-19
| | | | Kris Jurka
* Fix problem with regex in copyright test.Bruce Momjian2011-08-19
| | | | Report and fix by Kris Jurka