aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
Commit message (Collapse)AuthorAge
...
* ALTER TABLE DROP COLUMN works. Patch by Christopher Kings-Lynne,Tom Lane2002-08-02
| | | | | | | | | | code review by Tom Lane. Remaining issues: functions that take or return tuple types are likely to break if one drops (or adds!) a column in the table defining the type. Need to think about what to do here. Along the way: some code review for recent COPY changes; mark system columns attnotnull = true where appropriate, per discussion a month ago.
* Instead of having a configure-time DEFAULT_ATTSTATTARGET, store -1 inTom Lane2002-07-31
| | | | | | | | attstattarget to indicate 'use the default'. The default is now a GUC variable default_statistics_target, and so may be changed on the fly. Along the way we gain the ability to have pg_dump dump the per-column statistics target when it's not the default. Patch by Neil Conway, with some kibitzing from Tom Lane.
* The attached patch removes the last remnants of support forBruce Momjian2002-07-30
| | | | | | | | 'tioga recipes', whatever those are -- Peter E. killed most of it a couple days ago, but this patch removes the rest. Most of it was #ifdef'ed out anyway. Neil Conway
* Centralize code for interpreting schema references, which had gottenTom Lane2002-07-29
| | | | | | copied more places than I first thought it would. This fixes a bug: a couple of these places were neglecting to enforce USAGE access on explicitly-referenced schemas.
* Implement CREATE/DROP OPERATOR CLASS. Work still remains: need moreTom Lane2002-07-29
| | | | | | | documentation (xindex.sgml should be rewritten), need to teach pg_dump about it, need to update contrib modules that currently build pg_opclass entries by hand. Original patch by Bill Studenmund, grammar adjustments and general update for 7.3 by Tom Lane.
* Remove unused system table columns:Peter Eisentraut2002-07-24
| | | | | | | | | | | | | | | | | | | | | | | | pg_language.lancompiler pg_operator.oprprec pg_operator.oprisleft pg_proc.proimplicit pg_proc.probyte_pct pg_proc.properbyte_cpu pg_proc.propercall_cpu pg_proc.prooutin_ratio pg_shadow.usetrace pg_type.typprtlen pg_type.typreceive pg_type.typsend Attempts to use the obsoleted attributes of pg_operator or pg_proc in the CREATE commands will be greeted by a warning. For pg_type, there is no warning (yet) because pg_dump scripts still contain these attributes. Also remove new but already obsolete spellings isVolatile, isStable, isImmutable in WITH clause. (Use new syntax instead.)
* The attached patch fixes 2 trivial warnings generated by bison 1.35,Bruce Momjian2002-07-20
| | | | | | as a result of Peter's recent CREATE CAST changes. Neil Conway
* Manually apply part of oid patch that didn't apply cleanly.Bruce Momjian2002-07-20
|
* oid is needed, it is added at the end of the struct (after the nullBruce Momjian2002-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bitmap, if present). Per Tom Lane's suggestion the information whether a tuple has an oid or not is carried in the tuple descriptor. For debugging reasons tdhasoid is of type char, not bool. There are predefined values for WITHOID, WITHOUTOID and UNDEFOID. This patch has been generated against a cvs snapshot from last week and I don't expect it to apply cleanly to current sources. While I post it here for public review, I'm working on a new version against a current snapshot. (There's been heavy activity recently; hope to catch up some day ...) This is a long patch; if it is too hard to swallow, I can provide it in smaller pieces: Part 1: Accessor macros Part 2: tdhasoid in TupDesc Part 3: Regression test Part 4: Parameter withoid to heap_addheader Part 5: Eliminate t_oid from HeapTupleHeader Part 2 is the most hairy part because of changes in the executor and even in the parser; the other parts are straightforward. Up to part 4 the patched postmaster stays binary compatible to databases created with an unpatched version. Part 5 is small (100 lines) and finally breaks compatibility. Manfred Koizar
* pg_cast table, and standards-compliant CREATE/DROP CAST commands, plusPeter Eisentraut2002-07-18
| | | | | | | | | | | extension to create binary compatible casts. Includes dependency tracking as well. pg_proc.proimplicit is now defunct, but will be removed in a separate commit. pg_dump provides a migration path from the previous scheme to declare casts. Dumping binary compatible casts is currently impossible, though.
* Back out BETWEEN node patch, was causing initdb failure.Bruce Momjian2002-07-18
|
* Implement DROP SCHEMA. It lacks support for dropping conversions andTom Lane2002-07-18
| | | | | operator classes, both of which are schema-local and so should really be droppable.
* The attached patch (against HEAD) implementsBruce Momjian2002-07-18
| | | | | | | | | | | | | | | COPY x (a,d,c,b) from stdin; COPY x (a,c) to stdout; as well as the corresponding changes to pg_dump to use the new functionality. This functionality is not available when using the BINARY option. If a column is not specified in the COPY FROM statement, its default values will be used. In addition to this functionality, I tweaked a couple of the error messages emitted by the new COPY <options> checks. Brent Verner
* Finished the Between patch Christopher started.Bruce Momjian2002-07-18
| | | | | | | | | | | | Implements between (symmetric / asymmetric) as a node. Executes the left or right expression once, makes a Const out of the resulting Datum and executes the >=, <= portions out of the Const sets. Of course, the parser does a fair amount of preparatory work for this to happen. Rod Taylor
* I have committed many support files for CREATE CONVERSION. DefaultTatsuo Ishii2002-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | conversion procs and conversions are added in initdb. Currently supported conversions are: UTF-8(UNICODE) <--> SQL_ASCII, ISO-8859-1 to 16, EUC_JP, EUC_KR, EUC_CN, EUC_TW, SJIS, BIG5, GBK, GB18030, UHC, JOHAB, TCVN EUC_JP <--> SJIS EUC_TW <--> BIG5 MULE_INTERNAL <--> EUC_JP, SJIS, EUC_TW, BIG5 Note that initial contents of pg_conversion system catalog are created in the initdb process. So doing initdb required is ideal, it's possible to add them to your databases by hand, however. To accomplish this: psql -f your_postgresql_install_path/share/conversion_create.sql your_database So I did not bump up the version in cataversion.h. TODO: Add more conversion procs Add [CASCADE|RESTRICT] to DROP CONVERSION Add tuples to pg_depend Add regression tests Write docs Add SQL99 CONVERT command? -- Tatsuo Ishii
* Add more dependency insertions --- this completes the basic pg_dependTom Lane2002-07-16
| | | | | functionality. Of note: dropping a table that has a SERIAL column defined now drops the associated sequence automatically.
* Add COMMENT ON CONSTRAINT facility (from Rod Taylor's pg_constraint patch).Tom Lane2002-07-14
| | | | | Fix comment.c to not depend on parser token values, per discussion awhile back.
* Second phase of committing Rod Taylor's pg_depend/pg_constraint patch.Tom Lane2002-07-12
| | | | | | | | | | | | pg_relcheck is gone; CHECK, UNIQUE, PRIMARY KEY, and FOREIGN KEY constraints all have real live entries in pg_constraint. pg_depend exists, and RESTRICT/CASCADE options work on most kinds of DROP; however, pg_depend is not yet very well populated with dependencies. (Most of the ones that are present at this point just replace formerly hardwired associations, such as the implicit drop of a relation's pg_type entry when the relation is dropped.) Need to add more logic to create dependency entries, improve pg_dump to dump constraints in place of indexes and triggers, and add some regression tests.
* Add new CREATE CONVERSION/DROP CONVERSION command.Tatsuo Ishii2002-07-11
| | | | | | | This is the first cut toward CREATE CONVERSION/DROP CONVERSION implementaion. The commands can now add/remove tuples to the new pg_conversion system catalog, but that's all. Still need work to make them actually working. Documentations, regression tests also need work.
* Oops, proper initialization for domainTypMod was none at all, not 0.Bruce Momjian2002-07-09
|
* Fix compiler warning:Bruce Momjian2002-07-09
| | | | | | | | int32 domainTypMod = NULL; should be: int32 domainTypMod = 0;
* I've fixed up the way domain constraints (not null and type length)Bruce Momjian2002-07-06
| | | | | | | | | | | are managed as per request. Moved from merging with table attributes to applying themselves during coerce_type() and coerce_type_typmod. Regression tests altered to test the cast() scenarios. Rod Taylor
* Implement the IS DISTINCT FROM operator per SQL99.Thomas G. Lockhart2002-07-04
| | | | | | | | | | | | | | | | Reused the Expr node to hold DISTINCT which strongly resembles the existing OP info. Define DISTINCT_EXPR which strongly resembles the existing OPER_EXPR opType, but with handling for NULLs required by SQL99. We have explicit support for single-element DISTINCT comparisons all the way through to the executor. But, multi-element DISTINCTs are handled by expanding into a comparison tree in gram.y as is done for other row comparisons. Per discussions, it might be desirable to move this into one or more purpose-built nodes to be handled in the backend. Define the optional ROW keyword and token per SQL99. This allows single-element row constructs, which were formerly disallowed due to shift/reduce conflicts with parenthesized a_expr clauses. Define the SQL99 TREAT() function. Currently, use as a synonym for CAST().
* First phase of applying Rod Taylor's pg_depend patch. This just addsTom Lane2002-07-01
| | | | | | | RESTRICT/CASCADE syntax to the DROP commands that need it, and propagates the behavioral option through the parser to the routines that execute drops. Doesn't do anything useful yet, but I figured I'd commit these changes so I could get out of the parser area while working on the rest.
* Implement SQL99 CREATE CAST and DROP CAST statements.Thomas G. Lockhart2002-06-22
| | | | | | | | | | | | | | | | | Also implement alternative forms to expose the PostgreSQL CREATE FUNCTION features. Implement syntax for READ ONLY and READ WRITE clauses in SET TRANSACTION. READ WRITE is already implemented (of course). Implement syntax for "LIKE table" clause in CREATE TABLE. Should be fairly easy to complete since it resembles SELECT INTO. Implement MATCH SIMPLE clause for foreign key definitions. This is explicit SQL99 syntax for the default behavior, so we now support it :) Start implementation of shorthand for national character literals in scanner. For now, just swallow the leading "N", but sometime soon let's figure out how to pass leading type info from the scanner to the parser. We should use the same technique for binary and hex bit string literals, though it might be unusual to have two apparently independent literal types fold into the same storage type.
* Update copyright to 2002.Bruce Momjian2002-06-20
|
* Improve COPY syntax to use WITH clause, keep backward compatibility.Bruce Momjian2002-06-20
|
* Properly mark rules that return no value.Bruce Momjian2002-06-19
|
* Wrap long gram.y lines.Bruce Momjian2002-06-18
|
* Change CREATE DATABASE to use DefElem instead of constructing structureBruce Momjian2002-06-18
| | | | | members in gram.y. This is the prefered method for WITH and arbitrary param/value pairs.
* Improve rule action ordering in gram.y, more cleanups.Bruce Momjian2002-06-18
|
* Mark noise keyword actions with {} rather than returning TRUE, likeBruce Momjian2002-06-17
| | | | opt_with and from_in.
* Manually indent gram.y to be consistent.Bruce Momjian2002-06-17
|
* Merge ALTER GROUP ADD/DROP rules by creating add_drop action.Bruce Momjian2002-06-17
|
* Simplify optional WITH handling in CREATE USER, ALTER USER, CREATEBruce Momjian2002-06-17
| | | | GROUP. Make WITH optional in CREATE DATABASE for consistency.
* Add LOCALTIME and LOCALTIMESTAMP functions per SQL99 standard.Thomas G. Lockhart2002-06-15
| | | | | | | | | | | Remove ODBC-compatible empty parentheses from calls to SQL99 functions for which these parentheses do not match the standard. Update the ODBC driver to ensure compatibility with the ODBC standard for these functions (e.g. CURRENT_TIMESTAMP, CURRENT_USER, etc). Include a new appendix in the User's Guide which lists the labeled features for SQL99 (the labeled features replaced the "basic", "intermediate", and "advanced" categories from SQL92). features.sgml does not yet split this list into "supported" and "unsupported" lists.
* Add PLACING to the list of reserved keywords. Added as a token in the lastThomas G. Lockhart2002-06-13
| | | | update to support the new OVERLAY() function.
* Repair for bug #691 --- CREATE TABLE AS column aliases fail to beTom Lane2002-06-13
| | | | | | | | | applied when the select is a UNION (or other set-operation). An alternative route to a fix would be to leave analyze.c alone and change plan_set_operations in prepunion.c to take column names from the topmost targetlist. But I am not sure that would work in all cases. This patch seems the minimum-risk fix.
* Implement SQL99 OVERLAY(). Allows substitution of a substring in a string.Thomas G. Lockhart2002-06-11
| | | | | | | | | | | Implement SQL99 SIMILAR TO as a synonym for our existing operator "~". Implement SQL99 regular expression SUBSTRING(string FROM pat FOR escape). Extend the definition to make the FOR clause optional. Define textregexsubstr() to actually implement this feature. Update the regression test to include these new string features. All tests pass. Rename the regular expression support routines from "pg95_xxx" to "pg_xxx". Define CREATE CHARACTER SET in the parser per SQL99. No implementation yet.
* Katherine Ward wrote:Jan Wieck2002-06-11
| | | | | | | | | | | | | | > Changes to avoid collisions with WIN32 & MFC names... > 1. Renamed: > a. PROC => PGPROC > b. GetUserName() => GetUserNameFromId() > c. GetCurrentTime() => GetCurrentDateTime() > d. IGNORE => IGNORE_DTF in include/utils/datetime.h & utils/adt/datetim > > 2. Added _P to some lex/yacc tokens: > CONST, CHAR, DELETE, FLOAT, GROUP, IN, OUT Jan
* In default nextval('foo') expression for a SERIAL column, use doubleTom Lane2002-05-28
| | | | quotes only when necessary.
* Add optional "validator" function to languages that can validate thePeter Eisentraut2002-05-22
| | | | | | | | | | | | function body (and other properties) as a function in the language is created. This generalizes ad hoc code that already existed for the built-in languages. The validation now happens after the pg_proc tuple of the new function is created, so it is possible to define recursive SQL functions. Add some regression test cases that cover bogus function definition attempts.
* Restructure indexscan API (index_beginscan, index_getnext) perTom Lane2002-05-20
| | | | | | | yesterday's proposal to pghackers. Also remove unnecessary parameters to heap_beginscan, heap_rescan. I modified pg_proc.h to reflect the new numbers of parameters for the AM interface routines, but did not force an initdb because nothing actually looks at those fields.
* Reorder keyword token declarations alphabetically. Status of the keywordsPeter Eisentraut2002-05-19
| | | | in the various standards can be found in the documentation these days.
* Teach query_tree_walker, query_tree_mutator, and SS_finalize_plan toTom Lane2002-05-18
| | | | | | | | process function RTE expressions, which they were previously missing. This allows outer-Var references and subselects to work correctly in the arguments of a function RTE. Install check to prevent function RTEs from cross-referencing Vars of sibling FROM-items, which doesn't make any sense (if you want to join, write a JOIN or WHERE clause).
* Get rid of the last few uses of typeidTypeName() rather thanTom Lane2002-05-17
| | | | format_type_be() in error messages.
* Extend syntax of CREATE FUNCTION to resemble SQL99.Peter Eisentraut2002-05-17
|
* Merge the last few variable.c configuration variables into the genericTom Lane2002-05-17
| | | | | | | | | GUC support. It's now possible to set datestyle, timezone, and client_encoding from postgresql.conf and per-database or per-user settings. Also, implement rollback of SET commands that occur in a transaction that later fails. Create a SET LOCAL var = value syntax that sets the variable only for the duration of the current transaction. All per previous discussions in pghackers.
* Make operators have their own comments separate from those of theTom Lane2002-05-13
| | | | | | | underlying function; but cause psql's \do to show the underlying function's comment if the operator has no comment of its own, to preserve the useful functionality of the original behavior. Also, implement COMMENT ON SCHEMA. Patch from Rod Taylor.
* Get rid of long-since-vestigial Iter node type, in favor of adding aTom Lane2002-05-12
| | | | | | | returns-set boolean field in Func and Oper nodes. This allows cleaner, more reliable tests for expressions returning sets in the planner and parser. For example, a WHERE clause returning a set is now detected and complained of in the parser, not only at runtime.