Tom Lane [Sat, 27 Sep 2003 19:35:32 +0000 (19:35 +0000)]
Adjust Darwin build to use the default 'two level namespace' linking
method. Fix a number of places where shared libraries were linked without
mentioning all the libraries they depend on; the Darwin and AIX ports
are known to require this, and it doesn't seem to hurt any other supported
platforms. (Hence, remove code in pl/tcl makefile that tried to avoid
mentioning other libs if not needed.)
Jan Wieck [Sat, 27 Sep 2003 15:34:06 +0000 (15:34 +0000)]
Changed the logic when a CAST is dumped according to discussion
on pgsql-hackers.
A cast is included in the dump output if any of the objects does
not belong to a system namespace and all of the non-system namespace
objects belong to dumped namespaces. System namespace is defined
as nspname begins with "pg_".
Peter Eisentraut [Sat, 27 Sep 2003 09:29:31 +0000 (09:29 +0000)]
You can't NLS-enable a program component by just putting gettext() around
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.
Peter Eisentraut [Sat, 27 Sep 2003 09:21:26 +0000 (09:21 +0000)]
The formatting of the display of the locale names assumed that locale names
are not longer than 8 characters. But sometimes they are, and that made
the display quite ugly. So just format them vertically so that everyone
can read them.
Tom Lane [Fri, 26 Sep 2003 17:39:13 +0000 (17:39 +0000)]
Move -D_GNU_SOURCE hack from port header to template, so that
configure's tests see the same compilation environment as the code.
Per discussion with Stephan Szabo.
Tom Lane [Thu, 25 Sep 2003 18:58:36 +0000 (18:58 +0000)]
Get rid of ReferentialIntegritySnapshotOverride by extending Executor API
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.
Tom Lane [Wed, 24 Sep 2003 18:54:02 +0000 (18:54 +0000)]
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.
Tom Lane [Tue, 23 Sep 2003 23:31:52 +0000 (23:31 +0000)]
Issue CREATE SCHEMA as the originally connecting user, with an
AUTHORIZATION clause to specify the desired owner. This allows a
superuser to restore schemas owned by users without CREATE-SCHEMA
permissions (ie, schemas originally created by a superuser using
AUTHORIZATION). --no-owner can be specified to suppress the
AUTHORIZATION clause if need be.
Tom Lane [Tue, 23 Sep 2003 22:48:53 +0000 (22:48 +0000)]
pg_dump/pg_restore now always use SET SESSION AUTHORIZATION, not \connect,
to control object ownership. The use-set-session-authorization and
no-reconnect switches are obsolete (still accepted on the command line,
but they don't do anything). This is a precursor to fixing handling
of CREATE SCHEMA, which will be a separate commit.
Tom Lane [Tue, 23 Sep 2003 17:12:53 +0000 (17:12 +0000)]
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).
Barry Lind [Tue, 23 Sep 2003 06:13:52 +0000 (06:13 +0000)]
Fix to properly handle timezone offsets that are partial hours. If the offset
was a partial hour and less than gmt (i.e. -02:30) the code would corrupt the
minutes part.
fix hlfinditem function. Thanks to "Stphane Bidoul" <stephane.bidoul@softwareag.com>.
The 'word' variable there is initialised from
the prs->words array, but immediately after,
that array may be reallocated, thus leaving
word pointing to unallocated memory.
Tom Lane [Mon, 22 Sep 2003 00:47:23 +0000 (00:47 +0000)]
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.
Tom Lane [Sun, 21 Sep 2003 17:57:21 +0000 (17:57 +0000)]
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.
Tom Lane [Fri, 19 Sep 2003 21:04:20 +0000 (21:04 +0000)]
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.
Tom Lane [Fri, 19 Sep 2003 20:47:59 +0000 (20:47 +0000)]
Latest version of gcc from Apple does not work well with -traditional-cpp
(it rejects some system header files...). Use -no-cpp-precomp instead.
I think it is okay to change this unconditionally, but if we hear
complaints from people still using very old compilers on Darwin,
we could put in a test to see which switch the compiler likes.
Tom Lane [Fri, 19 Sep 2003 19:57:42 +0000 (19:57 +0000)]
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.
Michael Meskes [Thu, 18 Sep 2003 13:12:23 +0000 (13:12 +0000)]
- Accept output variables for FETCH in DECLARE statement.
- Synced parser.
- Allowed C variables to carry the name of prepared statements.
- Added Informix handling of datatype converion errors.
Tom Lane [Wed, 17 Sep 2003 17:19:17 +0000 (17:19 +0000)]
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.
Tom Lane [Mon, 15 Sep 2003 23:33:43 +0000 (23:33 +0000)]
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?)