aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
Commit message (Collapse)AuthorAge
...
* Remove the recently added node types ReloptElem and OptionDefElem in favorTom Lane2009-04-04
| | | | | | of adding optional namespace and action fields to DefElem. Having three node types that do essentially the same thing bloats the code and leads to errors of confusion, such as in yesterday's bug report from Khee Chin.
* Gettext plural supportPeter Eisentraut2009-03-26
| | | | | | In the backend, I changed only a handful of exemplary or important-looking instances to make use of the plural support; there is probably more work there. For the rest of the source, this should cover all relevant cases.
* Add comments about kwlookup.c expectationsAlvaro Herrera2009-03-08
|
* Separate the key word list that lived in keywords.c into a new header fileAlvaro Herrera2009-03-07
| | | | | | | kwlist.h, to avoid having to link the backend object file into other programs like pg_dump. We can now simply symlink a single source file from the backend (kwlookup.c, containing the shared routine ScanKeywordLookup) and compile it locally, which is a lot cleaner.
* Clarify to the translator that yyerror() deals with the translation ofPeter Eisentraut2009-03-04
| | | | | "syntax error", not the literal string. I was previously confused on this matter, but I have now verified that everything is translated properly.
* Add the possibility to specify an explicit validator function for foreign-dataPeter Eisentraut2009-02-24
| | | | | | wrappers (similar to procedural languages). This way we don't need to retain the nearly empty libraries, and we are more free in how to implement the wrapper API in the future.
* Change ALTER TABLE SET WITHOUT OIDS to rewrite the whole table to physicallyTom Lane2009-02-11
| | | | | | | | | | | | | | | | get rid of the OID column. This eliminates the problem discovered by Heikki back in November that 8.4's suppression of "unnecessary" junk filtering in INSERT/SELECT could lead to an Assert failure, or storing of oids into a table that shouldn't have them if Asserts are off. While that particular problem could have been solved in other ways, it seems likely to be just a forerunner of things to come if we continue to allow tables to contain rows that disagree with the pg_class.relhasoids setting. It's better to make this operation slow than to sacrifice performance or risk bugs in more common code paths. Also, add ALTER TABLE SET WITH OIDS to rewrite the table to add oids. This was a bit more controversial, but in view of the very small amount of extra code needed given the current ALTER TABLE infrastructure, it seems best to eliminate the asymmetry in features.
* Allow reloption names to have qualifiers, initially supporting a TOASTAlvaro Herrera2009-02-02
| | | | | | | | qualifier, and add support for this in pg_dump. This allows TOAST tables to have user-defined fillfactor, and will also enable us to move the autovacuum parameters to reloptions without taking away the possibility of setting values for TOAST tables.
* Support column-level privileges, as required by SQL standard.Tom Lane2009-01-22
| | | | Stephen Frost, with help from KaiGai Kohei and others
* Add vacuum_freeze_table_age GUC option, to control when VACUUM shouldHeikki Linnakangas2009-01-16
| | | | | ignore the visibility map and scan the whole table, to advance relfrozenxid.
* Use qualified_name instead of relation_expr for commands that have noPeter Eisentraut2009-01-12
| | | | | | | | business with inheritance recursion: ALTER INDEX, ALTER SEQUENCE, ALTER TRIGGER, ALTER VIEW. They would just silently ignore the ONLY. ALTER TABLE has mixed behavior and cannot be dealt with this way because of the resulting shift/reduce conflicts.
* Add ONLY support to LOCK and TRUNCATE. By default, these commands are nowPeter Eisentraut2009-01-12
| | | | | | recursive. => Note this incompatibility in the release notes.
* Defend against null input in analyze_requires_snapshot(), per reportTom Lane2009-01-08
| | | | from Rushabh Lathia.
* Add comment about why BETWEEN uses operator strings and not opclasses,Bruce Momjian2009-01-07
| | | | with URL pointing to email discussion.
* Update copyright for 2009.Bruce Momjian2009-01-01
|
* Throw error if a <window definition> references a window that already has aTom Lane2008-12-31
| | | | | frame clause, as appears to be required by the fine print in the SQL spec. Per discussion with Pavel, not doing so risks user confusion.
* Add a WINDOW attribute to CREATE FUNCTION, and teach pg_dump about it,Tom Lane2008-12-31
| | | | | | | | | | | so that user-defined window functions are possible. For the moment you'll have to write them in C, for lack of any interface to the WindowObject API in the available PLs, but it's better than no support at all. There was some debate about the best syntax for this. I ended up choosing the "it's an attribute" position --- the other approach will inevitably be more work, and the likely market for user-defined window functions is probably too small to justify it.
* Add some basic support for window frame clauses to the window-functionsTom Lane2008-12-31
| | | | | | | | patch. This includes the ability to force the frame to cover the whole partition, and the ability to make the frame end exactly on the current row rather than its last ORDER BY peer. Supporting any more of the full SQL frame-clause syntax will require nontrivial hacking on the window aggregate code, so it'll have to wait for 8.5 or beyond.
* Support window functions a la SQL:2008.Tom Lane2008-12-28
| | | | Hitoshi Harada, with some kibitzing from Heikki and Tom.
* Add missing semicolon, per buildfarm results. Martin PihlakTom Lane2008-12-20
|
* SQL/MED catalog manipulation facilitiesPeter Eisentraut2008-12-19
| | | | | | | | This doesn't do any remote or external things yet, but it gives modules like plproxy and dblink a standardized and future-proof system for managing their connection information. Martin Pihlak and Peter Eisentraut
* Code review for function default parameters patch. Fix numerous problems asTom Lane2008-12-18
| | | | | per recent discussions. In passing this also fixes a couple of bugs in the previous variadic-parameters patch.
* Don't reset pg_class.reltuples and relpages in VACUUM, if any pages wereHeikki Linnakangas2008-12-17
| | | | | | | | | | | | | | | | | skipped. We could update relpages anyway, but it seems better to only update it together with reltuples, because we use the reltuples/relpages ratio in the planner. Also don't update n_live_tuples in pgstat. ANALYZE in VACUUM ANALYZE now needs to update pg_class, if the VACUUM-phase didn't do so. Added some boolean-passing to let analyze_rel know if it should update pg_class or not. I also moved the relcache invalidation (to update rd_targblock) from vac_update_relstats to where RelationTruncate is called, because vac_update_relstats is not called for partial vacuums anymore. It's more obvious to send the invalidation close to the truncation that requires it. Per report by Ned T. Crigler.
* Restore enforce_generic_type_consistency's pre-8.3 behavior of allowing anTom Lane2008-12-14
| | | | | | | actual argument type of ANYARRAY to match an argument declared ANYARRAY, so long as ANYELEMENT etc aren't used. I had overlooked the fact that this is a possible case while fixing bug #3852; but it is possible because pg_statistic contains columns declared ANYARRAY. Per gripe from Corey Horton.
* Fix failure to ensure that a snapshot is available to datatype input functionsTom Lane2008-12-13
| | | | | | | | | | | | | | | | | | | when they are invoked by the parser. We had been setting up a snapshot at plan time but really it needs to be done earlier, before parse analysis. Per report from Dmitry Koterov. Also fix two related problems discovered while poking at this one: exec_bind_message called datatype input functions without establishing a snapshot, and SET CONSTRAINTS IMMEDIATE could call trigger functions without establishing a snapshot. Backpatch to 8.2. The underlying problem goes much further back, but it is masked in 8.1 and before because we didn't attempt to invoke domain check constraints within datatype input. It would only be exposed if a C-language datatype input function used the snapshot; which evidently none do, or we'd have heard complaints sooner. Since this code has changed a lot over time, a back-patch is hardly risk-free, and so I'm disinclined to patch further than absolutely necessary.
* Allow CREATE OR REPLACE VIEW to add columns to the _end_ of the view.Bruce Momjian2008-12-06
| | | | Robert Haas
* Default values for function argumentsPeter Eisentraut2008-12-04
| | | | Pavel Stehule, with some tweaks by Peter Eisentraut
* Utilize the visibility map in autovacuum, too. There was an oversight inHeikki Linnakangas2008-12-04
| | | | | | | | | the visibility map patch that because autovacuum always sets VacuumStmt->freeze_min_age, visibility map was never used for autovacuum, only for manually launched vacuums. This patch introduces a new scan_all field to VacuumStmt, indicating explicitly whether the visibility map should be used, or the whole relation should be scanned, to advance relfrozenxid. Anti-wraparound vacuums still need to scan all pages.
* Add %expect 0 to all parser input files to prevent conflicts slipping by.Peter Eisentraut2008-11-26
|
* CLUSTER VERBOSE and corresponding clusterdb --verbose optionPeter Eisentraut2008-11-24
| | | | Jim Cox and Peter Eisentraut
* Use relation_expr for TABLE command, requested by Tom.Peter Eisentraut2008-11-21
|
* TABLE commandPeter Eisentraut2008-11-20
|
* Make SELECT FOR UPDATE/SHARE work on inheritance trees, by having the planTom Lane2008-11-15
| | | | | | | | | return the tableoid as well as the ctid for any FOR UPDATE targets that have child tables. All child tables are listed in the ExecRowMark list, but the executor just skips the ones that didn't produce the current row. Curiously, this longstanding restriction doesn't seem to have been documented anywhere; so no doc changes.
* Removed two non-terminals:Michael Meskes2008-11-13
| | | | | - FloatOnly: only used by NumericOnly, instead put the FloatOnly production into NumericOnly - IntegerOnly: only used by NumericOnly and one ALTER TABLE rule, replacement SignedIconst is already used in several other places
* Do not use ICONST/SCONST in rules other than Iconst/Sconst.Michael Meskes2008-11-12
|
* Implement ALTER DATABASE SET TABLESPACE to move a whole database (or at leastTom Lane2008-11-07
| | | | | | as much of it as lives in its default tablespace) to a new tablespace. Guillaume Lelarge, with some help from Bernd Helmle and Tom Lane
* Added missing ';'Michael Meskes2008-10-31
|
* Add support for user-defined I/O conversion casts.Heikki Linnakangas2008-10-31
|
* Since SQL:2003, the array size specification in the SQL ARRAY syntax hasPeter Eisentraut2008-10-29
| | | | been optional.
* Unicode escapes in strings and identifiersPeter Eisentraut2008-10-29
|
* Add WITH [NO] DATA clause to CREATE TABLE AS, per SQL.Peter Eisentraut2008-10-28
| | | | | | | Also, since WITH is now a reserved word, simplify the token merging code to only deal with WITH_TIME. by Tom Lane and myself
* SQL:2008 syntax CURRENT_CATALOG, CURRENT_SCHEMA, SET CATALOG, SET SCHEMA.Peter Eisentraut2008-10-27
|
* Allow EXPLAIN on CREATE TABLE AS.Peter Eisentraut2008-10-27
|
* Better solution to the IN-list issue: instead of having an arbitrary cutoff,Tom Lane2008-10-26
| | | | | | | treat Var and non-Var IN-list items differently. Only non-Var items are candidates to go into an ANY(ARRAY) construct --- we put all Vars as separate OR conditions on the grounds that that leaves more scope for optimization. Per suggestion from Robert Haas.
* Add a heuristic to transformAExprIn() to make it prefer expanding "x IN (list)"Tom Lane2008-10-25
| | | | | | | | | | | | | into an OR of equality comparisons, rather than x = ANY(ARRAY[...]), when there are Vars in the right-hand side. This avoids a performance regression compared to pre-8.2 releases, in cases where the OR form can be optimized into scans of multiple indexes. Limit the possible downside by preferring this form only when the list isn't very long (I set the cutoff at 32 elements, which is a bit arbitrary but in the right ballpark). Per discussion with Jim Nasby. In passing, also make it try the OR form if it cannot select a common type for the array elements; we've seen a complaint or two about how the OR form worked for such cases and ARRAY doesn't.
* SQL:2008 alternative syntax for LIMIT/OFFSET:Peter Eisentraut2008-10-22
| | | | OFFSET num {ROW|ROWS} FETCH {FIRST|NEXT} [num] {ROW|ROWS} ONLY
* Allow SQL:2008 syntax ALTER TABLE ... ALTER COLUMN ... SET DATA TYPEPeter Eisentraut2008-10-21
| | | | alongside our traditional syntax.
* SQL 200N -> SQL:2003Peter Eisentraut2008-10-20
|
* Implement comparison of generic records (composite types), and invent aTom Lane2008-10-13
| | | | | | | | | | | | | pseudo-type record[] to represent arrays of possibly-anonymous composite types. Since composite datums carry their own type identification, no extra knowledge is needed at the array level. The main reason for doing this right now is that it is necessary to support the general case of detection of cycles in recursive queries: if you need to compare more than one column to detect a cycle, you need to compare a ROW() to an array built from ROW()s, at least if you want to do it as the spec suggests. Add some documentation and regression tests concerning the cycle detection issue.
* Modify the parser's error reporting to include a specific hint for the caseTom Lane2008-10-08
| | | | | | | of referencing a WITH item that's not yet in scope according to the SQL spec's semantics. This seems to be an easy error to make, and the bare "relation doesn't exist" message doesn't lead one's mind in the correct direction to fix it.