Tom Lane [Sun, 19 Oct 2003 21:36:41 +0000 (21:36 +0000)]
Adjust libpq to avoid deadlock when both client and server want to send
data, and both have filled the transmission buffers. One scenario where
this can happen was illustrated here:
http://archives.postgresql.org/pgsql-hackers/2003-04/msg00979.php
Peter Eisentraut [Sat, 18 Oct 2003 22:59:09 +0000 (22:59 +0000)]
Cleanup on --help-config: Now called --describe-config, no further options,
machine readable, without headers, not sorted. Parameter descriptions
adjusted to fit first sentence + rest convention.
Tom Lane [Sat, 18 Oct 2003 19:06:10 +0000 (19:06 +0000)]
Further work on information_schema. _pg_keyissubset() wasn't quite
fully search-path-proof yet; also, element_types view did not work for
parameters and result types of functions, because it didn't generate
the object_name for the function the same way the data_type_privileges
view does. While at it, centralize dependencies on INDEX_MAX_KEYS/
FUNC_MAX_ARGS into a function returning setof int, so that it will be
easier to fix information_schema for nonstandard values of these
parameters.
Tom Lane [Sat, 18 Oct 2003 16:52:15 +0000 (16:52 +0000)]
Repair interaction between IN-join processing and subselect pullup that
I inadvertently broke a few days ago (per report from Sean Thomas).
Add regression test case to try to catch any similar breakage in future.
Peter Eisentraut [Sat, 18 Oct 2003 12:53:35 +0000 (12:53 +0000)]
Information schema fixes:
Use pg_get_constraintdef instead of pg_constraint.consrc
Use UNION ALL instread of UNION
Make use of regclass type for getting OID of system catalogs
Add schema qualifications where necessary
Fix typos
Tom Lane [Fri, 17 Oct 2003 22:38:20 +0000 (22:38 +0000)]
Document all the system views created by initdb (several of these were
never documented anywhere, sigh). Centralize the detailed documentation
of system views into catalogs.sgml, and provide cross-references.
Tom Lane [Fri, 17 Oct 2003 01:14:26 +0000 (01:14 +0000)]
Adjust display of actual runtimes in EXPLAIN output to use three fractional
digits, and label it 'ms' not 'msec', for consistency with psql's \timing
display. Per recent discussions.
Tom Lane [Fri, 17 Oct 2003 00:57:04 +0000 (00:57 +0000)]
Use pg_get_constraintdef() rather than pg_constraint.consrc; this is
a portion of a patch recently submitted by Christopher Kings-Lynne.
Applied by agreement that this is a bug fix.
Tom Lane [Thu, 16 Oct 2003 22:52:22 +0000 (22:52 +0000)]
Set attstattarget to -1 for all system catalog columns. All but a few
of the entries used to be zero, which I think I had deliberately done in
the name of saving cycles during ANALYZE, but it was really a rather
foolish decision. Some of the more complex views in information_schema
were getting really bad plans for lack of statistics on the columns they
were joining over.
I'm not forcing an initdb for this, but I think there will be one soon
anyway to repair some bugs in the information_schema views.
Tom Lane [Thu, 16 Oct 2003 20:59:35 +0000 (20:59 +0000)]
Ensure that all places that are complaining about exhaustion of shared
memory say 'out of shared memory'; some were doing that and some just
said 'out of memory'. Also add a HINT about increasing max_locks_per_transaction
where relevant, per suggestion from Sean Chittenden. (The former change
does not break the strings freeze; the latter does, but I think it's
worth doing anyway.)
Tom Lane [Thu, 16 Oct 2003 20:03:09 +0000 (20:03 +0000)]
Cause tab completion to do something moderately reasonable with mixed-case
identifiers --- it will now complete these correctly with double quoting.
Fix a few other issues in passing.
Tom Lane [Thu, 16 Oct 2003 16:50:41 +0000 (16:50 +0000)]
Fix bad interaction between NOTIFY processing and V3 extended query
protocol, per report from Igor Shevchenko. NOTIFY thought it could
do its thing if transaction blockState is TBLOCK_DEFAULT, but in
reality it had better check the low-level transaction state is
TRANS_DEFAULT as well. Formerly it was not possible to wait for the
client in a state where the first is true and the second is not ...
but now we can have such a state. Minor cleanup in StartTransaction()
as well.
Tom Lane [Wed, 15 Oct 2003 22:23:56 +0000 (22:23 +0000)]
Cause the default CFLAGS to be -O2 -fno-strict-aliasing when using gcc,
per recent pghackers discussions. Also ensure that explicitly setting
CFLAGS in the configure environment will be honored.
Tom Lane [Tue, 14 Oct 2003 22:47:12 +0000 (22:47 +0000)]
Use PQescapeString to ensure that tab-completion queries are not messed
up by quotes or backslashes in words that are being matched to database
names (per gripe from Ian Barwick, though I didn't use his patch).
Also fix possible memory leakage if _complete_with_query isn't run to
completion (not clear if that can happen or not, but be safe).
Tom Lane [Mon, 13 Oct 2003 23:48:16 +0000 (23:48 +0000)]
pull_up_subqueries() should copy the subquery before starting to modify
it. Not sure why I'd thought it would be a good idea to do differently
way back when, but Greg Stark exposed the folly of doing so ...
Tom Lane [Mon, 13 Oct 2003 21:06:44 +0000 (21:06 +0000)]
Determine max_connections first, then see how large shared_buffers can
be made, to avoid corner cases where max_connections ends up unreasonably
small because shared_buffers is hogging too much shmem space. Per pghackers
discussion about a week ago. Also, fix the copy-newlines problem in a
more robust way, by using COPY FROM filename instead of COPY FROM STDIN;
per a suggestion from Peter.
Tom Lane [Mon, 13 Oct 2003 20:02:52 +0000 (20:02 +0000)]
Adjust setRelhassubclassInRelation() to not perform actual heap_update
when the pg_class.relhassubclass value is already correct. This should
avoid most cases of the 'tuple concurrently updated' problem that
Robert Creager recently complained about. Also remove a bunch of dead
code in StoreCatalogInheritance() --- it was still computing the complete
list of direct and indirect inheritance ancestors, though that list has
not been needed since we got rid of the pg_ipl catalog.
Bruce Momjian [Sat, 11 Oct 2003 16:30:55 +0000 (16:30 +0000)]
This patch will stop gcc from issuing warnings about type-punned objects
when -fstrict-aliasing is turned on, as it is in the latest gcc when you
use -O2
Bruce Momjian [Fri, 10 Oct 2003 02:08:42 +0000 (02:08 +0000)]
> That's a fairly useless place to put it, though, since someone would
> only think to look at sort_mem if they already had a clue. It should
> be mentioned under bulk data load (in performance tips chapter)
Attached is a doc patch that does this. The way I've worded it may not
be the best, though.
Bruce Momjian [Thu, 9 Oct 2003 19:13:48 +0000 (19:13 +0000)]
About section 8.5.1.5. ("Special Values"):
I suggest adding LOCALTIMESTAMP and LOCALTIME to the first paragraph.
Maybe it should be phrased as:
The following SQL-compatible functions can be used to obtain
current datetime-related values: CURRENT_DATE, CURRENT_TIME,
CURRENT_TIMESTAMP, LOCALTIME and LOCALTIMESTAMP.
(See Section 9.8.4.)
Jan Wieck [Thu, 9 Oct 2003 01:17:07 +0000 (01:17 +0000)]
Protected access to variable m_preparedCount via synchronized
function to prevent multiple threads using automatic cursors on
the same connection from stomping over each others cursor.
Bruce Momjian [Wed, 8 Oct 2003 21:44:06 +0000 (21:44 +0000)]
Add 2-phase info, add Win32 URL:
< o Sample implementation in contrib/rserv
29c28,29
< * Create native Win32 port [win32]
> * Create native Win32 port, http://momjian.postgresql.org/main/writings/pgsql/win32.html
> 367c367,368
< * Two-phase commit to implement distributed transactions
> * Add two-phase commit to all distributed transactions with
> offline/readonly server status or administrator notification for failure
Tom Lane [Mon, 6 Oct 2003 20:09:47 +0000 (20:09 +0000)]
Fix binary_oper_exact() so that the heuristic 'an unknown literal on
one side of a binary operator is probably supposed to be the same type
as the other operand' will be applied for domain types. This worked
in 7.3 but was broken in 7.4 due to code rearrangements. Mea culpa.
Tom Lane [Mon, 6 Oct 2003 16:38:28 +0000 (16:38 +0000)]
During ALTER TABLE ADD FOREIGN KEY, try to check the existing rows using
a single LEFT JOIN query instead of firing the check trigger for each
row individually. Stephan Szabo, with some kibitzing from Tom Lane and
Jan Wieck.