Commit Graph

1187 Commits

Author SHA1 Message Date
Hiroshi Inoue f5c5c3c6f7 Putting back the previous change must be the first thing.
ALso put back a #ifndef ENABLE_REINDEX_NAILED_RELATIONS
which was removed about a year ago.
2003-09-23 01:51:09 +00:00
Tom Lane a13b018530 Disallow foreign-key references from temp tables to permanent tables.
Per recent discussion, this does not work because other backends can't
reliably see tuples in a temp table and so cannot run the RI checks
correctly.  Seems better to disallow this case than go back to accessing
temp tables through shared buffers.  Also, disallow FK references to
ON COMMIT DELETE ROWS tables.  We already caught this problem for normal
TRUNCATE, but the path used by ON COMMIT didn't check.
2003-09-19 21:04:20 +00:00
Tom Lane 28847ae77d Seems like a bad idea that REINDEX TABLE supports (or thinks it does)
reindexing system tables without ignoring system indexes, when the
other two varieties of REINDEX disallow it.  Make all three act the same,
and simplify downstream code accordingly.
2003-09-19 19:57:42 +00:00
Tom Lane db18703b5a Fix LISTEN/NOTIFY race condition reported by Gavin Sherry. While a
really general fix might be difficult, I believe the only case where
AtCommit_Notify could see an uncommitted tuple is where the other guy
has just unlistened and not yet committed.  The best solution seems to
be to just skip updating that tuple, on the assumption that the other
guy does not want to hear about the notification anyway.  This is not
perfect --- if the other guy rolls back his unlisten instead of committing,
then he really should have gotten this notify.  But to do that, we'd have
to wait to see if he commits or not, or make UNLISTEN hold exclusive lock
on pg_listener until commit.  Either of these answers is deadlock-prone,
not to mention horrible for interactive performance.  Do it this way
for now.  (What happened to that project to do LISTEN/NOTIFY in memory
with no table, anyway?)
2003-09-15 23:33:43 +00:00
Peter Eisentraut a07c5a1225 Remove warnings for operations that have no effect when executed repeatedly. 2003-09-15 00:26:31 +00:00
Tom Lane 8ff2005c67 Message in the other exit from acquire_sample_rows(), as per update
from Mark Kirkwood.  Also show the sample size.
2003-09-11 23:12:31 +00:00
Tom Lane 47c7f9ef1c Try to make recently-added analyze log message look something like
the others in style.
2003-09-11 22:59:28 +00:00
Tom Lane fdd93470fa Fix missed message update, per Alvaro Herrera. 2003-09-11 02:40:13 +00:00
Tom Lane 9cb4a28f47 Improve error message for cp or rm failur during create/drop database,
per recent discussions.
2003-09-10 20:24:09 +00:00
Bruce Momjian d16b877612 Add HINT if CREATE FUNCTION specifies a valid language, but the language
isn't loaded into the database.
2003-09-10 19:59:23 +00:00
Peter Eisentraut 33d4c828fd Some "feature not supported" errors are better syntax errors, because the
feature they complain about isn't a feature or cannot be implemented without
definitional changes.
2003-09-09 23:22:21 +00:00
Bruce Momjian 5a288903b9 Guard against pgindent changing =- to = -. 2003-08-30 14:59:34 +00:00
Tom Lane ce2ab4131a Fix stupid typo (mine I suppose) in CopyGetData. Per report from Dave Cramer. 2003-08-28 13:52:34 +00:00
Bruce Momjian cd0f42e87c Attached is a (very small) patch to make analyze display some
interesting info in verbose mode about the analyzed relation (pages,
rows per block and rows).

