Commit Graph

6076 Commits

Author SHA1 Message Date
Tom Lane a56a016ceb Repair some REINDEX problems per recent discussions. The relcache is
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-24 18:54:02 +00:00
Tom Lane dbf8259adf Tweak generic_type_consistency routines to avoid loss of functionality
since 7.3: 'select array_dims(histogram_bounds) from pg_stats' used to
work and still should.  Problem was that code wouldn't take input of
declared type anyarray as matching an anyarray argument.  Allow this
case as long as we don't need to determine an element type (which in
practice means as long as anyelement isn't used in the function signature).
2003-09-23 17:12:53 +00:00
Tom Lane 267924ead8 _SPI_cursor_operation forgot to check for failure return from
_SPI_begin_call.  Per gripe from Tomasz Myrta.
2003-09-23 15:11:33 +00:00
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 f03d2284c0 HeapTupleSatisfiesVacuum() needs to be more careful about the
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-22 00:47:23 +00:00
Tom Lane 5aa29e88e9 Arrange to align shared disk buffers on at least 32-byte boundaries,
not just MAXALIGN boundaries.  This makes a noticeable difference in
the speed of transfers to and from kernel space, at least on recent
Pentiums, and might help other CPUs too.  We should look at making
this happen for local buffers and buffile.c too.  Patch from Manfred Spraul.
2003-09-21 17:57:21 +00:00
Tom Lane f3ad615ce8 Fix a batch of speling misteaks identified by Peter's spell-checker tool. 2003-09-20 20:12:05 +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 6b73da67b2 Disallow converting a table to a view if it has triggers, indexes, or
child tables --- all cases that will trip various sanity checks elsewhere
in the system, as well as cases that should not occur in the only intended
use of this feature, namely coping with ancient pg_dump representation
of views.  Per bug report from Chris Pizzi.
2003-09-17 17:19:17 +00:00
Tom Lane 8723e37a26 Since SPI_modifytuple's natts argument is the number of attributes to be
changed, it should allow a zero value (implying no changes to make).
2003-09-16 00:50:09 +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
Tom Lane daed6f4b94 Improve a couple of error messages per suggestions from Alvaro Herrera. 2003-09-15 22:28:58 +00:00
Peter Eisentraut 7ce5f25b5b Translation updates 2003-09-15 20:42:40 +00:00
Peter Eisentraut 2d13472c9e OK, some of these syntax errors should be given other codes. 2003-09-15 20:03:37 +00:00
Peter Eisentraut a07c5a1225 Remove warnings for operations that have no effect when executed repeatedly. 2003-09-15 00:26:31 +00:00
Peter Eisentraut 2f9d32cded Run distprep target before creating list of files that contain translatable
strings in the backend, so that .l and .y files are included.  To that end,
don't make the .pot file a prerequisite on distprep.
2003-09-14 22:40:38 +00:00
Tom Lane b38c04335a Reconsider placement of MemoryContextCheck() call --- do after commit,
not before, to avoid duplication of effort.
2003-09-14 00:03:32 +00:00
Tom Lane 4cf6e9e081 Avoid corner cases where aset.c would unnecessarily make malloc()
requests of sizes that aren't powers of 2.  Per observation from
David Schultz, 28-Aug.
2003-09-13 22:25:38 +00:00
Tom Lane 94a13b8a11 Okay, I've had it with mktime() bugs. While chasing Torello Querci's
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-13 21:12:38 +00:00
Bruce Momjian c346ca8648 When I sent in the sslmode patch I forgot to update the
comments/examples in pg_hba.conf. This patch remedies that, adds a brief
explanation of the connection types, and adds a missing period in the
docs.

