aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
Commit message (Collapse)AuthorAge
* Re-addd Rod's ALTER DOMAIN patch.Bruce Momjian2002-12-06
|
* Back out ALTER DOMAIN patch until missing file appears.Bruce Momjian2002-12-06
|
* ALTER DOMAIN .. SET / DROP NOT NULLBruce Momjian2002-12-06
| | | | | | | | | | ALTER DOMAIN .. SET / DROP DEFAULT ALTER DOMAIN .. ADD / DROP CONSTRAINT New files: - doc/src/sgml/ref/alter_domain.sgml Rod Taylor
* Code review for IS DISTINCT FROM patch. Fix incorrect constant-foldingTom Lane2002-11-30
| | | | | | logic, dissuade planner from thinking that 'x IS DISTINCT FROM 42' may be optimized into 'x = 42' (!!), cause dependency on = operator to be recorded correctly, minor other improvements.
* Missed one place that can be simplified after recent Param/Const cleanup.Tom Lane2002-11-30
|
* Tighten selection of equality and ordering operators for groupingTom Lane2002-11-29
| | | | | | | operations: make sure we use operators that are compatible, as determined by a mergejoin link in pg_operator. Also, add code to planner to ensure we don't try to use hashed grouping when the grouping operators aren't marked hashable.
* Use Params, rather than run-time-modified Const nodes, to handleTom Lane2002-11-26
| | | | | | | sublink results and COPY's domain constraint checking. A Const that isn't really constant is just a Bad Idea(tm). Remove hacks in parse_coerce and other places that were needed because of the former klugery.
* Remove unused constisset and constiscast fields of Const nodes. CleanTom Lane2002-11-25
| | | | up code and documentation associated with Param nodes.
* Un-break triggers declared for INSERT OR DELETE OR UPDATE. This workedTom Lane2002-11-25
| | | | | okay in 7.3, so I think it must have been busted in the recent triggers patch.
* This patch implements FOR EACH STATEMENT triggers, per my email toBruce Momjian2002-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -hackers a couple days ago. Notes/caveats: - added regression tests for the new functionality, all regression tests pass on my machine - added pg_dump support - updated PL/PgSQL to support per-statement triggers; didn't look at the other procedural languages. - there's (even) more code duplication in trigger.c than there was previously. Any suggestions on how to refactor the ExecXXXTriggers() functions to reuse more code would be welcome -- I took a brief look at it, but couldn't see an easy way to do it (there are several subtly-different versions of the code in question) - updated the documentation. I also took the liberty of removing a big chunk of duplicated syntax documentation in the Programmer's Guide on triggers, and moving that information to the CREATE TRIGGER reference page. - I also included some spelling fixes and similar small cleanups I noticed while making the changes. If you'd like me to split those into a separate patch, let me know. Neil Conway
* Remove ALL from CLUSTER ALL. Use just CLUSTER.Bruce Momjian2002-11-18
|
* New version attached. The following is implemented:Bruce Momjian2002-11-15
| | | | | | | | | | | - CLUSTER ALL clusters all the tables that have some index with indisclustered set and the calling user owns. - CLUSTER tablename clusters the named table, using the index with indisclustered set. If no index has the bit set, throws elog(ERROR). - The multi-relation version (CLUSTER ALL) uses a multitransaction approach, similar to what VACUUM does. Alvaro Herrera
* Add DOMAIN check constraints.Bruce Momjian2002-11-15
| | | | Rod Taylor
* Make MOVE/FETCH 0 actually move/fetch 0. Add MOVE LAST to move to endBruce Momjian2002-11-13
| | | | of cursor.
* Add new palloc0 call as merge of palloc and MemSet(0).Bruce Momjian2002-11-13
|
* Code review for ON COMMIT patch. Make the actual on-commit action happenTom Lane2002-11-11
| | | | | | | | | before commit, not after :-( --- the original coding is not only unsafe if an error occurs while it's processing, but it generates an invalid sequence of WAL entries. Resurrect 7.2 logic for deleting items when no longer needed. Use an enum instead of random macros. Editorialize on names used for routines and constants. Teach backend/nodes routines about new field in CreateTable struct. Add a regression test.
* Add cast to suppress compile warning on Alphas.Tom Lane2002-11-11
|
* Back out use of palloc0 in place if palloc/MemSet. Seems constant lenBruce Momjian2002-11-11
| | | | to MemSet is a performance boost.
* Merge palloc()/MemSet(0) calls into a single palloc0() call.Bruce Momjian2002-11-10
|
* Tweak CREATE SEQUENCE grammar to be more SQL1999 standards compliant.Bruce Momjian2002-11-10
| | | | Neil Conway
* Add code to handle [ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP }]Bruce Momjian2002-11-09
| | | | | | for temp tables. Gavin Sherry
* Remove unnecessary inclusion, per Andreas.Tom Lane2002-11-04
|
* Remove encoding lookups from grammar stage, push them back to placesTom Lane2002-11-02
| | | | | | 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.
* Arrange to compile flex output files as inclusions into other filesTom Lane2002-11-01
| | | | | | | | (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.
* Clean up gram.y trailing spaces.Bruce Momjian2002-10-31
|
* Function-call-style type coercions should be treated as explicitTom Lane2002-10-24
| | | | | | coercions, not implicit ones. For example, 'select abstime(1035497293)' should succeed because there is an explicit binary coercion from int4 to abstime.
* Fix places that were using IsTransactionBlock() as an (inadequate) checkTom Lane2002-10-21
| | | | | | that they'd get to commit immediately on finishing. There's now a centralized routine PreventTransactionChain() that implements the necessary tests.
* Disallow aggregate functions in rule WHERE clauses. Per gripe fromTom Lane2002-10-20
| | | | Fritz Lehmann-Grube back in January.
* Fix case where a function in FROM returns a scalar type, but isTom Lane2002-10-19
| | | | referred to with whole-tuple syntax.
* Adjust handling of command status strings in the presence of rules,Tom Lane2002-10-14
| | | | | as per recent pghackers discussions. initdb forced due to change in fields of stored Query nodes.
* Make the world at least somewhat safe for zero-column tables, andTom Lane2002-09-28
| | | | | remove the special case in ALTER DROP COLUMN to prohibit dropping a table's last column.
* Remove commas from %type and %token lists, for compatibility with newerTom Lane2002-09-22
| | | | versions of bison.
* Replace pg_attribute.attisinherited with attislocal and attinhcountTom Lane2002-09-22
| | | | | columns, to allow more correct behavior in multiple-inheritance cases. Patch by Alvaro Herrera, review by Tom Lane.
* Bring SIMILAR TO and SUBSTRING into some semblance of conformance withTom Lane2002-09-22
| | | | | | | 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.
* Move most of the error checking for foreign-key constraints out ofTom Lane2002-09-22
| | | | | | | | | | | | | | | | | | | | | | 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.
* Extend pg_cast castimplicit column to a three-way value; this allows usTom Lane2002-09-18
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix some operator-precedence problems. New constructs IS DISTINCT FRMTom Lane2002-09-05
| | | | | 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.
* Be careful to include postgres.h *before* any system headers, to ensureTom Lane2002-09-05
| | | | | | that the right flavors of largefile-related definitions are seen. Most of these changes are probably unnecessary, but better safe than sorry.
* pgindent run.Bruce Momjian2002-09-04
|
* I checked all the previous string handling errors and most of them wereBruce Momjian2002-09-02
| | | | | | | | | | | | | | | 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
* CREATE OR REPLACE VIEW, CREATE OR REPLACE RULE.Tom Lane2002-09-02
| | | | | Gavin Sherry, Neil Conway, and Tom Lane all got their hands dirty on this one ...
* Code cleanups: make non-implicit WITHOUT FUNCTION casts work, avoidTom Lane2002-09-01
| | | | redundant pg_cast searches, fix obsolete comments.
* Code review for domain-constraints patch. Use a new ConstraintTest nodeTom Lane2002-08-31
| | | | | | | | | 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.
* Remove #ifdef MULTIBYTE per hackers list discussion.Tatsuo Ishii2002-08-29
|
* Code review for standalone composite types, query-specified compositeTom Lane2002-08-29
| | | | | types, SRFs. Not happy with memory management yet, but I'll commit these other changes.
* backend where a statically sized buffer is written to. Most of theseBruce Momjian2002-08-28
| | | | | | | | | | | 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
* Allow FOR UPDATE to appear after LIMIT/OFFSET to match MySQL syntax and asBruce Momjian2002-08-28
| | | | a more logical ordering.
* PREPARE/EXECUTE statements. Patch by Neil Conway, some kibitzingTom Lane2002-08-27
| | | | from Tom Lane.
* This patches replaces a few more usages of strcpy() and sprintf() whenBruce Momjian2002-08-27
| | | | | | | | 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
* Modify array operations to include array's element type OID in theTom Lane2002-08-26
| | | | | | | | | | 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.