summaryrefslogtreecommitdiff
path: root/src/backend/parser
AgeCommit message (Collapse)Author
2002-03-02Commit to match discussed elog() changes. Only update is that LOG isBruce Momjian
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
2002-03-01User and database-specific session defaults for run-time configurationPeter Eisentraut
variables. New commands ALTER DATABASE ... SET and ALTER USER ... SET.
2002-02-26Restructure command-completion-report code so that there is just oneTom Lane
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.
2002-02-25This patch will allow arbitrary levels of analyze / rewritingBruce Momjian
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
2002-02-25Re-add equals documentation with CREATE DATABASE.Bruce Momjian
2002-02-25Remove documentation of equals in CREATE DATABASE. Mention removal ofBruce Momjian
equals hack for the future.
2002-02-24Add OWNER option to CREATE DATABASE, so superusers can create databasesTom Lane
on behalf of unprivileged users. Also, make '=' optional in CREATE DATABASE syntax. From Gavin Sherry, with kibitzing and docs by Tom Lane.
2002-02-19A bunch of changes aimed at reducing backend startup time...Tom Lane
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).
2002-02-18Privileges on functions and procedural languagesPeter Eisentraut
2002-02-18Disable LIMIT #,# syntax, as agreed to months ago. Print message sayingBruce Momjian
to use separate LIMIT/OFFSET clauses.
2002-01-03Require ownership permission for CREATE INDEX, per bug report.Tom Lane
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.
2001-12-12Don't accept names of complex types (ie, relation types) as beingTom Lane
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
2001-12-09Allow variable (unrestricted) precision for TIME and TIMESTAMP types in parser.Thomas G. Lockhart
2001-11-16Make the yacc rules safe for parallel make. See discussion on pgsql-patchesPeter Eisentraut
and comment in src/backend/parser/Makefile for the technical details.
2001-11-16Update keyword lists per suggestions by Peter. There are now fourTom Lane
mutually exclusive keyword lists spanning all known keywords --- including AS. Moved COALESCE and a few other ColLabels into the can-be-ColId list.
2001-11-12Tweak parser so that there is a defined representation for datatypesTom Lane
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.
2001-11-12If the alternatives for a CASE construct all have the same typmod,Tom Lane
use that typmod not -1 as the typmod of the CASE result. Part of response to bug#513.
2001-11-12Clean up a bunch of ScanKeyEntryInitialize calls that weren't botheringTom Lane
to apply the proper Datum conversion macros to search key values.
2001-11-10Allow TIMESTAMP, VARCHAR, et al to be used as unquoted column names,Tom Lane
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.
2001-11-05New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian
initdb/regression tests pass.
2001-11-05CREATE TABLE foo (x,y,z) AS SELECT ... can't apply target column namesTom Lane
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
2001-11-04Got "ADD" to appear only in ALTER TABLE and not CREATE TABLEBruce Momjian
UNIQUE-PRIMARY KEY notice message. This is what Christopher wanted from his patch.
2001-11-04Remove "ADD" from TABLE / ADD UNIQUE-PRIMARY error message because theBruce Momjian
same code is called for both creation and alter. Not worth worrying about.
2001-11-02Add default expressions to INSERTs during planning, not during parseTom Lane
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.
2001-11-02Fix problem reported by Alex Korn: if a relation has been dropped andTom Lane
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.
2001-10-31Add ALTER TABLE ADD UNIQUE regression tests from Christopher Kings-Lynne.Bruce Momjian
Add space between slash for ALTER TABLE / ADD .... Regression and *.po updates to follow.
2001-10-28Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian
spacing. Also adds space for one-line comments.
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-10-23Fix foreign keys on system columns.Tom Lane
2001-10-23Now I had them reversed. Wow that syntax is error-prone.Bruce Momjian
2001-10-23Syntax fix. Can't use #ifdef in gram.y.Bruce Momjian
2001-10-23Back out LIMIT #,# removal and mark it as to-be-removed in 7.3.Bruce Momjian
2001-10-22Cause transformIndexConstraints() to do the right thing with requestsTom Lane
for indexes on system columns. Per complaint from Peter.
2001-10-22Consolidate tables of known system attributes into one table.Tom Lane
2001-10-20Change LIMIT #,# error message to be more generic.Bruce Momjian
2001-10-20Remove LIMIT #,# and suggest LIMIT # OFFSET #, per mailing list discussion.Bruce Momjian
2001-10-20Fix transposed arguments for typmod for one INTERVAL production.Thomas G. Lockhart
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.
2001-10-18Spell 'between' correctly, clean up spacing in error messages.Tom Lane
2001-10-18Accept an INTERVAL argument for SET TIME ZONE per SQL99.Thomas G. Lockhart
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.
2001-10-12Break transformCreateStmt() into multiple routines and makeTom Lane
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.
2001-10-10Remove gratuitous discrepancy between extract() and date_part(),Peter Eisentraut
regarding timezone_hour, timezone_minute vs. tz_hour, tz_minute. Document the former.
2001-10-09Allow optional () after current_user, session_user, user, current_time,Peter Eisentraut
current_timestamp, current_date for ODBC compatibility. Add more functions to odbc.sql catalog extension, use new CREATE OR REPLACE FUNCTION. Document iODBC/unixODBC build options.
2001-10-09Change plpgsql to depend on main parser's type-declaration grammar,Tom Lane
rather than having its own somewhat half-baked notion of what a type declaration looks like. This is necessary now to ensure that plpgsql will think a 'timestamp' variable has the same semantics as 'timestamp' does in the main SQL grammar; and it should avoid divergences in future.
2001-10-08Another go-round with FigureColname, to produce less surprising resultsTom Lane
for nested typecasts. It now produces a column header of 'timestamptz' for 'SELECT CURRENT_TIMESTAMP', rather than 'text' as it was doing for awhile there.
2001-10-08Fix transformExpr() to not scribble on its input datastructure whileTom Lane
transforming CASE expressions. This was definitely confusing FigureColname, and might lead to bad things elsewhere as well.
2001-10-08Remove redundant code, update comments, cause CURRENT_TIME toTom Lane
agree with CURRENT_TIME(n).
2001-10-05Implement explicit date/time precision per SQL99 spec.Thomas G. Lockhart
Use CAST() mechanism to define CURRENT_TIME and CURRENT_TIMESTAMP.
2001-10-04Consider interpreting a function call as a trivial (binary-compatible)Tom Lane
type coercion after failing to find an exact match in pg_proc, but before considering interpretations that involve a function call with one or more argument type coercions. This avoids surprises wherein what looks like a type coercion is interpreted as coercing to some third type and then to the destination type, as in Dave Blasby's bug report of 3-Oct-01. See subsequent discussion in pghackers.
2001-10-04Make the world safe for atttypmod=0 ... this didn't use to mean anything,Tom Lane
but timestamp now wants it to mean something.
2001-10-03DROP AGGREGATE and COMMENT ON AGGREGATE now accept the expected syntaxTom Lane
'aggname (aggtype)'. The old syntax 'aggname aggtype' is still accepted for backwards compatibility. Fix pg_dump, which was actually broken for most cases of user-defined aggregates. Clean up error messages associated with these commands.