Jon Jensen
2003-09-13 16:43:38 +00:00
Tom Lane 8b43e325eb Revert to our pre-7.4 behavior of identifying Unix-socket connections in
ps status as '[local]', not as 'localhost' as the code has been doing
recently.  That's too easily confused with TCP loopback connections,
and there is no good reason to change the behavior anyway.
2003-09-12 20:18:51 +00:00
Tom Lane b1d3de6b96 Someone (possibly me) foolishly reduced the response for failing
to create a TCP/IP socket from FATAL to LOG.  This was unwise;
historically we have expected socket conflicts to abort postmaster
startup.  Conflicts on port numbers with another postmaster can only
be detected reliably at the TCP socket level.
2003-09-12 19:33:59 +00:00
Bruce Momjian aaafbdcfd3 Fix old mention of exec() in AttachSharedMemoryAndSemaphores comment. 2003-09-12 02:13:23 +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
Bruce Momjian 188eda0df2 Consistenly lowercase GUC variable names, in docs and error messages. 2003-09-11 18:30:39 +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
Tom Lane d0bfe7f100 Update comments about how locale settings are handled. 2003-09-09 15:19:31 +00:00
Tom Lane e702b04cf4 Avoid using s_addr as a local variable name, to work around broken
system headers on Unixware.
2003-09-08 00:56:13 +00:00
Tom Lane 48beecda7c Remove geqo_random_seed parameter. Having geqo reset the global random()
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-07 15:26:54 +00:00
Tom Lane 75c35e0f31 Remove check on source address of a statistics packet. Check was broken
by recent IPv6 changes, and since it's redundant with a kernel-level check
anyway, it seems not worth trying to fix it.  Per recent discussions.
2003-09-07 14:44:40 +00:00
Tom Lane 7703e55c32 Make the default pg_hba.conf include an entry for ::1 only if configure
set HAVE_IPV6.  Per recent discussions.
2003-09-07 03:36:03 +00:00
Tom Lane f4ed650996 load_file() has to remove pre-existing shlibs that match the new file
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-07 02:18:01 +00:00
Peter Eisentraut 3e20a72603 Make all valid uses of the COLLATE clause yield the same result: a syntax
error.  There is no point in providing some kind of forward compatibility
now, because no one can tell what a future implementation will look like.
2003-09-06 14:01:51 +00:00
Tom Lane 92aa462247 Second try at IPv4-to-v6 mapping code; avoid assuming that the struct
returned by getaddrinfo_all will have enough room for an IPv6 address.
2003-09-05 23:07:21 +00:00
Tom Lane 3c9bb8886d Allow IPv4-format entries in pg_hba.conf to match IPv6 connections
that have IPv4-embedded-in-IPv6 addresses.  Per idea of Andreas Pflug.
2003-09-05 20:31:36 +00:00
Bruce Momjian 702c91b4ff This fixes three minor typos in hba.c.
--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
2003-09-05 03:57:13 +00:00
Tom Lane 7a3693716d Reimplement hash index locking algorithms, per my recent proposal to
pghackers.  This fixes the problem recently reported by Markus KrÌutner
(hash bucket split corrupts the state of scans being done concurrently),
and I believe it also fixes all the known problems with deadlocks in
hash index operations.  Hash indexes are still not really ready for prime
time (since they aren't WAL-logged), but this is a step forward.
2003-09-04 22:06:27 +00:00
Tom Lane ca43f71ca5 Avoid consuming unreasonable amounts of memory when GRANT has many
grantees.
2003-09-04 15:53:04 +00:00
Bruce Momjian 6d239ee4b4 Allow non-super users to set log_duration to true, then false, when the
administrator has not turned it on, and fix other PGC_USERLIMIT
variables.
2003-09-04 05:11:20 +00:00
Bruce Momjian b8245766ab Re-upper case CHECKPOINT_SEGMENTS. 2003-09-04 03:38:55 +00:00
Bruce Momjian cac43aefd8 Lowercase CHECKPOINT_SEGMENTS. 2003-09-04 00:36:46 +00:00
Peter Eisentraut 29a20145fd Pass session_authorization to the client and make psql update its prompt
accordingly.
2003-09-03 22:05:09 +00:00
Tom Lane b96e32ebf8 Work around ENOTEMPTY being an alias for EEXIST on some platforms. 2003-09-03 15:49:42 +00:00
Tom Lane 5840b89373 Repair problems with to_char() overrunning its input string.
From Karel Zak.
2003-09-03 14:59:41 +00:00
Tom Lane 5ac2d7c0eb In _bt_check_unique() loop, don't bother applying _bt_isequal() to
killed items; just skip to the next item immediately.  Only check for
key equality when we reach a non-killed item or the end of the index
page.  This saves key comparisons when there are lots of killed items,
as for example in a heavily-updated table that's not been vacuumed lately.
Seems to be a win for pgbench anyway.
2003-09-02 22:10:16 +00:00