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.
Barry Lind [Mon, 8 Sep 2003 17:30:22 +0000 (17:30 +0000)]
This set of changes applies a patch from KHO at redhat to add some SQLState
support to the jdbc driver.
That patch needed some work: it assumed the sqlcode in a server message was
fixed in its position, the patch lost the ability to pass exceptions, and the
patch missed a couple of places where server errors where being received.
In addition to fixing the above, I also added full support for the V3 protocol
error message syntax, I reversed the order of arguments in the PSQLException
constructor to more closely follow the constructors for SQLException, I changed
the new constructors that take PSQLState to take Object for additional
parameters as the old ones did.
Still todo are to add SQLState values to all existing exceptions thrown in the
driver and add support for parsing the V3 protocol format for notices.
Tom Lane [Sun, 7 Sep 2003 15:26:54 +0000 (15:26 +0000)]
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.
Tom Lane [Sun, 7 Sep 2003 14:44:40 +0000 (14:44 +0000)]
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.
Bruce Momjian [Sun, 7 Sep 2003 03:43:57 +0000 (03:43 +0000)]
Changes for MinGW/WIN32:
o allow configure to see include/port/win32 include files
o add matching Win32 accept() prototype
o allow pg_id to compile with native Win32 API
o fix invalide mbvalidate() function calls (existing bug)
o allow /scripts to compile with native Win32 API
o add win32.c to Win32 compiles (already in *.mak files)
Tom Lane [Sun, 7 Sep 2003 02:18:01 +0000 (02:18 +0000)]
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.
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.
Tom Lane [Thu, 4 Sep 2003 22:06:27 +0000 (22:06 +0000)]
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.
Tom Lane [Tue, 2 Sep 2003 22:10:16 +0000 (22:10 +0000)]
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.
Tom Lane [Tue, 2 Sep 2003 19:04:12 +0000 (19:04 +0000)]
Cause standalone backend (including bootstrap case) to read the GUC
config file if it exists. This was already discussed as being a good
idea, and now seems the cleanest way to deal with initdb-time failures
on machines with small SHMMAX. (The submitted patches instead modified
initdb.sh to pass the correct sizing parameters, but that would still
leave standalone backends prone to failure later. An admin who needs
to use a standalone backend has enough trouble already, he shouldn't
have to manually configure its shmem settings...)
Tom Lane [Tue, 2 Sep 2003 18:13:32 +0000 (18:13 +0000)]
Several fixes for hash indexes that involve changing the on-disk index
layout; therefore, this change forces REINDEX of hash indexes (though
not a full initdb). Widen hashm_ntuples to double so that hash space
management doesn't get confused by more than 4G entries; enlarge the
allowed number of free-space-bitmap pages; replace the useless bshift
field with a useful bmshift field; eliminate 4 bytes of wasted space
in the per-page special area.
Tom Lane [Tue, 2 Sep 2003 02:18:38 +0000 (02:18 +0000)]
Rewrite hashbulkdelete() to make it amenable to new bucket locking
scheme. A pleasant side effect is that it is *much* faster when deleting
a large fraction of the indexed tuples, because of elimination of
redundant hash_step activity induced by hash_adjscans. Various other
continuing code cleanup.
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).
Tom Lane [Mon, 1 Sep 2003 20:26:34 +0000 (20:26 +0000)]
Preliminary cleanup for hash index code (doesn't attack the locking problem
yet). Fix a couple of bugs that would only appear if multiple bitmap pages
are used, including a buffer reference leak and incorrect computation of bit
indexes. Get rid of 'overflow address' concept, which accomplished nothing
except obfuscating the code and creating a risk of failure due to limited
range of offset field. Rename some misleadingly-named fields and routines,
and improve documentation.
Tom Lane [Mon, 1 Sep 2003 20:24:49 +0000 (20:24 +0000)]
Add some internals documentation for hash indexes, including an
explanation of the remarkably confusing page addressing scheme.
The file also includes my planned-but-not-yet-implemented revision
of the hash index locking scheme.
Tom Lane [Thu, 28 Aug 2003 20:21:34 +0000 (20:21 +0000)]
pg_dump and pg_restore -r had managed to diverge on the ordering of
different object types. Fix, and centralize logic to try to prevent
the same mistake in future.
Tom Lane [Thu, 28 Aug 2003 18:59:06 +0000 (18:59 +0000)]
Ensure that FK constraints are dumped after primary/unique constraints,
rather than relying on OID order of pg_constraint entries. Per gripe
from Greg Stark.
Tom Lane [Wed, 27 Aug 2003 23:29:29 +0000 (23:29 +0000)]
Adjust date/time input parsing code to correctly distinguish the four
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.
Tom Lane [Tue, 26 Aug 2003 21:15:27 +0000 (21:15 +0000)]
Use separate SQLSTATE codes for file not found/file exists, rather than
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.