summaryrefslogtreecommitdiff
path: root/src/backend/parser
AgeCommit message (Collapse)Author
2003-06-25Don't generate 'zero' typeids in the output from gen_cross_product.Tom Lane
This is no longer necessary or appropriate since we don't use zero typeid as a wildcard anymore, and it fixes a nasty performance problem with functions with many parameters. Per recent example from Reuven Lerner.
2003-05-04When a TIMESTAMP, TIME, or INTERVAL precision is specified larger than ourTom Lane
implementation limits, do not issue an ERROR; instead issue a NOTICE and use the max supported value. Per pgsql-general discussion of 28-Apr, this is needed to allow easy porting from pre-7.3 releases where the limits were higher. Unrelated change in same area: accept GLOBAL TEMP/TEMPORARY as a synonym for TEMPORARY, as per pgsql-hackers discussion of 15-Apr. We previously rejected it, but that was based on a misreading of the spec --- SQL92's GLOBAL temp tables are really closer to what we have than their LOCAL ones.
2003-04-23Fix misbehavior of func_error() on type names containing '%'.Tom Lane
Will patch separately but equivalently in HEAD.
2003-04-10Remove premature attempt to constant-fold type coercion expressions.Tom Lane
While usually safe, this fails if the coercion function needs the query snapshot to be set already. Per example from Nigel Andrews.
2003-04-03Repair incorrect checking of grouped/ungrouped variables in the presenceTom Lane
of unnamed joins; per pghackers discussion 31-Mar-03.
2003-02-13Parser was dropping foreign-key constraints on the floor if present inTom Lane
an ALTER TABLE ADD COLUMN command. Per bug #896.
2003-02-11Use a varno not chosen at random for dummy variables in the top-levelTom Lane
targetlist of a set-operation tree. I'm not sure that this solution will really stand the test of time --- perhaps we need to make a special RTE for such vars to refer to. But this quick hack fixes Brandon Craig Rhodes' complaint of 10-Feb-02 about EXCEPT in CREATE RULE, while not changing any behavior in the better-tested cases where leftmostRTI is one anyway.
2003-02-05Allow qualified type names in CREATE CAST, DROP CAST. Also allow theTom Lane
construction 'SETOF type[]' which for some reason was previously overlooked (you'd have to name the array type directly to make it work).
2003-01-31Tweak bison build rules so that we get the same error messages fromTom Lane
bison 1.875 and later as we did from earlier bison releases. Eventually we will probably want to adopt the newer message spelling ... but not yet. Per recent discussion on pgpatches. Note: I didn't change the build rules for bootstrap, ecpg, or plpgsql grammars, since these do not affect regression test results.
2002-12-27Deliver better error message when a relation name is used in an expression.Tom Lane
Per report from Ian Barwick.
2002-12-16Fix ALTER TABLE ADD COLUMN to disallow the same column types that areTom Lane
disallowed by CREATE TABLE (eg, pseudo-types); also disallow these types from being introduced by the range-function syntax. While at it, allow CREATE TABLE to create zero-column tables, per recent pghackers discussion. I am back-patching this into 7.3 since failure to disallow pseudo-types is arguably a security hole.
2002-11-11Add cast to suppress compile warning on Alphas.Tom Lane
2002-11-04Remove unnecessary inclusion, per Andreas.Tom Lane
2002-11-02Remove encoding lookups from grammar stage, push them back to placesTom Lane
where it's safe to do database access. Along the way, fix core dump for 'DEFAULT' parameters to CREATE DATABASE. initdb forced due to change in pg_proc entry.
2002-11-01Arrange to compile flex output files as inclusions into other filesTom Lane
(usually bison output files), not as standalone files. This hack works around flex's insistence on including <stdio.h> before we are able to include postgres.h; postgres.h will already be read before the compiler starts to read the flex output file. Needed for largefile support on some platforms.
2002-10-31Clean up gram.y trailing spaces.Bruce Momjian
2002-10-24Function-call-style type coercions should be treated as explicitTom Lane
coercions, not implicit ones. For example, 'select abstime(1035497293)' should succeed because there is an explicit binary coercion from int4 to abstime.
2002-10-21Fix places that were using IsTransactionBlock() as an (inadequate) checkTom Lane
that they'd get to commit immediately on finishing. There's now a centralized routine PreventTransactionChain() that implements the necessary tests.
2002-10-20Disallow aggregate functions in rule WHERE clauses. Per gripe fromTom Lane
Fritz Lehmann-Grube back in January.
2002-10-19Fix case where a function in FROM returns a scalar type, but isTom Lane
referred to with whole-tuple syntax.
2002-10-14Adjust handling of command status strings in the presence of rules,Tom Lane
as per recent pghackers discussions. initdb forced due to change in fields of stored Query nodes.
2002-09-28Make the world at least somewhat safe for zero-column tables, andTom Lane
remove the special case in ALTER DROP COLUMN to prohibit dropping a table's last column.
2002-09-22Remove commas from %type and %token lists, for compatibility with newerTom Lane
versions of bison.
2002-09-22Replace pg_attribute.attisinherited with attislocal and attinhcountTom Lane
columns, to allow more correct behavior in multiple-inheritance cases. Patch by Alvaro Herrera, review by Tom Lane.
2002-09-22Bring SIMILAR TO and SUBSTRING into some semblance of conformance withTom Lane
the SQL99 standard. (I'm not sure that the character-class features are quite right, but that can be fixed later.) Document SQL99 and POSIX regexps as being different features; provide variants of SUBSTRING for each.
2002-09-22Move most of the error checking for foreign-key constraints out ofTom Lane
parse analysis and into the execution code (in tablecmds.c). This eliminates a lot of unreasonably complex code that needed to have two or more execution paths in case it was dealing with a not-yet-created table column vs. an already-existing one. The execution code is always dealing with already-created tables and so needs only one case. This also eliminates some potential race conditions (the table wasn't locked between parse analysis and execution), makes it easy to fix the gripe about wrong referenced-column names generating a misleading error message, and lets us easily add a dependency from the foreign-key constraint to the unique index that it requires the referenced table to have. (Cf. complaint from Kris Jurka 12-Sep-2002 on pgsql-bugs.) Also, third try at building a deletion mechanism that is not sensitive to the order in which pg_depend entries are visited. Adding the above- mentioned dependency exposed the folly of what dependency.c had been doing: it failed for cases where B depends on C while both auto-depend on A. Dropping A should succeed in this case, but was failing if C happened to be visited before B. It appears the only solution is two separate walks over the dependency tree.
2002-09-18Extend pg_cast castimplicit column to a three-way value; this allows usTom Lane
to be flexible about assignment casts without introducing ambiguity in operator/function resolution. Introduce a well-defined promotion hierarchy for numeric datatypes (int2->int4->int8->numeric->float4->float8). Change make_const to initially label numeric literals as int4, int8, or numeric (never float8 anymore). Explicitly mark Func and RelabelType nodes to indicate whether they came from a function call, explicit cast, or implicit cast; use this to do reverse-listing more accurately and without so many heuristics. Explicit casts to char, varchar, bit, varbit will truncate or pad without raising an error (the pre-7.2 behavior), while assigning to a column without any explicit cast will still raise an error for wrong-length data like 7.3. This more nearly follows the SQL spec than 7.2 behavior (we should be reporting a 'completion condition' in the explicit-cast cases, but we have no mechanism for that, so just do silent truncation). Fix some problems with enforcement of typmod for array elements; it didn't work at all in 'UPDATE ... SET array[n] = foo', for example. Provide a generalized array_length_coerce() function to replace the specialized per-array-type functions that used to be needed (and were missing for NUMERIC as well as all the datetime types). Add missing conversions int8<->float4, text<->numeric, oid<->int8. initdb forced.
2002-09-05Fix some operator-precedence problems. New constructs IS DISTINCT FRMTom Lane
and IS [NOT] OF were not being parsed consistently with other IS forms. Also, make the world a little safer for functions named LEFT, RIGHT, etc.
2002-09-05Be careful to include postgres.h *before* any system headers, to ensureTom Lane
that the right flavors of largefile-related definitions are seen. Most of these changes are probably unnecessary, but better safe than sorry.
2002-09-04pgindent run.Bruce Momjian
2002-09-02I checked all the previous string handling errors and most of them wereBruce Momjian
already fixed by You. However there were a few left and attached patch should fix the rest of them. I used StringInfo only in 2 places and both of them are inside debug ifdefs. Only performance penalty will come from using strlen() like all the other code does. I also modified some of the already patched parts by changing snprintf(buf, 2 * BUFSIZE, ... style lines to snprintf(buf, sizeof(buf), ... where buf is an array. Jukka Holappa
2002-09-02CREATE OR REPLACE VIEW, CREATE OR REPLACE RULE.Tom Lane
Gavin Sherry, Neil Conway, and Tom Lane all got their hands dirty on this one ...
2002-09-01Code cleanups: make non-implicit WITHOUT FUNCTION casts work, avoidTom Lane
redundant pg_cast searches, fix obsolete comments.
2002-08-31Code review for domain-constraints patch. Use a new ConstraintTest nodeTom Lane
type for runtime constraint checks, instead of misusing the parse-time Constraint node for the purpose. Fix some damage introduced into type coercion logic; in particular ensure that a coerced expression tree will read out the correct result type when inspected (patch had broken some RelabelType cases). Enforce domain NOT NULL constraints against columns that are omitted from an INSERT.
2002-08-29Remove #ifdef MULTIBYTE per hackers list discussion.Tatsuo Ishii
2002-08-29Code review for standalone composite types, query-specified compositeTom Lane
types, SRFs. Not happy with memory management yet, but I'll commit these other changes.
2002-08-28backend where a statically sized buffer is written to. Most of theseBruce Momjian
should be pretty safe in practice, but it's probably better to be safe than sorry. I was actually looking for cases where NAMEDATALEN is assumed to be 32, but only found one. That's fixed too, as well as a few bits of code cleanup. Neil Conway
2002-08-28Allow FOR UPDATE to appear after LIMIT/OFFSET to match MySQL syntax and asBruce Momjian
a more logical ordering.
2002-08-27PREPARE/EXECUTE statements. Patch by Neil Conway, some kibitzingTom Lane
from Tom Lane.
2002-08-27This patches replaces a few more usages of strcpy() and sprintf() whenBruce Momjian
copying into a fixed-size buffer (in this case, a buffer of NAMEDATALEN bytes). AFAICT nothing to worry about here, but worth fixing anyway... Neil Conway
2002-08-26Modify array operations to include array's element type OID in theTom Lane
array header, and to compute sizing and alignment of array elements the same way normal tuple access operations do --- viz, using the tupmacs.h macros att_addlength and att_align. This makes the world safe for arrays of cstrings or intervals, and should make it much easier to write array-type-polymorphic functions; as examples see the cleanups of array_out and contrib/array_iterator. By Joe Conway and Tom Lane.
2002-08-22Add a bunch of pseudo-types to replace the behavior formerly associatedTom Lane
with OPAQUE, as per recent pghackers discussion. I still want to do some more work on the 'cstring' pseudo-type, but I'm going to commit the bulk of the changes now before the tree starts shifting under me ...
2002-08-19Fix pg_dump to dump serial columns as serials. Per pghackers discussion,Tom Lane
cause SERIAL column declaration not to imply UNIQUE, so that this can be done without creating an extra index.
2002-08-19Remove Ident nodetype in favor of using String nodes; this fixes someTom Lane
latent wrong-struct-type bugs and makes the coding style more uniform, since the majority of places working with lists of column names were already using Strings not Idents. While at it, remove vestigial support for Stream node type, and otherwise-unreferenced nodes.h entries for T_TupleCount and T_BaseNode. NB: full recompile is recommended due to changes of Node type numbers. This shouldn't force an initdb though.
2002-08-18Remove optimization whereby parser would make only one sort-list entryTom Lane
when two equal() targetlist items were to be added to an ORDER BY or DISTINCT list. Although indeed this would make sorting fractionally faster by sometimes saving a comparison, it confuses the heck out of later stages of processing, because it makes it look like the user wrote DISTINCT ON rather than DISTINCT. Bug reported by joe@piscitella.com.
2002-08-18Make pg_dump output more portable and more pleasing to look at.Peter Eisentraut
The -n and -N options were removed. Quoting is now smart enough to supply quotes if and only if necessary. Numerical types are now printed without quotes, except in cases of special values such as NaN. Boolean values printed as true and false. Most string literals now do not escape whitespace characters (newlines, etc.) for portability. SET SESSION AUTHORIZATION argument is a string literal, to follow SQL. Made commands output by pg_dump use consistent spacing and indentation.
2002-08-18Code review for 'at character n' patch --- point at proper end ofTom Lane
a token scanned by multiple lex rules.
2002-08-17In that case, attached is a patch which locates the beginning of theBruce Momjian
offending token more efficiently (per your suggestion of using scanbuf). The new patch does the same as before: template1=# select * frum pg_class; ERROR: parser: parse error at or near "frum" at character 10 It also implement's Tom's suggestion: template1=# select * from pg_class where\g ERROR: parse: parse error at end of input Gavin Sherry
2002-08-15Tom Lane wrote:Bruce Momjian
> There's no longer a separate call to heap_storage_create in that routine > --- the right place to make the test is now in the storage_create > boolean parameter being passed to heap_create. A simple change, but > it passeth patch's understanding ... Thanks. Attached is a patch against cvs tip as of 8:30 PM PST or so. Turned out that even after fixing the failed hunks, there was a new spot in bufmgr.c which needed to be fixed (related to temp relations; RelationUpdateNumberOfBlocks). But thankfully the regression test code caught it :-) Joe Conway
2002-08-10Allow schema-qualified operator names to be used in the optionalTom Lane
arguments of CREATE OPERATOR.