Mark Kirkwood
2003-08-26 15:38:42 +00:00
Peter Eisentraut 693aad413b Change warnings for non-existing or pre-existing cursors to errors. 2003-08-24 21:02:43 +00:00
Tom Lane ec646dbc65 Create a 'type cache' that keeps track of the data needed for any particular
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 19:58:06 +00:00
Tom Lane c01641f8ae libpq failed to cope with COPY FROM STDIN if the command was issued
via extended query protocol, because it sends Sync right after Execute
without realizing that the command to be executed is COPY.  There seems
to be no reasonable way for it to realize that, either, so the best fix
seems to be to make the backend ignore Sync during copy-in mode.  Bit of
a wart on the protocol, but little alternative.  Also, libpq must send
another Sync after terminating the COPY, if the command was issued via
Execute.
2003-08-13 18:56:21 +00:00
Tom Lane 88381ade63 Code cleanup inspired by recent resname bug report (doesn't fix the bug
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-11 20:46:47 +00:00
Bruce Momjian 46785776c4 Another pgindent run with updated typedefs. 2003-08-08 21:42:59 +00:00
Tom Lane 338aa57be0 Rename fields of DestReceiver to avoid collisions with (ill-considered)
macros in some platforms' sys/socket.h.
2003-08-06 17:46:46 +00:00
Tom Lane 2f9c859ea1 Fix some copyright notices that weren't updated. Improve copyright tool
so it won't miss 'em again.
2003-08-04 23:59:41 +00:00
Bruce Momjian f3c3deb7d0 Update copyrights to 2003. 2003-08-04 02:40:20 +00:00
Bruce Momjian 089003fb46 pgindent run. 2003-08-04 00:43:34 +00:00
Peter Eisentraut 4f7df90db0 Make ecpg SQLSTATE-aware. Map existing SQLCODE assignments to SQLSTATEs,
rather than parsing the message.  Add some documentation about embedded
SQL.
2003-08-01 13:53:36 +00:00
Tom Lane c4cf7fb814 Adjust 'permission denied' messages to be more useful and consistent. 2003-08-01 00:15:26 +00:00
Tom Lane 9c2a7c2269 Apply (a somewhat revised version of) Greg Mullane's patch to eliminate
heuristic determination of day vs month in date/time input.  Add the
ability to specify that input is interpreted as yy-mm-dd order (which
formerly worked, but only for yy greater than 31).  DateStyle's input
component now has the preferred spellings DMY, MDY, or YMD; the older
keywords European and US are now aliases for the first two of these.
Per recent discussions on pgsql-general.
2003-07-29 00:03:19 +00:00
Tom Lane 81b5c8a136 A visit from the message-style police ... 2003-07-28 00:09:16 +00:00
Tom Lane b05d3ae1ed Error message editing in backend/libpq, backend/postmaster, backend/tcop.
Along the way, fix some logic problems in pgstat_initstats, notably the
bogus assumption that malloc returns zeroed memory.
2003-07-22 19:00:12 +00:00
Tom Lane 5e6d691e0d Error message editing in backend/executor. 2003-07-21 17:05:12 +00:00
Tom Lane da4ed8bfdd Another round of error message editing, covering backend/commands/. 2003-07-20 21:56:35 +00:00
Tom Lane 216311d590 First bits of work on error message editing. 2003-07-18 23:20:33 +00:00
Tom Lane 0c172909d5 For COMMENT ON DATABASE where database name is unknown or not the current
database, emit a WARNING and do nothing, rather than raising ERROR.
Per recent discussion in which we concluded this is the best way to deal
with database dumps that are reloaded into a database of a new name.
2003-07-17 20:13:57 +00:00
Tom Lane 764f72dc82 Make EXTRACT(TIMEZONE) and SET/SHOW TIMEZONE follow the SQL convention
for the sign of timezone offsets, ie, positive is east from UTC.  These
were previously out of step with other operations that accept or show
timezones, such as I/O of timestamptz values.
2003-07-17 00:55:37 +00:00
Tom Lane ffcb1491af Now that I look, SHOW TRANSACTION_ISOLATION isn't quite consistent
with SET TRANSACTION_ISOLATION, either.
2003-07-15 19:34:43 +00:00
Tom Lane cfa6999d3b Cause SHOW DATESTYLE to produce a string that will be accepted by SET
DATESTYLE, for instance 'SQL, European' instead of
'SQL with European conventions'.  Per gripe a month or two back from
Barry Lind.
2003-07-15 19:19:56 +00:00
Tom Lane 79fafdf49c Some early work on error message editing. Operator-not-found and
function-not-found messages now distinguish the cases no-match and
ambiguous-match, and they follow the style guidelines too.
2003-07-04 02:51:34 +00:00
Tom Lane e3b1b6c0cd Aggregates can be polymorphic, using polymorphic implementation functions.
It also works to create a non-polymorphic aggregate from polymorphic
functions, should you want to do that.  Regression test added, docs still
lacking.  By Joe Conway, with some kibitzing from Tom Lane.
2003-07-01 19:10:53 +00:00
Peter Eisentraut 71e9f3b07f Change EXECUTE INTO to CREATE TABLE AS EXECUTE. 2003-07-01 00:04:31 +00:00
Tom Lane ea886339b8 Add is_superuser parameter reporting, soon to be used by psql. 2003-06-27 19:08:38 +00:00
Tom Lane 7f1249a8d2 Fix compile warnings. 2003-06-27 17:07:03 +00:00
Peter Eisentraut b256f24264 First batch of object rename commands. 2003-06-27 14:45:32 +00:00
Bruce Momjian 111d8e522b Back out array mega-patch.
Joe Conway
2003-06-25 21:30:34 +00:00
Bruce Momjian 7f7919256a In an attempt to simplify my life I'm submitting this patch that
restructures the deferred trigger queue.  The fundamental change is to
put all the static variables to hold the deferred triggers in a single
structure.

Alvaro Herrera
2003-06-24 23:25:44 +00:00
Bruce Momjian 46bf651480 Array mega-patch.
Joe Conway
2003-06-24 23:14:49 +00:00
Bruce Momjian e9cda08b2b Brief note about sequence cache not being cleared in other backends.
Actually clear the cache in the backend making the alteration.  This
follows in the footsteps of setval().

Rod Taylor
2003-06-12 07:49:43 +00:00
Tom Lane 2bc84b6852 Add defense in assign_session_authorization() against trying to do
catalog lookups when not in a transaction.  This prevents bizarre
failures if someone tries to set a value for session_authorization in
postgresql.conf.  Per report from Fernando Nasser.
2003-06-06 16:25:35 +00:00
Tom Lane e649796f12 Implement outer-level aggregates to conform to the SQL spec, with
extensions to support our historical behavior.  An aggregate belongs
to the closest query level of any of the variables in its argument,
or the current query level if there are no variables (e.g., COUNT(*)).
The implementation involves adding an agglevelsup field to Aggref,
and treating outer aggregates like outer variables at planning time.
2003-06-06 15:04:03 +00:00
Tom Lane 7c7139cf29 Knock down a couple more lappend() hotspots for large WHERE clauses. 2003-05-28 23:06:16 +00:00
Tom Lane fc8d970cbc Replace functional-index facility with expressional indexes. Any column
of an index can now be a computed expression instead of a simple variable.
Restrictions on expressions are the same as for predicates (only immutable
functions, no sub-selects).  This fixes problems recently introduced with
inlining SQL functions, because the inlining transformation is applied to
both expression trees so the planner can still match them up.  Along the
way, improve efficiency of handling index predicates (both predicates and
index expressions are now cached by the relcache) and fix 7.3 oversight
that didn't record dependencies of predicate expressions.
2003-05-28 16:04:02 +00:00
Bruce Momjian 98b6f37e47 Make debug_ GUC varables output DEBUG1 rather than LOG, and mention in
docs that CLIENT/LOG_MIN_MESSAGES now controls debug_* output location.
Doc changes included.
2003-05-27 17:49:47 +00:00