aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
Commit message (Collapse)AuthorAge
* Add DEFAULT_INDEX_TYPE == "btree", for clarity.Bruce Momjian2002-03-10
|
* Disable brackets in multi-statement rules, as discussed.Bruce Momjian2002-03-10
|
* Guard against NULL strings in SET key=val constructs.Thomas G. Lockhart2002-03-09
| | | | Problem noted by Fernando Nasser.
* analyze.o need not depend on parser.h.Tom Lane2002-03-08
|
* Remove unnecessary inclusion.Tom Lane2002-03-08
|
* Fix copying/equality-check bugs in GrantStmt and ConstraintsSetStmt,Tom Lane2002-03-08
| | | | | per reports from Fernando Nasser. Also, rearrange order of declarations in parsenodes.h as suggested by Fernando.
* Back out domain patch until it works properly.Bruce Momjian2002-03-07
|
* Ok. Updated patch attached.Bruce Momjian2002-03-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - domain.patch -> source patch against pgsql in cvs - drop_domain.sgml and create_domain.sgml -> New doc/src/sgml/ref docs - dominfo.txt -> basic domain related queries I used for testing [ ADDED TO /doc] Enables domains of array elements -> CREATE DOMAIN dom int4[3][2]; Uses a typbasetype column to describe the origin of the domain. Copies data to attnotnull rather than processing in execMain(). Some documentation differences from earlier. If this is approved, I'll start working on pg_dump, and a \dD <domain> option in psql, and regression tests. I don't really feel like doing those until the system table structure settles for pg_type. CHECKS when added, will also be copied to to the table attributes. FK Constraints (if I ever figure out how) will be done similarly. Both will lbe handled by MergeDomainAttributes() which is called shortly before MergeAttributes(). Rod Taylor
* Change made to elog:Bruce Momjian2002-03-06
| | | | | | | | | | | | | | | | | | | o Change all current CVS messages of NOTICE to WARNING. We were going to do this just before 7.3 beta but it has to be done now, as you will see below. o Change current INFO messages that should be controlled by client_min_messages to NOTICE. o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc. to always go to the client. o Remove INFO from the client_min_messages options and add NOTICE. Seems we do need three non-ERROR elog levels to handle the various behaviors we need for these messages. Regression passed.
* I attach a version of my toast-slicing patch, against current CVSBruce Momjian2002-03-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (current as of a few hours ago.) This patch: 1. Adds PG_GETARG_xxx_P_SLICE() macros and associated support routines. 2. Adds routines in src/backend/access/tuptoaster.c for fetching only necessary chunks of a toasted value. (Modelled on latest changes to assume chunks are returned in order). 3. Amends text_substr and bytea_substr to use new methods. It now handles multibyte cases -and should still lead to a performance improvement in the multibyte case where the substring is near the beginning of the string. 4. Added new command: ALTER TABLE tabname ALTER COLUMN colname SET STORAGE {PLAIN | EXTERNAL | EXTENDED | MAIN} to parser and documented in alter-table.sgml. (NB I used ColId as the item type for the storage mode string, rather than a new production - I hope this makes sense!). All this does is sets attstorage for the specified column. 4. AlterTableAlterColumnStatistics is now AlterTableAlterColumnFlags and handles both statistics and storage (it uses the subtype code to distinguish). The previous version of my patch also re-arranged other code in backend/commands/command.c but I have dropped that from this patch.(I plan to return to it separately). 5. Documented new macros (and also the PG_GETARG_xxx_P_COPY macros) in xfunc.sgml. ref/alter_table.sgml also contains documentation for ALTER COLUMN SET STORAGE. John Gray
* Commit to match discussed elog() changes. Only update is that LOG isBruce Momjian2002-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | now just below FATAL in server_min_messages. Added more text to highlight ordering difference between it and client_min_messages. --------------------------------------------------------------------------- REALLYFATAL => PANIC STOP => PANIC New INFO level the prints to client by default New LOG level the prints to server log by default Cause VACUUM information to print only to the client NOTICE => INFO where purely information messages are sent DEBUG => LOG for purely server status messages DEBUG removed, kept as backward compatible DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1 added DebugLvl removed in favor of new DEBUG[1-5] symbols New server_min_messages GUC parameter with values: DEBUG[5-1], INFO, NOTICE, ERROR, LOG, FATAL, PANIC New client_min_messages GUC parameter with values: DEBUG[5-1], LOG, INFO, NOTICE, ERROR, FATAL, PANIC Server startup now logged with LOG instead of DEBUG Remove debug_level GUC parameter elog() numbers now start at 10 Add test to print error message if older elog() values are passed to elog() Bootstrap mode now has a -d that requires an argument, like postmaster
* User and database-specific session defaults for run-time configurationPeter Eisentraut2002-03-01
| | | | variables. New commands ALTER DATABASE ... SET and ALTER USER ... SET.
* Restructure command-completion-report code so that there is just oneTom Lane2002-02-26
| | | | | | | report for each received SQL command, regardless of rewriting activity. Also ensure that this report comes from the 'original' command, not the last command generated by rewrite; this fixes 7.2 breakage for INSERT commands that have actions added by rules. Fernando Nasser and Tom Lane.
* This patch will allow arbitrary levels of analyze / rewritingBruce Momjian2002-02-25
| | | | | | | | | | | | | | | | | | by making the static variables extra_before and extra_after automatic so we can use recursion. It gets much easier to generate extra commands now, and one can rest assured that the extra commands will be properly analyzed/rewritten. Without this patch, if a command produced by transformation tries to use these static lists their first contents would be lost with unpredictable results. I know I could fix this by just using nconc() instead of assignments, but the resulting order of the commands would not be exactly what one could expect. -- Fernando Nasser
* Re-add equals documentation with CREATE DATABASE.Bruce Momjian2002-02-25
|
* Remove documentation of equals in CREATE DATABASE. Mention removal ofBruce Momjian2002-02-25
| | | | equals hack for the future.
* Add OWNER option to CREATE DATABASE, so superusers can create databasesTom Lane2002-02-24
| | | | | on behalf of unprivileged users. Also, make '=' optional in CREATE DATABASE syntax. From Gavin Sherry, with kibitzing and docs by Tom Lane.
* A bunch of changes aimed at reducing backend startup time...Tom Lane2002-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | Improve 'pg_internal.init' relcache entry preload mechanism so that it is safe to use for all system catalogs, and arrange to preload a realistic set of system-catalog entries instead of only the three nailed-in-cache indexes that were formerly loaded this way. Fix mechanism for deleting out-of-date pg_internal.init files: this must be synchronized with transaction commit, not just done at random times within transactions. Drive it off relcache invalidation mechanism so that no special-case tests are needed. Cache additional information in relcache entries for indexes (their pg_index tuples and index-operator OIDs) to eliminate repeated lookups. Also cache index opclass info at the per-opclass level to avoid repeated lookups during relcache load. Generalize 'systable scan' utilities originally developed by Hiroshi, move them into genam.c, use in a number of places where there was formerly ugly code for choosing either heap or index scan. In particular this allows simplification of the logic that prevents infinite recursion between syscache and relcache during startup: we can easily switch to heapscans in relcache.c when and where needed to avoid recursion, so IndexScanOK becomes simpler and does not need any expensive initialization. Eliminate useless opening of a heapscan data structure while doing an indexscan (this saves an mdnblocks call and thus at least one kernel call).
* Privileges on functions and procedural languagesPeter Eisentraut2002-02-18
|
* Disable LIMIT #,# syntax, as agreed to months ago. Print message sayingBruce Momjian2002-02-18
| | | | to use separate LIMIT/OFFSET clauses.
* Require ownership permission for CREATE INDEX, per bug report.Tom Lane2002-01-03
| | | | | | | | | Disallow CREATE INDEX on system catalogs, non-tables (views, sequences, etc). Disallow CREATE/DROP TRIGGER on system catalogs, non-tables. Disallow ALTER TABLE ADD/DROP CONSTRAINT on system catalogs. Disallow FOREIGN KEY reference to non-table. None of these things can actually work in the present system structure, but the code was letting them pass without complaint.
* Don't accept names of complex types (ie, relation types) as beingTom Lane2001-12-12
| | | | | | | requests for implicit trivial coercions. Prevents sillinesses like this one: regression=# select x.int8_tbl.q1 from int8_tbl x; ERROR: fmgr_info: function 270997776: cache lookup failed
* Allow variable (unrestricted) precision for TIME and TIMESTAMP types in parser.Thomas G. Lockhart2001-12-09
|
* Make the yacc rules safe for parallel make. See discussion on pgsql-patchesPeter Eisentraut2001-11-16
| | | | and comment in src/backend/parser/Makefile for the technical details.
* Update keyword lists per suggestions by Peter. There are now fourTom Lane2001-11-16
| | | | | | mutually exclusive keyword lists spanning all known keywords --- including AS. Moved COALESCE and a few other ColLabels into the can-be-ColId list.
* Tweak parser so that there is a defined representation for datatypesTom Lane2001-11-12
| | | | | | | | | | | | bpchar, bit, numeric with typmod -1. Alter format_type so that this representation is printed when the typmod is -1. This ensures that tables having such columns can be pg_dump'd and reloaded correctly. Also, remove the rather useless and non-SQL-compliant default precision and scale for type NUMERIC. A numeric column declared as such (with no precision/scale) will now have typmod -1 which means that numeric values of any precision/scale can be stored in it, without conversion to a uniform scale. This seems significantly more useful than the former behavior. Part of response to bug #513.
* If the alternatives for a CASE construct all have the same typmod,Tom Lane2001-11-12
| | | | | use that typmod not -1 as the typmod of the CASE result. Part of response to bug#513.
* Clean up a bunch of ScanKeyEntryInitialize calls that weren't botheringTom Lane2001-11-12
| | | | to apply the proper Datum conversion macros to search key values.
* Allow TIMESTAMP, VARCHAR, et al to be used as unquoted column names,Tom Lane2001-11-10
| | | | | | though alas not as unquoted function names. De-reserve a bunch of keywords that could have been in ColId rather than ColLabel all along. Per recent proposal in pgsql-patches.
* New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian2001-11-05
| | | | initdb/regression tests pass.
* CREATE TABLE foo (x,y,z) AS SELECT ... can't apply target column namesTom Lane2001-11-05
| | | | | | | | | to the target list in gram.y; it must wait till after expansion of the target list in analyze.c. Per bug report 4-Nov: lx=# CREATE TABLE abc (a char, b char, c char); CREATE lx=# CREATE TABLE xyz (x, y, z) AS SELECT * FROM abc; ERROR: CREATE TABLE/AS SELECT has mismatched column count
* Got "ADD" to appear only in ALTER TABLE and not CREATE TABLEBruce Momjian2001-11-04
| | | | | UNIQUE-PRIMARY KEY notice message. This is what Christopher wanted from his patch.
* Remove "ADD" from TABLE / ADD UNIQUE-PRIMARY error message because theBruce Momjian2001-11-04
| | | | | same code is called for both creation and alter. Not worth worrying about.
* Add default expressions to INSERTs during planning, not during parseTom Lane2001-11-02
| | | | | | analysis. This keeps stored rules from prematurely absorbing default information, which is necessary for ALTER TABLE SET DEFAULT to work unsurprisingly with rules. See pgsql-bugs discussion 24-Oct-01.
* Fix problem reported by Alex Korn: if a relation has been dropped andTom Lane2001-11-02
| | | | | | | | | | | | | | | | | | recreated since the start of our transaction, our first reference to it errored out because we'd try to reuse our old relcache entry for it. Do this by accepting SI inval messages just before relcache search in heap_openr, so that dead relcache entries will be flushed before we search. Also, break heap_open/openr into two pairs of routines, relation_open(r) and heap_open(r). The relation_open routines make no tests on relkind and so can be used to open anything that has a pg_class entry. The heap_open routines are wrappers that add a relkind test to preserve their established behavior. Use the relation_open routines in several places that had various kluge solutions for opening rels that might be either heap or index rels. Also, remove the old 'heap stats' code that's been superseded by Jan's stats collector, and clean up some inconsistencies in error reporting between the different types of ALTER TABLE.
* Add ALTER TABLE ADD UNIQUE regression tests from Christopher Kings-Lynne.Bruce Momjian2001-10-31
| | | | | | Add space between slash for ALTER TABLE / ADD .... Regression and *.po updates to follow.
* Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian2001-10-28
| | | | spacing. Also adds space for one-line comments.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-25
| | | | tests pass.
* Fix foreign keys on system columns.Tom Lane2001-10-23
|
* Now I had them reversed. Wow that syntax is error-prone.Bruce Momjian2001-10-23
|
* Syntax fix. Can't use #ifdef in gram.y.Bruce Momjian2001-10-23
|
* Back out LIMIT #,# removal and mark it as to-be-removed in 7.3.Bruce Momjian2001-10-23
|
* Cause transformIndexConstraints() to do the right thing with requestsTom Lane2001-10-22
| | | | for indexes on system columns. Per complaint from Peter.
* Consolidate tables of known system attributes into one table.Tom Lane2001-10-22
|
* Change LIMIT #,# error message to be more generic.Bruce Momjian2001-10-20
|
* Remove LIMIT #,# and suggest LIMIT # OFFSET #, per mailing list discussion.Bruce Momjian2001-10-20
|
* Fix transposed arguments for typmod for one INTERVAL production.Thomas G. Lockhart2001-10-20
| | | | | | | | | | | | | | Mask both typmod subfields for INTERVAL to avoid setting the high bit, per dire warning from Tom Lane. Clear tmask for DTK_ISO_TIME case to avoid time zone troubles. Symptom reported by Tom Lane. Clean up checking for valid time zone info in output routine. This should now work for both SQL99 and Unix-style time zones. Put in explicit check for INTERVAL() typmod rounding to avoid accumulating cruft in the lower bits. Not sure that this helps, but we'll need to do something. The symptom is visible with a query like select interval(2) '10000 days 01:02:03.040506'; Regression tests are patched to repair the Tom Lane symptom, and all pass.
* Spell 'between' correctly, clean up spacing in error messages.Tom Lane2001-10-18
|
* Accept an INTERVAL argument for SET TIME ZONE per SQL99.Thomas G. Lockhart2001-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | Modified the parser and the SET handlers to use full Node structures rather than simply a character string argument. Implement INTERVAL() YEAR TO MONTH (etc) syntax per SQL99. Does not yet accept the goofy string format that goes along with, but this should be fairly straight forward to fix now as a bug or later as a feature. Implement precision for the INTERVAL() type. Use the typmod mechanism for both of INTERVAL features. Fix the INTERVAL syntax in the parser: opt_interval was in the wrong place. INTERVAL is now a reserved word, otherwise we get reduce/reduce errors. Implement an explicit date_part() function for TIMETZ. Should fix coersion problem with INTERVAL reported by Peter E. Fix up some error messages for date/time types. Use all caps for type names within message. Fix recently introduced side-effect bug disabling 'epoch' as a recognized field for date_part() etc. Reported by Peter E. (??) Bump catalog version number. Rename "microseconds" current transaction time field from ...Msec to ...Usec. Duh! date/time regression tests updated for reference platform, but a few changes will be necessary for others.
* Break transformCreateStmt() into multiple routines and makeTom Lane2001-10-12
| | | | | | | | | transformAlterStmt() use these routines, instead of having lots of duplicate (not to mention should-have-been-duplicate) code. Adding a column with a CHECK constraint actually works now, and the tests to reject unsupported DEFAULT and NOT NULL clauses actually fire now. ALTER TABLE ADD PRIMARY KEY works, modulo having to have created the column(s) NOT NULL already.