summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2009-07-14Remove duplicate definition of TYPECAST token.Tom Lane
(Apparently, some but not all versions of Bison will warn about this.)
2009-07-14Tweak the core scanner so that it can be used by plpgsql too.Tom Lane
Changes: Pass in the keyword lookup array instead of having it be hardwired. (This incidentally allows elimination of some duplicate coding in ecpg.) Re-order the token declarations in gram.y so that non-keyword tokens have numbers that won't change when keywords are added or removed. Add ".." and ":=" to the set of tokens recognized by scan.l. (Since these combinations are nowhere legal in core SQL, this does not change anything except the precise wording of the error you get when you write this.)
2009-07-14Do a conditional SPI_push/SPI_pop when replanning a query inTom Lane
RevalidateCachedPlan. This is to avoid a "SPI_ERROR_CONNECT" failure when the planner calls a SPI-using function and we are already inside one. The alternative fix is to expect callers of RevalidateCachedPlan to do this, which seems likely to result in additional hard-to-detect bugs of omission. Per reports from Frank van Vugt and Marek Lewczuk. Back-patch to 8.3. It's much harder to trigger the bug in 8.3, due to a smaller set of cases in which plans can be invalidated, but it could happen. (I think perhaps only a SI reset event could make 8.3 fail here, but that's certainly within the realm of possibility.)
2009-07-13Update information schema to SQL:2008Peter Eisentraut
- yes_or_no domain for "boolean" data - new columns for VIEWS view - slight section renumbering
2009-07-13Although the flex documentation avers that yyalloc and yyrealloc takeTom Lane
size_t arguments, the emitted scanner actually prototypes them with type yy_size_t, which is sometimes not the same thing depending on flex version and platform. Easiest fix seems to be to use yy_size_t. Per buildfarm results.
2009-07-13Convert the core lexer and parser into fully reentrant code, by making useTom Lane
of features added to flex and bison since this code was originally written. This change doesn't in itself offer any new capability, but it's needed infrastructure for planned improvements in plpgsql. Another feature now available in flex is the ability to make it use palloc instead of malloc, so do that to avoid possible memory leaks. (We should at some point change the other lexers likewise, but this commit doesn't touch them.)
2009-07-13Stamp minor library version numbers for 8.5; sorry for the delay.Bruce Momjian
2009-07-13Fix up PGDLLIMPORT marking for standard_conforming_strings. Moving itTom Lane
into a header file that plpgsql's scan.l can see broke the previous kluge. Per buildfarm results.
2009-07-12Move some declarations in the raw-parser header files to create a clearerTom Lane
distinction between the external API (parser.h) and declarations that only need to be visible within the raw parser code (gramparse.h, which now is only included by parser.c, gram.y, scan.l, and keywords.c). This is in preparation for the upcoming change to a reentrant lexer, which will require referencing YYSTYPE in the declarations of base_yylex and filtered_base_yylex, hence gram.h will have to be included by gramparse.h. We don't want any more files than absolutely necessary to depend on gram.h, so some cleanup is called for.
2009-07-11Alter some gratuitous uses of "ANSI" when "SQL standard" might have beenPeter Eisentraut
meant or the reference to a standard was unnecessary.
2009-07-11Fix set_rel_width() to do something reasonable with non-Var items in aTom Lane
RelOptInfo targetlist. It used to be that the only possibility other than a Var was a RowExpr representing a whole-row child Var, but as of 8.4's expanded ability to flatten appendrel members, we can get arbitrary expressions in there. Use the expression's type info and get_typavgwidth() to produce an at-least-marginally-sane result. Note that get_typavgwidth()'s fallback estimate (32 bytes) is the same as what was here before, so there will be no behavioral change for RowExprs. Noted while looking at recent gripe about constant quals pushed down to FunctionScan appendrel members ... not only were we failing to recognize the constant qual, we were getting the width estimate wrong :-(
2009-07-08Remove no-longer-necessary transmission of postmaster's LC_COLLATE andTom Lane
LC_CTYPE settings to children via BackendParameters. Per discussion, the postmaster is now just using system defaults anyway, so we might as well save a few cycles during backend startup.
2009-07-08Need to use pg_perm_setlocale when setting LC_CTYPE and LC_COLLATE at startup.Heikki Linnakangas
Otherwise, the LC_CTYPE/COLLATE setting gets reverted when using plperl, which leads to incorrect query results and index corruption. This was accidentally broken in the per-database locale patch in 8.4. Pointed out by Andrew Gierth.
2009-07-08When calling unsupported "make check" with a pgxs module, return a nonzeroPeter Eisentraut
exit code.
2009-07-07Just a little more schema-qualification ...Tom Lane
2009-07-07psql backward compatibility fixPeter Eisentraut
For servers older than 8.3, sort display of child tables by relname instead of oid::regclass::text, because the cast from regclass to text did not work back then. The older display may be slightly worse when different schemas are involved, but that should be rare enough.
2009-07-07Don't use 'return' where you should use 'PG_RETURN_xxx'.Tom Lane
2009-07-07Query in SQL function still not schema-safe; add a coupleTom Lane
more pg_catalog. qualifications.
2009-07-07Sort child tables by name instead of OID in \d+ displayPeter Eisentraut
This was an oversight in the recent patch. Found by Tom Lane.
2009-07-07Fix typo in comment.Tom Lane
2009-07-07More sensible character_octet_lengthPeter Eisentraut
For character types with typmod, character_octet_length columns in the information schema now show the maximum character length times the maximum length of a character in the server encoding, instead of some huge value as before.
2009-07-07Code review for patch to show definition of index columns in \d on index.Tom Lane
Safely schema-qualify the pg_get_indexdef call, make the query a bit prettier in -E mode, remove useless join to pg_index, make it more obvious that the header[] array is not overrun.
2009-07-06Use floor() not rint() when reducing precision of fractional seconds inTom Lane
timestamp_trunc, timestamptz_trunc, and interval_trunc(). This change only affects the float-datetime case; the integer-datetime case already behaved like truncation instead of rounding. Per gripe from Mario Splivalo. This is a pre-existing issue but I'm choosing not to backpatch, because it's such a corner case and there have not been prior complaints. The issue is largely moot anyway given the trend towards integer datetimes.
2009-07-06Fix ancient bug in handling of to_char modifier 'TH', when used with HH.Heikki Linnakangas
In what seems like an oversight, we used to treat 'TH' the same as lowercase 'th', but only with HH/HH12.
2009-07-06Fix set_append_rel_pathlist() to deal intelligently with cases whereTom Lane
substituting a child rel's output expressions into the appendrel's restriction clauses yields a pseudoconstant restriction. We might be able to skip scanning that child rel entirely (if we get constant FALSE), or generate a one-time filter. 8.3 more or less accidentally generated plans that weren't completely stupid in these cases, but that was only because an extra recursive level of subquery_planner() always occurred and allowed const-simplification to happen. 8.4's ability to pull up appendrel members with non-Var outputs exposes the fact that we need to work harder here. Per gripe from Sergey Burladyan.
2009-07-06Show definition of index columns in \d on indexPeter Eisentraut
This adds a column called "Definition" to the output of psql \d on an index, which shows the full expression behind the index column. For indexes on plain columns, this is redundant, but for expression indexes, this reveals the real expression. Author: Khee Chin <kheechin@gmail.com>
2009-07-06Per SQL spec (in particular, the grammar in SQL:2008 7.13) we should allowTom Lane
parentheses around the <query expression body> that follows a WITH clause, eg with cte(foo) as ( values(0) ) ((select foo from cte)); This seems to be just an oversight/thinko in gram.y. Noted while experimenting with bug #4902.
2009-07-06Fix handling of changed-Param signaling for CteScan plan nodes. We were usingTom Lane
the "cteParam" as a proxy for the possibility that the underlying CTE plan depends on outer-level variables or Params, but that doesn't work very well because it sometimes causes calling subqueries to be treated as SubPlans when they could be InitPlans. This is inefficient and also causes the outright failure exhibited in bug #4902. Instead, leave the cteParam out of it and copy the underlying CTE plan's extParams directly. Per bug #4902 from Marko Tiikkaja.
2009-07-03Add log_line_prefix placeholder %e to contain the current SQL statePeter Eisentraut
Author: Guillaume Smet <guillaume.smet@gmail.com>
2009-07-03Have \d show child tables that inherit from the specified parentPeter Eisentraut
As per discussion, \d shows only the number of child tables, because that could be hundreds, when used for partitioning. \d+ shows the actual list. Author: Damien Clochard <damien@dalibo.info>
2009-07-02Fix up pg_dump's --binary-upgrade option so that it behaves properly withTom Lane
inherited columns and check constraints. Per my recent trouble report.
2009-07-02Upgrade to Autoconf 2.63Peter Eisentraut
This upgrades the configure infrastructure to the latest Autoconf version. Some notable news are: - The workaround for the broken fseeko() test is gone. - Checking for unknown options is now provided by Autoconf itself. - Fixes for Mac OS X
2009-07-02Regression test for XML mapping functionalityPeter Eisentraut
I wrote this one while chasing down some bugs in the closing days of 8.4. It could be useful in the long run. This area of the code had no test coverage at all before.
2009-07-01Stamp HEAD as 8.5devel.Tom Lane
2009-06-30Add missed src/include/foreign subdirectory to the set installed intoTom Lane
INSTALLDIR/include/server/. Itagaki Takahiro
2009-06-27Bundle v8.4.0Marc G. Fournier
2009-06-26Cleanup and code review for the patch that made bgwriter active duringTom Lane
archive recovery. Invent a separate state variable and inquiry function for XLogInsertAllowed() to clarify some tests and make the management of writing the end-of-recovery checkpoint less klugy. Fix several places that were incorrectly testing InRecovery when they should be looking at RecoveryInProgress or XLogInsertAllowed (because they will now be executed in the bgwriter not startup process). Clarify handling of bad LSNs passed to XLogFlush during recovery. Use a spinlock for setting/testing SharedRecoveryInProgress. Improve quite a lot of comments. Heikki and Tom
2009-06-26Translation updates for 8.4 release.Peter Eisentraut
File that are translated less than 80% have been removed, as per new translation team policy.
2009-06-25Add __attribute__((format_arg(1))) to the declaration of err_gettext(),Tom Lane
to restore gcc's ability to crosscheck format arguments within elog.c. Noted in a test compilation with -Wformat-nonliteral enabled.
2009-06-25Fix some serious bugs in archive recovery, now that bgwriter is activeHeikki Linnakangas
during it: When bgwriter is active, the startup process can't perform mdsync() correctly because it won't see the fsync requests accumulated in bgwriter's private pendingOpsTable. Therefore make bgwriter responsible for the end-of-recovery checkpoint as well, when it's active. When bgwriter is active (= archive recovery), the startup process must not accumulate fsync requests to its own pendingOpsTable, since bgwriter won't see them there when it performs restartpoints. Make startup process drop its pendingOpsTable when bgwriter is launched to avoid that. Update minimum recovery point one last time when leaving archive recovery. It won't be updated by the end-of-recovery checkpoint because XLogFlush() sees us as out of recovery already. This fixes bug #4879 reported by Fujii Masao.
2009-06-25The code to unlink dropped relations in FinishPreparedTransaction() wasHeikki Linnakangas
acting like runs inside WAL recovery, but it doesn't. I must've copy-pasted this from a redo-function in the relation forks patch. Noticed by Tom Lane while he was looking through callers of smgrdounlink().
2009-06-25Disallow empty passwords in LDAP authentication, the same wayMagnus Hagander
we already do it for PAM.
2009-06-24Correct grammar in picksplit debug messagesPeter Eisentraut
2009-06-24parse_ident_usermap() shuold use ereport(LOG) and not ERROR, and put theMagnus Hagander
return value in the *error_p variable. Noted by Tom.
2009-06-23Properly initialize SSL engines when used from libpq. This is required forMagnus Hagander
most external engines. Per report and initial code from Lars Kanis
2009-06-23Fix an ancient error in dist_ps (distance from point to line segment), whichTom Lane
a number of other geometric operators also depend on. It miscalculated the slope of the perpendicular to the given line segment anytime that slope was other than 0, infinite, or +/-1. In some cases the error would be masked because the true closest point on the line segment was one of its endpoints rather than the intersection point, but in other cases it could give an arbitrarily bad answer. Per bug #4872 from Nick Roosevelt. Bug goes clear back to Berkeley days, so patch all supported branches. Make a couple of cosmetic adjustments while at it.
2009-06-23Fix the makefiles to fail cleanly if Perl is needed but not present. ThisTom Lane
used to work as intended, but got broken some time ago (a quoted empty string is not an empty string), and got broken some more by the changes to generate ecpg's preproc.y automatically. Given all the unprotected uses of $(PERL) elsewhere, it seems best to make use of the $(missing) script rather than trying to ensure each such use is protected individually. Also fix various bits of documentation that omitted to mention Perl as a requirement for building from a CVS pull. Per a complaint from Robert Haas.
2009-06-22bundle RC2REL8_4_RC2Marc G. Fournier
2009-06-22For bulk write operations (eg COPY IN), use a ring buffer of 16MB insteadTom Lane
of the 256KB limit originally enforced by a patch committed 2008-11-06. Per recent test results, the smaller size resulted in an undesirable decrease in bulk data loading speed, due to COPY processing frequently getting blocked for WAL flushing. This area might need more tweaking later, but this setting seems to be good enough for 8.4.
2009-06-22Make to_timestamp and friends skip leading spaces before an integer field,Tom Lane
even when not in FM mode. This improves compatibility with Oracle and with our pre-8.4 behavior, as per bug #4862. Brendan Jurd Add a couple of regression test cases for this. In passing, get rid of the labeling of the individual test cases; doesn't seem to be good for anything except causing extra work when inserting a test... Tom Lane