summaryrefslogtreecommitdiff
path: root/src/backend/utils
AgeCommit message (Collapse)Author
2003-10-03Add GUC parameter check_function_bodies to control whether validationTom Lane
of function bodies is done at CREATE FUNCTION time. This is normally true but can be set false to avoid problems with forward references, wrong schema search path, etc. This is just the backend patch, still need to adjust pg_dump to make use of it.
2003-10-02When dumping CREATE INDEX, must show opclass name if the opclass isn'tTom Lane
in the schema search path. Otherwise pg_dump doesn't correctly dump scenarios where a custom opclass is created in 'public' and then used by indexes in other schemas.
2003-10-01Repair RI trigger visibility problems (this time for sure ;-)) per recentTom Lane
discussion on pgsql-hackers: in READ COMMITTED mode we just have to force a QuerySnapshot update in the trigger, but in SERIALIZABLE mode we have to run the scan under a current snapshot and then complain if any rows would be updated/deleted that are not visible in the transaction snapshot.
2003-09-29The brackets aren't put on the CHECK constraints properly.Bruce Momjian
Before patch: test=# select pg_get_constraintdef(oid) from pg_constraint; pg_get_constraintdef ------------------------------------------------------------------------------------------------- CHECK (VALUE >= 0) CHECK ((((a)::text = 'asdf'::text) OR ((a)::text = 'fdsa'::text)) OR ((a)::text = 'dfd'::text)) PRIMARY KEY (b) FOREIGN KEY (a) REFERENCES test2(b) UNIQUE (b) (5 rows) test=# select pg_get_constraintdef(oid, true) from pg_constraint; pg_get_constraintdef ----------------------------------------------------------------------------------- CHECK VALUE >= 0 CHECK a::text = 'asdf'::text OR a::text = 'fdsa'::text OR a::text = 'dfd'::text PRIMARY KEY (b) FOREIGN KEY (a) REFERENCES test2(b) UNIQUE (b) (5 rows) After patch: test=# select pg_get_constraintdef(oid) from pg_constraint; pg_get_constraintdef ------------------------------------------------------------------------------------------------- CHECK (VALUE >= 0) CHECK ((((a)::text = 'asdf'::text) OR ((a)::text = 'fdsa'::text)) OR ((a)::text = 'dfd'::text)) PRIMARY KEY (b) FOREIGN KEY (a) REFERENCES test2(b) UNIQUE (b) (5 rows) test=# select pg_get_constraintdef(oid, true) from pg_constraint; pg_get_constraintdef ----------------------------------------------------------------------------------- CHECK (VALUE >= 0) ` CHECK (a::text = 'asdf'::text OR a::text = 'fdsa'::text OR a::text = 'dfd'::text) PRIMARY KEY (b) FOREIGN KEY (a) REFERENCES test2(b) UNIQUE (b) (5 rows) It's important that those brackets are there to (a) match all other constraints and (b) so that people can just copy and paste them and it will work as SQL. Christopher Kings-Lynne
2003-09-29More message editing, some suggested by Alvaro HerreraPeter Eisentraut
2003-09-28Now that we have UPDATE tab SET col = DEFAULT, get rid of horrid hackTom Lane
in the RI triggers for ON DELETE/UPDATE SET DEFAULT. The code depended way too much on knowledge of plan structure, and yet still would fail if the generated query got rewritten by rules.
2003-09-27You can't NLS-enable a program component by just putting gettext() aroundPeter Eisentraut
every string, especially if some of the output should be fixed-format machine-readable. This needs to be more carefully sorted out. Also, make the help message generated by --help-config -h be more similar in style to the others.
2003-09-26Various message fixes, among those fixes for the previous round of fixesPeter Eisentraut
2003-09-25Get rid of ReferentialIntegritySnapshotOverride by extending Executor APITom Lane
to allow es_snapshot to be set to SnapshotNow rather than a query snapshot. This solves a bug reported by Wade Klaver, wherein triggers fired as a result of RI cascade updates could misbehave.
2003-09-25Message editing: remove gratuitous variations in message wording, standardizePeter Eisentraut
terms, add some clarifications, fix some untranslatable attempts at dynamic message building.
2003-09-24Repair some REINDEX problems per recent discussions. The relcache isTom Lane
now able to cope with assigning new relfilenode values to nailed-in-cache indexes, so they can be reindexed using the fully crash-safe method. This leaves only shared system indexes as special cases. Remove the 'index deactivation' code, since it provides no useful protection in the shared- index case. Require reindexing of shared indexes to be done in standalone mode, but remove other restrictions on REINDEX. -P (IgnoreSystemIndexes) now prevents using indexes for lookups, but does not disable index updates. It is therefore safe to allow from PGOPTIONS. Upshot: reindexing system catalogs can be done without a standalone backend for all cases except shared catalogs.
2003-09-22HeapTupleSatisfiesVacuum() needs to be more careful about theTom Lane
difference between INSERT_IN_PROGRESS and DELETE_IN_PROGRESS for tuples inserted and then deleted by a concurrent transaction. Example of bug: regression=# create table foo (f1 int); CREATE TABLE regression=# begin; BEGIN regression=# insert into foo values(1); INSERT 195531 1 regression=# delete from foo; DELETE 1 regression=# insert into foo values(1); INSERT 195532 1 regression=# create unique index fooi on foo(f1); ERROR: could not create unique index DETAIL: Table contains duplicated values.
2003-09-15Improve a couple of error messages per suggestions from Alvaro Herrera.Tom Lane
2003-09-15OK, some of these syntax errors should be given other codes.Peter Eisentraut
2003-09-13Avoid corner cases where aset.c would unnecessarily make malloc()Tom Lane
requests of sizes that aren't powers of 2. Per observation from David Schultz, 28-Aug.
2003-09-13Okay, I've had it with mktime() bugs. While chasing Torello Querci'sTom Lane
recent gripe, I discovered not one but two undocumented, undesirable behaviors of glibc's mktime. So, stop using it entirely, and always rely on inversion of localtime() to determine the local time zone. It's not even very much slower, as it turns out that mktime (at least in the glibc implementation) also does repeated reverse-conversions.
2003-09-11Consistenly lowercase GUC variable names, in docs and error messages.Bruce Momjian
2003-09-09Some "feature not supported" errors are better syntax errors, because thePeter Eisentraut
feature they complain about isn't a feature or cannot be implemented without definitional changes.
2003-09-07Remove geqo_random_seed parameter. Having geqo reset the global random()Tom Lane
sequence every time it's called is bogus --- it interferes with user control over the seed, and actually decreases randomness overall (because a seed based on time(NULL) is pretty predictable). If you really want a reproducible result from geqo, do 'set seed = 0' before planning a query.
2003-09-07load_file() has to remove pre-existing shlibs that match the new fileTom Lane
on either name or inode; otherwise load_external_function() won't do anything. At least on Linux, it appears that recompiling a shlib leads to a new file with a different inode, so the old code failed to detect a match.
2003-09-04Allow non-super users to set log_duration to true, then false, when theBruce Momjian
administrator has not turned it on, and fix other PGC_USERLIMIT variables.
2003-09-03Pass session_authorization to the client and make psql update its promptPeter Eisentraut
accordingly.
2003-09-03Work around ENOTEMPTY being an alias for EEXIST on some platforms.Tom Lane
2003-09-03Repair problems with to_char() overrunning its input string.Tom Lane
From Karel Zak.
2003-09-01Do not pass server_encoding to the client.Peter Eisentraut
libpq, talking to an old server, should assume SQL_ASCII as the default client encoding, because that is what the server will actually use (not the server encoding).
2003-09-01Rename DoIt to changeVar, for clarity.Bruce Momjian
2003-08-27Adjust date/time input parsing code to correctly distinguish the fourTom Lane
SQLSTATE error codes required by SQL99 (invalid format, datetime field overflow, interval field overflow, invalid time zone displacement value). Also emit a HINT about DateStyle in cases where it seems appropriate. Per recent gripes.
2003-08-27Share PG_DIAG_* macros between client and server and use them internally.Peter Eisentraut
2003-08-26Call it Linux, not GNU/Linux.Bruce Momjian
2003-08-26Use separate SQLSTATE codes for file not found/file exists, rather thanTom Lane
lumping them into ERRCODE_UNDEFINED_OBJECT/ERRCODE_DUPLICATE_OBJECT. This seems reasonable since 'object' was meant to refer to 'object in the database' and a file is outside the database. Per request from Dave Cramer.
2003-08-26Mop-up for previous change to determine default shared_buffers andTom Lane
max_connections at initdb time. Get rid of DEF_NBUFFERS and DEF_MAXBACKENDS macros, which aren't doing anything useful anymore, and put more likely defaults into postgresql.conf.sample.
2003-08-25Add the Brazilian time zone abbreviations BRT, BRST, FNT, FNST.Tom Lane
ACT and ACST were already present. AMT and AMST conflict with the existing entries for Armenia; no change there for the moment.
2003-08-25Allow parsing of time and timetz inputs to accept the documented inputTom Lane
syntax '040506' for '04:05:06', as well as '0405' for '04:05:00'. This has been broken since 7.2 but was only recently complained of.
2003-08-25Refactor code so that to_date() does not call to_timestamp() and thenTom Lane
perform a timestamp-to-date coercion. Instead both routines share a subroutine that delivers the parsing result as a struct tm. This avoids problems with timezone dependency of to_date's result, and should be at least marginally faster too.
2003-08-25Fix GB18030 to UTF-8 mapping tableTatsuo Ishii
2003-08-24Change warnings for non-existing or pre-existing cursors to errors.Peter Eisentraut
2003-08-24Fix GB18030 to UTF-8 mapping tableTatsuo Ishii
2003-08-23Fix uninstall target.Peter Eisentraut
2003-08-19Improve dynahash.c's API so that caller can specify the comparison functionTom Lane
as well as the hash function (formerly the comparison function was hardwired as memcmp()). This makes it possible to eliminate the special-purpose hashtable management code in execGrouping.c in favor of using dynahash to manage tuple hashtables; which is a win because dynahash knows how to expand a hashtable when the original size estimate was too small, whereas the special-purpose code was too stupid to do that. (See recent gripe from Stephan Szabo about poor performance when hash table size estimate is way off.) Free side benefit: when using string_hash, the default comparison function is now strncmp() instead of memcmp(). This should eliminate some part of the overhead associated with larger NAMEDATALEN values.
2003-08-17Fix ARRAY[] construct so that in multidimensional case, elements canTom Lane
be anything yielding an array of the proper kind, not only sub-ARRAY[] constructs; do subscript checking at runtime not parse time. Also, adjust array_cat to make array || array comply with the SQL99 spec. Joe Conway
2003-08-17Somebody forgot to include any actual documentation for ADD_MISSING_FROM.Tom Lane
2003-08-17Create a 'type cache' that keeps track of the data needed for any particularTom Lane
datatype by array_eq and array_cmp; use this to solve problems with memory leaks in array indexing support. The parser's equality_oper and ordering_oper routines also use the cache. Change the operator search algorithms to look for appropriate btree or hash index opclasses, instead of assuming operators named '<' or '=' have the right semantics. (ORDER BY ASC/DESC now also look at opclasses, instead of assuming '<' and '>' are the right things.) Add several more index opclasses so that there is no regression in functionality for base datatypes. initdb forced due to catalog additions.
2003-08-17(I always forget what the magic numbers 0 through 2 means for theBruce Momjian
"syslog" option.) By the way: The "virtual_host" parameter is a bad name for that particular option, I think. "Virtual host" signals that PostgreSQL will behave differently according to which IP address it's contacted (like Apache's virtual host support which makes the web-server serve different sites according to different criteria). A better word for the options would be "tcpip_listen_addr" or something like that. Troels Arvin
2003-08-15Rewrite array_cmp to not depend on deconstruct_array. Should be a littleTom Lane
faster, but more importantly does not leak memory. Still needs more work though, per my recent note to pgsql-hackers.
2003-08-14Handle double-quotes correctly in user names in ACL lists.Tom Lane
Christopher Kings-Lynne
2003-08-11Rewriter and planner should use only resno, not resname, to identifyTom Lane
target columns in INSERT and UPDATE targetlists. Don't rely on resname to be accurate in ruleutils, either. This fixes bug reported by Donald Fraser, in which renaming a column referenced in a rule did not work very well.
2003-08-11Code cleanup inspired by recent resname bug report (doesn't fix the bugTom Lane
yet, though). Avoid using nth() to fetch tlist entries; provide a common routine get_tle_by_resno() to search a tlist for a particular resno. This replaces a couple uses of nth() and a dozen hand-coded search loops. Also, replace a few uses of nth(length-1, list) with llast().
2003-08-08Another pgindent run with updated typedefs.Bruce Momjian
2003-08-08Conversion functions must be STRICT to prevent them from getting null inputs.Tom Lane
2003-08-08Fix floating-point timestamp comparisons to not go nuts if NaN isTom Lane
encountered; per bug report from Christian van der Leeden 8/7/03. Also, adjust larger/smaller routines (MAX/MIN) to share code with comparisons for timestamp, interval, timetz.