aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
Commit message (Collapse)AuthorAge
...
* Remove add_missing_from GUC and associated parser support for "implicit RTEs".Tom Lane2009-10-21
| | | | | | Per recent discussion, add_missing_from has been deprecated for long enough to consider removing, and it's getting in the way of planned parser refactoring. The system now always behaves as though add_missing_from were OFF.
* Support SQL-compliant triggers on columns, ie fire only if certain columnsTom Lane2009-10-14
| | | | | | | | | | | are named in the UPDATE's SET list. Note: the schema of pg_trigger has not actually changed; we've just started to use a column that was there all along. catversion bumped anyway so that this commit is included in the history of potentially interesting changes to system catalog contents. Itagaki Takahiro
* Code review for LIKE INCLUDING patch --- clean up some cosmetic and notTom Lane2009-10-13
| | | | so cosmetic stuff.
* Use plurals (TABLES, FUNCTIONS, etc) in ALTER DEFAULT PRIVILEGES. We haveTom Lane2009-10-12
| | | | | the keywords as a consequence of the GRANT ALL patch, so we might as well use them and make the ALTER commands read more naturally.
* Support GRANT/REVOKE ON ALL TABLES/SEQUENCES/FUNCTIONS IN SCHEMA.Tom Lane2009-10-12
| | | | Petr Jelinek
* CREATE LIKE INCLUDING COMMENTS and STORAGE, and INCLUDING ALL shortcut. ↵Andrew Dunstan2009-10-12
| | | | Itagaki Takahiro.
* Move the handling of SELECT FOR UPDATE locking and rechecking out ofTom Lane2009-10-12
| | | | | | | | | | | | | | | | | | | execMain.c and into a new plan node type LockRows. Like the recent change to put table updating into a ModifyTable plan node, this increases planning flexibility by allowing the operations to occur below the top level of the plan tree. It's necessary in any case to restore the previous behavior of having FOR UPDATE locking occur before ModifyTable does. This partially refactors EvalPlanQual to allow multiple rows-under-test to be inserted into the EPQ machinery before starting an EPQ test query. That isn't sufficient to fix EPQ's general bogosity in the face of plans that return multiple rows per test row, though. Since this patch is mostly about getting some plan node infrastructure in place and not about fixing ten-year-old bugs, I will leave EPQ improvements for another day. Another behavioral change that we could now think about is doing FOR UPDATE before LIMIT, but that too seems like it should be treated as a followon patch.
* Support use of function argument names to identify which actual argumentsTom Lane2009-10-08
| | | | | | | match which function parameters. The syntax uses AS, for example funcname(value AS arg1, anothervalue AS arg2) Pavel Stehule
* Make it possibly to specify GUC params per user and per database.Alvaro Herrera2009-10-07
| | | | | | | | | | | | | | Create a new catalog pg_db_role_setting where they are now stored, and better encapsulate the code that deals with settings into its realm. The old datconfig and rolconfig columns are removed. psql has gained a \drds command to display the settings. Backwards compatibility warning: while the backwards-compatible system views still have the config columns, they no longer completely represent the configuration for a user or database. Catalog version bumped.
* Change CREATE TABLE so that column default expressions coming from differentTom Lane2009-10-06
| | | | | | | | | inheritance parent tables are compared using equal(), instead of doing strcmp() on the nodeToString representation. The old implementation was always a tad cheesy, and it finally fails completely as of 8.4, now that the node tree might contain syntax location information. equal() knows it's supposed to ignore those fields, but strcmp() hardly can. Per recent report from Scott Ribe.
* Create an ALTER DEFAULT PRIVILEGES command, which allows users to adjustTom Lane2009-10-05
| | | | | | | | | | | the privileges that will be applied to subsequently-created objects. Such adjustments are always per owning role, and can be restricted to objects created in particular schemas too. A notable benefit is that users can override the traditional default privilege settings, eg, the PUBLIC EXECUTE privilege traditionally granted by default for functions. Petr Jelinek
* Sync psql's scanner with recent changes in backend scanner's flex rules.Tom Lane2009-09-27
| | | | Marko Kreen, Tom Lane
* Prevent isolated second surrogate in U& syntaxPeter Eisentraut2009-09-25
|
* Remove backup states from Unicode escapes patchPeter Eisentraut2009-09-25
|
* Unicode escapes in E'...' stringsPeter Eisentraut2009-09-22
| | | | Author: Marko Kreen <markokr@gmail.com>
* Implement the DO statement to support execution of PL code without havingTom Lane2009-09-22
| | | | | | | | | | | | | | to create a function for it. Procedural languages now have an additional entry point, namely a function to execute an inline code block. This seemed a better design than trying to hide the transient-ness of the code from the PL. As of this patch, only plpgsql has an inline handler, but probably people will soon write handlers for the other standard PLs. In passing, remove the long-dead LANCOMPILER option of CREATE LANGUAGE. Petr Jelinek
* Surrogate pair support for U& string and identifier syntaxPeter Eisentraut2009-09-21
| | | | | This is mainly to make the functionality consistent with the proposed \u escape syntax.
* Define a new, more extensible syntax for COPY options.Tom Lane2009-09-21
| | | | | | | | | This is intentionally similar to the recently revised syntax for EXPLAIN options, ie, (name value, ...). The old syntax is still supported for backwards compatibility, but we intend that any options added in future will be provided only in the new syntax. Robert Haas, Emmanuel Cecchet
* Fix bug with WITH RECURSIVE immediately inside WITH RECURSIVE. 99% of theTom Lane2009-09-09
| | | | | | | | | | | code was already okay with this, but the hack that obtained the output column types of a recursive union in advance of doing real parse analysis of the recursive union forgot to handle the case where there was an inner WITH clause available to the non-recursive term. Best fix seems to be to refactor so that we don't need the "throwaway" parse analysis step at all. Instead, teach the transformSetOperationStmt code to set up the CTE's output column information after it's processed the non-recursive term normally. Per report from David Fetter.
* Derived files that are shipped in the distribution used to be built in thePeter Eisentraut2009-08-28
| | | | | | source directory even for out-of-tree builds. They are now alsl built in the build tree. This should be more convenient for certain developers' workflows, and shouldn't really break anything else.
* Modify the definition of window-function PARTITION BY and ORDER BY clausesTom Lane2009-08-27
| | | | | | | | | | | | | | | | | | | so that their elements are always taken as simple expressions over the query's input columns. It originally seemed like a good idea to make them act exactly like GROUP BY and ORDER BY, right down to the SQL92-era behavior of accepting output column names or numbers. However, that was not such a great idea, for two reasons: 1. It permits circular references, as exhibited in bug #5018: the output column could be the one containing the window function itself. (We actually had a regression test case illustrating this, but nobody thought twice about how confusing that would be.) 2. It doesn't seem like a good idea for, eg, "lead(foo) OVER (ORDER BY foo)" to potentially use two completely different meanings for "foo". Accordingly, narrow down the behavior of window clauses to use only the SQL99-compliant interpretation that the expressions are simple expressions.
* Add -Wno-error to CFLAGS from gram.o as long as it's broken.Peter Eisentraut2009-08-26
|
* Allow mixing of traditional and SQL:2008 LIMIT/OFFSET syntax. Being rigidTom Lane2009-08-18
| | | | | | about it doesn't simplify the grammar at all, and it does invite confusion among those who only read the SELECT syntax summary and not the full details. Per gripe from Jaime Casanova.
* Add ALTER TABLE ... ALTER COLUMN ... SET STATISTICS DISTINCTTom Lane2009-08-02
| | | | Robert Haas
* Merge the Constraint and FkConstraint node types into a single type.Tom Lane2009-07-30
| | | | | | | | | | | This was foreseen to be a good idea long ago, but nobody had got round to doing it. The recent patch for deferred unique constraints made transformConstraintAttrs() ugly enough that I decided it was time. This change will also greatly simplify parsing of deferred CHECK constraints, if anyone ever gets around to implementing that. While at it, add a location field to Constraint, and use that to provide an error cursor for some of the constraint-related error messages.
* Support deferrable uniqueness constraints.Tom Lane2009-07-29
| | | | | | | | | | The current implementation fires an AFTER ROW trigger for each tuple that looks like it might be non-unique according to the index contents at the time of insertion. This works well as long as there aren't many conflicts, but won't scale to massive unique-key reassignments. Improving that case is a TODO item. Dean Rasheed
* Extend EXPLAIN to allow generic options to be specified.Tom Lane2009-07-26
| | | | | | | | | | | | | | | The original syntax made it difficult to add options without making them into reserved words. This change parenthesizes the options to avoid that problem, and makes provision for an explicit (and perhaps non-Boolean) value for each option. The original syntax is still supported, but only for the two original options ANALYZE and VERBOSE. As a test case, add a COSTS option that can suppress the planner cost estimates. This may be useful for including EXPLAIN output in the regression tests, which are otherwise unable to cope with cross-platform variations in cost estimates. Robert Haas
* Allow * as parameter for FORCE QUOTE for COPY CSV. Itagaki Takahiro.Andrew Dunstan2009-07-25
|
* DROP IF EXISTS for columns and constraints. Andres Freund.Andrew Dunstan2009-07-20
|
* Make backend header files C++ safePeter Eisentraut2009-07-16
| | | | | | | | | | | This alters various incidental uses of C++ key words to use other similar identifiers, so that a C++ compiler won't choke outright. You still (probably) need extern "C" { }; around the inclusion of backend headers. based on a patch by Kurt Harriman <harriman@acm.org> Also add a script cpluspluscheck to check for C++ compatibility in the future. As of right now, this passes without error for me.
* Tweak the core scanner so that it can be used by plpgsql too.Tom Lane2009-07-14
| | | | | | | | | | | | | | 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.)
* Although the flex documentation avers that yyalloc and yyrealloc takeTom Lane2009-07-13
| | | | | | | 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.
* Convert the core lexer and parser into fully reentrant code, by making useTom Lane2009-07-13
| | | | | | | | | | | 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.)
* Move some declarations in the raw-parser header files to create a clearerTom Lane2009-07-12
| | | | | | | | | | 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.
* Per SQL spec (in particular, the grammar in SQL:2008 7.13) we should allowTom Lane2009-07-06
| | | | | | | 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.
* Fix the just-reported problem that you can't specify all four trigger eventTom Lane2009-06-18
| | | | | | types in CREATE TRIGGER. While at it, clean up the amazingly tedious and inextensible way that the trigger event type list was handled. Per report from Greg Sabino Mullane.
* Fix get_sort_group_operators() so that it doesn't think arrays can be groupedTom Lane2009-06-13
| | | | | via hashing. Eventually we ought to make that possible, but it won't happen for 8.4. Per yesterday's report from Robert Haas.
* 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian2009-06-11
| | | | provided by Andrew.
* Improve the recently-added support for properly pluralized error messagesTom Lane2009-06-04
| | | | | | | | | | by extending the ereport() API to cater for pluralization directly. This is better than the original method of calling ngettext outside the elog.c code because (1) it avoids double translation, which wastes cycles and in the worst case could give a wrong result; and (2) it avoids having to use a different coding method in PL code than in the core backend. The client-side uses of ngettext are not touched since neither of these concerns is very pressing in the client environment. Per my proposal of yesterday.
* Ignore RECHECK in CREATE OPERATOR CLASS, just throwing a NOTICE, instead ofTom Lane2009-05-27
| | | | | | throwing an error as 8.4 had been doing. The error interfered with porting old database definitions (particularly for pg_migrator) without really buying any safety. Per bug #4817 and subsequent discussion.
* Modify find_inheritance_children() and find_all_inheritors() to add theTom Lane2009-05-12
| | | | | | | | | | | | | | ability to lock relations as they scan pg_inherits, and to ignore any relations that have disappeared by the time we get lock on them. This makes uses of these functions safe against concurrent DROP operations on child tables: we will effectively ignore any just-dropped child, rather than possibly throwing an error as in recent bug report from Thomas Johansson (and similar past complaints). The behavior should not change otherwise, since the code was acquiring those same locks anyway, just a little bit later. An exception is LockTableCommand(), which is still behaving unsafely; but that seems to require some more discussion before we change it.
* Do some minor code refactoring in preparation for changing the APIs ofTom Lane2009-05-12
| | | | | | | | | | | | | | | | | find_inheritance_children() and find_all_inheritors(). I got annoyed that these are buried inside the planner but mostly used elsewhere. So, create a new file catalog/pg_inherits.c and put them there, along with a couple of other functions that search pg_inherits. The code that modifies pg_inherits is (still) in tablecmds.c --- it's kind of entangled with unrelated code that modifies pg_depend and other stuff, so pulling it out seemed like a bigger change than I wanted to make right now. But this file provides a natural home for it if anyone ever gets around to that. This commit just moves code around; it doesn't change anything, except I succumbed to the temptation to make a couple of trivial optimizations in typeInheritsFrom().
* Make new complaint about unsafe Unicode literals include an error location.Tom Lane2009-05-05
| | | | Every other ereport in scan.l has one, this should too.
* Disable the use of Unicode escapes in string constants (U&'') whenPeter Eisentraut2009-05-05
| | | | standard_conforming_strings is not on, for security reasons.
* Move SERVER to the right place in the alphabetically sorted keyword list.Heikki Linnakangas2009-04-28
|
* Fix some more 'variable may be used uninitialized' warnings from gcc 4.4.Tom Lane2009-04-24
|
* Rethink the idea of having plpgsql depend on parser/gram.h. Aside from theTom Lane2009-04-19
| | | | | | | | | fact that this is breaking the MSVC build, it's probably not really a good idea to expand the dependencies of gram.h any further than the core parser; for instance the value of SCONST might depend on which bison version you'd built with. Better to expose an additional call point in parser.c, so move what I had put into pl_funcs.c into parser.c. Also PGDLLIMPORT'ify the reference to standard_conforming_strings, per buildfarm results.
* Fix de-escaping checks so that we will reject \000 as well as other invalidlyTom Lane2009-04-19
| | | | encoded sequences. Per discussion of a couple of days ago.
* Fix broken {xufailed} production that made HEAD fail onTom Lane2009-04-14
| | | | | | | | select u&42 from table-with-a-u-column; Also fix missing SET_YYLLOC() in the {dolqfailed} production that I suppose this was based on. The latter is a pre-existing bug, but the only effect is to misplace the error cursor by one token, so probably not worth backpatching.
* Rename the new CREATE DATABASE options to set collation and ctype intoHeikki Linnakangas2009-04-06
| | | | LC_COLLATE and LC_CTYPE, per discussion on pgsql-hackers.