summaryrefslogtreecommitdiff
path: root/src/backend/parser
AgeCommit message (Collapse)Author
2001-02-09plpgsql's private copy of xlateSqlType was out of sync. Again. ThisTom Lane
is clearly not maintainable, so dike it out in favor of calling the real version in the backend's gram.y.
2001-02-03Use elog() instead of exit() for fatal scanner errors.Peter Eisentraut
2001-01-27Fix failure to create sequences for more than one SERIAL column in aTom Lane
table.
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
2001-01-23Give 'a_expr ::= a_expr Op' production a slightly lower precedence thanTom Lane
Op, so that the sequence 'a_expr Op Op a_expr' will be parsed as a_expr Op (Op a_expr) not (a_expr Op) Op a_expr as formerly. In other words, prefer treating user-defined operators as prefix operators to treating them as postfix operators, when there is an ambiguity. Also clean up a couple of other infelicities in production priority assignment --- for example, BETWEEN wasn't being given the intended priority, but that of AND.
2001-01-23Remove no-longer-needed restriction against referencing systemTom Lane
attributes in a FieldSelect node --- all the places that manipulate these work just fine with system attribute numbers. OK, it's a new feature, so shoot me ...
2001-01-20Give a good error message for what's likely to be a common syntax error,Tom Lane
namely omitting the alias clause for a sub-SELECT in FROM.
2001-01-19Suppress unused-variable warning in non-Assert compilations.Tom Lane
2001-01-17Change lcons(x, NIL) to makeList(x) where appropriate.Bruce Momjian
2001-01-15Fix problems with parentheses around sub-SELECT --- for the last time,Tom Lane
I hope. I finally realized that we were going at it backwards: when there are excess parentheses, they need to be treated as part of the sub-SELECT, not as part of the surrounding expression. Although either choice yields an unambiguous grammar, only this way produces a grammar that is LALR(1). With the old approach we were guaranteed to fail on either 'SELECT (((SELECT 2)) + 3)' or 'SELECT (((SELECT 2)) UNION SELECT 2)' depending on which way we resolve the initial shift/reduce conflict. With the new way, the same reduction track can be followed in both cases until we have advanced far enough to know whether we are done with the sub-SELECT or not.
2001-01-08Remove compiler warning about uninitialized warnings.Bruce Momjian
2001-01-06Simplify the rules that explicitly allowed TYPE as a type name (which isPeter Eisentraut
no longer the case). Add AND and TRAILING to ColLabel. All key words except AS are now at least ColLabel's.
2001-01-05Remove not-really-standard implementation of CREATE TABLE's UNDER clause,Tom Lane
and revert documentation to describe the existing INHERITS clause instead, per recent discussion in pghackers. Also fix implementation of SQL_inheritance SET variable: it is not cool to look at this var during the initial parsing phase, only during parse_analyze(). See recent bug report concerning misinterpretation of date constants just after a SET TIMEZONE command. gram.y really has to be an invariant transformation of the query string to a raw parsetree; anything that can vary with time must be done during parse analysis.
2000-12-27Fix portability problems recently exposed by regression tests on Alphas.Tom Lane
1. Distinguish cases where a Datum representing a tuple datatype is an OID from cases where it is a pointer to TupleTableSlot, and make sure we use the right typlen in each case. 2. Make fetchatt() and related code support 8-byte by-value datatypes on machines where Datum is 8 bytes. Centralize knowledge of the available by-value datatype sizes in two macros in tupmacs.h, so that this will be easier if we ever have to do it again.
2000-12-22Clean up CREATE TYPE/OPERATOR/AGGREGATE productions, so that parserTom Lane
will not accept types named with operator names or vice versa.
2000-12-18Repair mishandling of PRIMARY KEY declaration that references anTom Lane
inherited column, per bug report from Elphick 12/15/00.
2000-12-17Tweak select_common_type() to deal with possibility of multiple preferredTom Lane
types in a category --- it was taking the last preferred type among the inputs, rather than the first one as intended.
2000-12-15Remove current->old mapping.Bruce Momjian
2000-12-15Make algorithm for resolving UNKNOWN function/operator inputs beTom Lane
insensitive to the order of arguments. Per pghackers discussion 12/10/00.
2000-12-15Remove obsolete comment.Tom Lane
2000-12-07transformForUpdate() mustn't assume rowMarks list is initially empty.Tom Lane
It could be recursing into a sub-query where there was already a FOR UPDATE clause.
2000-12-06Clean up handling of FOR UPDATE inside views and subselects ... make itTom Lane
work where we can (given that the executor only handles it at top level) and generate an error where we can't. Note that while the parser has been allowing views to say SELECT FOR UPDATE for a few weeks now, that hasn't actually worked until just now.
2000-12-05From Stephan Szabo:Tom Lane
I believe this should fix the issue that Philip Warner noticed about the check for unique constraints meeting the referenced keys of a foreign key constraint allowing the specification of a subset of a foreign key instead of rejecting it. I also added tests for a base case of this to the foreign key and alter table tests and patches for expected output.
2000-12-05Repair breakage of rules containing INSERT ... SELECT actions, per bugTom Lane
report from Joel Burton. Turns out that my simple idea of turning the SELECT into a subquery does not interact well *at all* with the way the rule rewriter works. Really what we need to make INSERT ... SELECT work cleanly is to decouple targetlists from rangetables: an INSERT ... SELECT wants to have two levels of targetlist but only one rangetable. No time for that for 7.1, however, so I've inserted some ugly hacks to make the rewriter know explicitly about the structure of INSERT ... SELECT queries. Ugh :-(
2000-12-03Ensure that all uses of <ctype.h> functions are applied to unsigned-charTom Lane
values, whether the local char type is signed or not. This is necessary for portability. Per discussion on pghackers around 9/16/00.
2000-12-03Repair usage of the OVERLAPS operator.Thomas G. Lockhart
Allow some operator-like tokens to be used as function names. Flesh out support for time, timetz, and interval operators and interactions. Regression tests pass, but non-reference-platform horology test results will need to be updated.
2000-11-24Make SET SESSION CHARACTERISTICS compliant with SQL 99. Remove redundant,Peter Eisentraut
non-standard clauses. Allow CHARACTERISTICS as unquoted identifier. Merge related reference pages.
2000-11-18Treat plain 'BIT' as 'BIT(1)'.Peter Eisentraut
2000-11-17Add separate type category for bit string types, allowing mixed bit/varbitPeter Eisentraut
function calls to work.
2000-11-16Make a pstrdup copy of the literalbuf when scanning a bit string. Other-Peter Eisentraut
wise the next bit string in the same command clobbers the previous ones.
2000-11-16Change SearchSysCache coding conventions so that a reference count isTom Lane
maintained for each cache entry. A cache entry will not be freed until the matching ReleaseSysCache call has been executed. This eliminates worries about cache entries getting dropped while still in use. See my posting to pg-hackers of even date for more info.
2000-11-16Add support for casting bit string constants.Peter Eisentraut
2000-11-14Extend CREATE DATABASE to allow selection of a template database to beTom Lane
cloned, rather than always cloning template1. Modify initdb to generate two identical databases rather than one, template0 and template1. Connections to template0 are disallowed, so that it will always remain in its virgin as-initdb'd state. pg_dumpall now dumps databases with restore commands that say CREATE DATABASE foo WITH TEMPLATE = template0. This allows proper behavior when there is user-added data in template1. initdb forced!
2000-11-12Restructure handling of inheritance queries so that they work with outerTom Lane
joins, and clean things up a good deal at the same time. Append plan node no longer hacks on rangetable at runtime --- instead, all child tables are given their own RT entries during planning. Concept of multiple target tables pushed up into execMain, replacing bug-prone implementation within nodeAppend. Planner now supports generating Append plans for inheritance sets either at the top of the plan (the old way) or at the bottom. Expanding at the bottom is appropriate for tables used as sources, since they may appear inside an outer join; but we must still expand at the top when the target of an UPDATE or DELETE is an inheritance set, because we actually need a different targetlist and junkfilter for each target table in that case. Fortunately a target table can't be inside an outer join... Bizarre mutual recursion between union_planner and prepunion.c is gone --- in fact, union_planner doesn't really have much to do with union queries anymore, so I renamed it grouping_planner.
2000-11-11Fix bug in recent improvement to type resolution code. Forgot to retainThomas G. Lockhart
"best choice" type category when resolving UNKNOWN function and operator arguments. Thanks to Tom Lane for finding test case.
2000-11-09Arrange for CASE or UNION with only untyped literal constants as inputTom Lane
to resolve the unknown constants as type TEXT.
2000-11-08Make DROP TABLE rollback-able: postpone physical file delete until commit.Tom Lane
(WAL logging for this is not done yet, however.) Clean up a number of really crufty things that are no longer needed now that DROP behaves nicely. Make temp table mapper do the right things when drop or rename affecting a temp table is rolled back. Also, remove "relation modified while in use" error check, in favor of locking tables at first reference and holding that lock throughout the statement.
2000-11-08Add ANALYSE spelling of ANALYZE for vacuum.Bruce Momjian
2000-11-07Enable fallback to string type when argument(s) are of UNKNOWN type.Thomas G. Lockhart
Same code exactly as for function resolution. An obvious example is for select '1' = '01'; which used to throw an error and which now resolves to two text strings.
2000-11-06Implement AT TIME ZONE SQL9x syntax.Thomas G. Lockhart
AT is now a keyword but is not a reserved word.
2000-11-06Allow type resolution for UNKNOWN arguments to functions to fall back toThomas G. Lockhart
any available string type. Previously, all candidate choices must have fallen within the same "type category" for PostgreSQL to be willing to choose any of them. Need to apply the same fixup to operator type resolution.
2000-11-05New CHECKPOINT command.Vadim B. Mikheev
Auto removing of offline log files and creating new file at checkpoint time.
2000-11-05UNION select in a CREATE RULE caused a weird error, because transformRuleStmtTom Lane
got confused by 'dummy' targetlist built for the UNION's toplevel query. Fix by making dummy targetlist a little less cheesy.
2000-11-05Allow ORDER BY, LIMIT in sub-selects. Fix most (not all) cases whereTom Lane
the grammar did not allow redundant parentheses around sub-selects. Distinguish LIMIT ALL from LIMIT 0; make the latter behave as one would expect.
2000-11-04Make PROCEDURAL optional in CREATE/DROP LANGUAGE.Bruce Momjian
2000-11-04This patch should allow primary/foreign keyBruce Momjian
definitions using inherited columns in the create table statement. Stephan Szabo
2000-11-02Peter forgot to fix {operator} rule to match modified definition ofTom Lane
'self' characters.
2000-10-31Change internal string representation of BitString node to include aPeter Eisentraut
leading 'b', as it appears to be more convenient this way for the input and node functions.
2000-10-31Change the parser to convert SQL "position" and "substring" syntax toPeter Eisentraut
position() and substring() functions, so that it works transparently for bit types as well. Alias the text functions appropriately. Add position() for bit types. Add new constant node T_BitString that represents literals of the form B'1001 and pass those to zpbit type.
2000-10-30Disallow zero-length delimited identifier (per SQL).Peter Eisentraut