Neil Conway [Wed, 24 Mar 2004 03:22:35 +0000 (03:22 +0000)]
Fix some whitespace formatting, and remove an overly-verbose
parameter description: postgresql.conf is not the place for
documentating the functionality of a GUC var.
Bruce Momjian [Wed, 24 Mar 2004 03:10:29 +0000 (03:10 +0000)]
>>Also, what is the default connection mode of psql? It should probably be
>>equivalent to "-h localhost", shouldn't it?
>>
>>
>
>Now that is something I had not thought of. Seems we can assume a Win32
>psql can never use unix domain sockets, so defaulting that to localhost
>is a good solution too.
Bruce Momjian [Tue, 23 Mar 2004 21:39:46 +0000 (21:39 +0000)]
When changing select() calls for delays into pg_usleep(), two comments
in s_lock.c were not updated, and still refers to select. Made my grep
hit the wrong files, so I figured a simple patch was in order.. (other
refs in the same comment block was changed..)
Tom Lane [Tue, 23 Mar 2004 19:35:17 +0000 (19:35 +0000)]
Upgrade ALTER TABLE DROP COLUMN so that it can drop an OID column, and
remove separate implementation of ALTER TABLE SET WITHOUT OIDS in favor
of doing a regular DROP. Also, cause CREATE TABLE to account completely
correctly for the inheritance status of the OID column. This fixes
problems with dropping OID columns that have dependencies, as noted by
Christopher Kings-Lynne, as well as making sure that you can't drop an
OID column that was inherited from a parent.
Neil Conway [Tue, 23 Mar 2004 02:47:35 +0000 (02:47 +0000)]
Improve the locale and character set docs, add some <xref>s pointing
to the character set docs where appropriate, and improve the postmaster
reference page. Character set cross-refs suggested by Gavin Kistner.
Tom Lane [Tue, 23 Mar 2004 01:23:48 +0000 (01:23 +0000)]
Replace the virtual_host and tcpip_socket parameters with a unified
listen_addresses parameter, as per recent discussion. The default behavior
is now to listen on localhost, which eliminates the need for the -i
postmaster switch in many scenarios.
Tom Lane [Mon, 22 Mar 2004 23:55:29 +0000 (23:55 +0000)]
Before deciding we can use a socket for statistics collection, test to
ensure that it actually passes data. This catches cases such as a kernel
packet filter rule that makes the socket useless.
Bruce Momjian [Mon, 22 Mar 2004 03:57:08 +0000 (03:57 +0000)]
In working through a pg_autovacuum problem with Joe Conway (which turned
out to be the same problem reported by Cott Lang which the previous
patch resolved) a new bug was uncovered when running with a debug level
of greater than 1.
This patch resolves this new found bug and fixes some of the other
debugging output to be more consistent.
Tom Lane [Mon, 22 Mar 2004 01:38:18 +0000 (01:38 +0000)]
Add timestamp-versus-timestamptz cross-type comparison functions,
flesh out the index operator classes to include these. In passing,
fix erroneous volatility marking of ACL functions.
Tom Lane [Sun, 21 Mar 2004 22:29:11 +0000 (22:29 +0000)]
Revise syntax-error reporting behavior to give pleasant results for
errors in internally-generated queries, such as those submitted by
plpgsql functions. Per recent discussions with Fabien Coelho.
Tom Lane [Sat, 20 Mar 2004 20:09:45 +0000 (20:09 +0000)]
Rewrite pg_dump's comment-dumping code to pull over all the comments
in one query, rather than making a separate query for each object that
could have a comment. This costs relatively little space (a few tens of
K typically) and saves substantial time in databases with many objects.
I find it reduces the runtime of 'pg_dump -s regression' by about a
third.
Tom Lane [Fri, 19 Mar 2004 18:58:07 +0000 (18:58 +0000)]
Create a validator for plpgsql, so that some minimal syntax checking
is done at creation time for plpgsql functions. Improve createlang and
droplang to support adding/dropping validators for PLs. Initial steps
towards producing a syntax error position from plpgsql syntax errors
(this part is a work in progress, and will change depending on outcome
of current discussions).
Tom Lane [Fri, 19 Mar 2004 02:23:59 +0000 (02:23 +0000)]
Code review for log_line_prefix patch. Cooperate with StringInfo instead
of fighting it, avoid hard-wired (and wrong) assumption about max length
of prefix, cause %l to actually work as documented, don't compute data
we may not need.
Bruce Momjian [Thu, 18 Mar 2004 15:26:27 +0000 (15:26 +0000)]
Add fsync tests:
Compare fsync before and after write's close:
Compare one o_sync write to two:
Compare file sync methods with one 8k write:
Compare file sync methods with 2 8k writes:
Tom Lane [Wed, 17 Mar 2004 22:24:58 +0000 (22:24 +0000)]
During btree index build, sort equal-keyed tuples according to their
TID (heap position). This doesn't do anything to the validity of the
finished index, but by pretending to qsort() that there are no really
equal keys in the sort, we can avoid performance problems with qsort
implementations that have trouble with large numbers of equal keys.
Patch from Manfred Koizar.
Tom Lane [Wed, 17 Mar 2004 20:48:43 +0000 (20:48 +0000)]
Reimplement CASE val WHEN compval1 THEN ... WHEN compval2 THEN ... END
so that the 'val' is computed only once, per recent discussion. The
speedup is not much when 'val' is just a simple variable, but could be
significant for larger expressions. More importantly this avoids issues
with multiple evaluations of a volatile 'val', and it allows the CASE
expression to be reverse-listed in its original form by ruleutils.c.
Tom Lane [Wed, 17 Mar 2004 01:02:24 +0000 (01:02 +0000)]
Replace the switching function ExecEvalExpr() with a macro that jumps
directly to the appropriate per-node execution function, using a function
pointer stored by ExecInitExpr. This speeds things up by eliminating one
level of function call. The function-pointer technique also enables further
small improvements such as only making one-time tests once (and then
changing the function pointer). Overall this seems to gain about 10%
on evaluation of simple expressions, which isn't earthshaking but seems
a worthwhile gain for a relatively small hack. Per recent discussion
on pghackers.
Bruce Momjian [Mon, 15 Mar 2004 16:18:43 +0000 (16:18 +0000)]
* postmaster.c: cleanup pmdaemonize under win32; missed failure message
in CreateOptsFile
* s_lock.c: minor comment fix
* findbe.c: variables not used under win32 moved within #ifndef WIN32
case
Bruce Momjian [Mon, 15 Mar 2004 16:14:26 +0000 (16:14 +0000)]
Windows uses codepages rather than the environment, so we work around
that by querying the environment explicitly first for LC_COLLATE and
LC_CTYPE. We have to do this because initdb passes those values in the
environment. If there is nothing there we fall back on the codepage.
Tom Lane [Mon, 15 Mar 2004 01:13:41 +0000 (01:13 +0000)]
Remove grotty special-case code in coerce_to_target_type() that
implemented casts to varchar and bpchar using a cast-to-text function.
This is a holdover from before we had pg_cast; it now makes more sense
to just list these casts in pg_cast. While at it, add pg_cast entries
for the other direction (casts from varchar/bpchar) where feasible.
Tom Lane [Sun, 14 Mar 2004 23:41:27 +0000 (23:41 +0000)]
Tweak planner so that index expressions and predicates are matched to
queries without regard to whether coercions are stated explicitly or
implicitly. Per suggestion from Stephan Szabo.
Neil Conway [Sun, 14 Mar 2004 05:22:52 +0000 (05:22 +0000)]
Portability fixes and bug fixes for recent floating point input changes.
In particular, don't depend on strtod() to accept 'NaN' and 'Infinity'
inputs (while this is required by C99, not all platforms are compliant
with that yet). Also, don't require glibc's behavior from isinf():
it seems that on a lot of platforms isinf() does not itself distinguish
between negative and positive infinity.
Tom Lane [Sun, 14 Mar 2004 04:25:18 +0000 (04:25 +0000)]
Teach psql to show the location of syntax errors visually, per recent
discussions. Patch by Fabien Coelho and Tom Lane. Still needs to be
taught about multi-screen-column kanji characters; Tatsuo has promised
to provide the needed infrastructure for that.
Tom Lane [Sun, 14 Mar 2004 01:58:41 +0000 (01:58 +0000)]
Arrange to emit a CONTEXT: SQL function "foo" entry in an error
message that is reporting a prechecking error in a SQL function.
This is to cue client-side code that the syntax error position,
if any, is with respect to the function body and not the outer command.
Tom Lane [Sat, 13 Mar 2004 22:09:14 +0000 (22:09 +0000)]
Generate a WARNING when the column types in a foreign key constraint are
incompatible enough to prevent indexscanning the referenced table. Also,
improve the error message that pops out when we can't implement the FK at
all for lack of a usable equality operator. Fabien Coelho, with some review
by Tom Lane.
Tom Lane [Sat, 13 Mar 2004 00:54:10 +0000 (00:54 +0000)]
Repair memory leakage introduced into the non-hashed aggregate case by
7.4 rewrite for hashed aggregate support. If the transition data type
is pass-by-reference, the transValue must be pfreed when starting a new
group boundary, else we have a one-value-per-group leakage. Thanks to
Rae Steining for providing a reproducible test case.
Neil Conway [Fri, 12 Mar 2004 00:25:43 +0000 (00:25 +0000)]
Allow 'Infinity' and '-Infinity' as input to the float4 and float8
types. Update the regression tests and the documentation to reflect
this. Remove the UNSAFE_FLOATS #ifdef.
This is only half the story: we still unconditionally reject
floating point operations that result in +/- infinity. See
recent thread on -hackers for more information.