summaryrefslogtreecommitdiff
path: root/src/backend/commands
AgeCommit message (Collapse)Author
2002-03-08Fix copying/equality-check bugs in GrantStmt and ConstraintsSetStmt,Tom Lane
per reports from Fernando Nasser. Also, rearrange order of declarations in parsenodes.h as suggested by Fernando.
2002-03-07Back out domain patch until it works properly.Bruce Momjian
2002-03-06Ok. Updated patch attached.Bruce Momjian
- 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
2002-03-06Modify ALTER TABLE OWNER to change index ownership; code cleanup.Bruce Momjian
Neil Conway
2002-03-06Change made to elog:Bruce Momjian
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.
2002-03-05I attach a version of my toast-slicing patch, against current CVSBruce Momjian
(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
2002-03-03Catcaches can now store negative entries as well as positive ones, toTom Lane
speed up repetitive failed searches; per pghackers discussion in late January. inval.c logic substantially simplified, since we can now treat inserts and deletes alike as far as inval events are concerned. Some repair work needed in heap_create_with_catalog, which turns out to have been doing CommandCounterIncrement at a point where the new relation has non-self-consistent catalog entries. With the new inval code, that resulted in assert failures during a relcache entry rebuild.
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-27Clean up BeginCommand and related routines. BeginCommand and EndCommandTom Lane
are now both invoked once per received SQL command (raw parsetree) from pg_exec_query_string. BeginCommand is actually just an empty routine at the moment --- all its former operations have been pushed into tuple receiver setup routines in printtup.c. This makes for a clean distinction between BeginCommand/EndCommand (once per command) and the tuple receiver setup/teardown routines (once per ExecutorRun call), whereas the old code was quite ad hoc. Along the way, clean up the calling conventions for ExecutorRun a little bit.
2002-02-27Fix bug in COPY FROM when DELIMITER is not in ASCII range.Tatsuo Ishii
See pgsql-bugs/pgsql-hackers discussion "COPY FROM is not 8bit clean" around 2002/02/26 for more details -- Tatsuo Ishii
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-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-24pgindent copy.c. Patch wasn't in proper format.Bruce Momjian
2002-02-24Free files on dir open failure in COPY.Bruce Momjian
2002-02-23Add fstat / S_ISDIR checks to make sure we're not trying to use aBruce Momjian
directory for COPY TO/FROM. Brent Verner
2002-02-23Guard against createdb --location=PGDATA foo; without this, the codeTom Lane
tries to create a symlink pointing at itself. Per trouble report from Kenneth McDowell.
2002-02-23Save source of GUC settings, allowing different sources to be processed inPeter Eisentraut
any order without affecting results.
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-18Replace number-of-distinct-values estimator equation, per recentTom Lane
pghackers discussion.
2002-02-14Ensure that a cursor is scanned under the same scanCommandId it wasTom Lane
originally created with, so that the set of visible tuples does not change as a result of other activity. This essentially makes PG cursors INSENSITIVE per the SQL92 definition. See bug report of 13-Feb-02.
2002-02-12Modify COPY TO to emit carriage returns and newlines as backslash escapesTom Lane
(backslash-r, backslash-n) for protection against newline-conversion munging. In future we will also tweak COPY FROM, but this part of the change should be backwards-compatible. Per pghackers discussion. Also, update COPY reference page to describe the backslash conversions more completely and accurately.
2002-01-15Fix typo that caused equalTriggerDescs() to return false in cases whereTom Lane
the two trigger sets were logically equal, but not in the same order. Caught by Holger Krug (hkrug@rationalizer.com).
2002-01-11Fix sequence creation to set the t_xmin of a sequence's tuple toTom Lane
FrozenTransactionId, not the XID of the creating transaction. Without this it's possible for a reference to a long-gone CLOG record to occur, per Christian Meunier's bug report of 10-Jan-02. Worse, the sequence tuple would become invisible to SELECTs after 2 billion transactions. Since the fix is applied during sequence creation it does not help existing databases, unless you drop and recreate every sequence. However, we intend to force initdb for 7.2RC1 anyway, to fix a pg_proc error, so I see no need to do more for this problem.
2002-01-06Add CHECK_FOR_INTERRUPTS() in various strategic spots, per commentsTom Lane
from Hiroshi.
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-09Honor the typmod field for time zone intervals.Thomas G. Lockhart
2001-12-04Enforce restriction that COPY DELIMITERS string must be exactly oneTom Lane
character; replace strchr() search with simple comparison to speed up COPY IN. Per discussion in pghackers.
2001-12-04Replace pq_getbytes(&ch, 1) calls with pq_getbyte(), which is easierTom Lane
to use and significantly faster. This tweak saves 25% (!) of the runtime of COPY IN in a test with 8000-character lines. I wouldn't normally commit a performance improvement this late in the cycle, but 25% got my attention...
2001-12-04Remove now-dead code for processing CONSTR_UNIQUE nodes inTom Lane
AlterTableAddConstraint. Earlier reorganization of the parser's processing of ALTER TABLE means that these node types no longer get here.
2001-11-21Allow 'PostgreSQL' as a date/time formatting style. Formerly, recognizedThomas G. Lockhart
'Postgres' only, but now accepts both.
2001-11-20Some minor tweaks of REINDEX processing: grab exclusive lock a littleREL7_2_BETA3Tom Lane
earlier, make error checks more uniform.
2001-11-16Remove 'triggered data change violation' error check, per recentTom Lane
discussions in pghackers.
2001-11-12Indent new rename.c for Tom Lane.Bruce Momjian
2001-11-12Make ALTER TABLE RENAME update foreign-key trigger arguments correctly.Tom Lane
Brent Verner, with review and kibitzing from Tom Lane.
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-05New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian
initdb/regression tests pass.
2001-11-04Merge three existing ways of signaling postmaster from child processes,Tom Lane
so that only one signal number is used not three. Flags in shared memory tell the reason(s) for the current signal. This method is extensible to handle more signal reasons without chewing up even more signal numbers, but the immediate reason is to keep pg_pwd reloads separate from SIGHUP processing in the postmaster. Also clean up some problems in the postmaster with delayed response to checkpoint status changes --- basically, it wouldn't schedule a checkpoint if it wasn't getting connection requests on a regular basis.
2001-11-02Fix pg_pwd caching mechanism, which was broken by changes to forkTom Lane
postmaster children before client auth step. Postmaster now rereads pg_pwd on receipt of SIGHUP, the same way that pg_hba.conf is handled. No cycles need be expended to validate password cache validity during connection startup.
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-11-01Reject tabs and linefeeds in usernames and passwords that are beingTom Lane
stored in pg_pwd, to guard against failures of the sort observed by Tom Yackel. Note: in the case of encrypted passwords this is no restriction, since the string we are interested in is the MD5 hash.
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-25Fix a couple of places where lack of parenthesization of a castTom Lane
causes pgindent to make weird formatting decisions. Easiest fix seems to be to put in the extra parens...
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-10-24Allow concurrent index creation for the same table.Hiroshi Inoue
2001-10-23Fix foreign keys on system columns.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-13Mention createlang when language not installed, per problem report.Bruce Momjian