Tom Lane [Tue, 5 Dec 2000 19:15:10 +0000 (19:15 +0000)]
Repair breakage of rules containing INSERT ... SELECT actions, per bug
report from Joel Burton. Turns out that my simple idea of turning the
SELECT into a subquery does not interact well *at all* with the way the
rule rewriter works. Really what we need to make INSERT ... SELECT work
cleanly is to decouple targetlists from rangetables: an INSERT ... SELECT
wants to have two levels of targetlist but only one rangetable. No time
for that for 7.1, however, so I've inserted some ugly hacks to make the
rewriter know explicitly about the structure of INSERT ... SELECT queries.
Ugh :-(
Tom Lane [Sun, 3 Dec 2000 20:45:40 +0000 (20:45 +0000)]
Ensure that all uses of <ctype.h> functions are applied to unsigned-char
values, whether the local char type is signed or not. This is necessary
for portability. Per discussion on pghackers around 9/16/00.
Repair usage of the OVERLAPS operator.
Allow some operator-like tokens to be used as function names.
Flesh out support for time, timetz, and interval operators
and interactions.
Regression tests pass, but non-reference-platform horology test results
will need to be updated.
Tom Lane [Sat, 2 Dec 2000 18:16:40 +0000 (18:16 +0000)]
Don't cause --enable-cassert to define COPY_PARSE_PLAN_TREES automatically
anymore. That won't teach us anything new for the rest of this release
cycle, so it seems better to keep the --assert environment more like the
non-assert environment for beta.
I'm going to leave CLOBBER_FREED_MEMORY and MEMORY_CONTEXT_CHECKING
turned on by --enable-cassert for now, however.
Tom Lane [Fri, 1 Dec 2000 22:10:31 +0000 (22:10 +0000)]
Make tuple receive/print routines TOAST-aware. Formerly, printtup would
leak memory when printing a toasted attribute, and printtup_internal
didn't work at all...
Tom Lane [Fri, 1 Dec 2000 19:52:04 +0000 (19:52 +0000)]
Make elog() switch to ErrorContext while invoking libpq output routines,
since those routines may do palloc's. We want to be fairly sure we can
send the error message to the client even under low-memory conditions.
That's what we stashed away 8K in ErrorContext for, after all ...
Tom Lane [Fri, 1 Dec 2000 18:14:29 +0000 (18:14 +0000)]
Pursuant to a pghackers discussion back around 11-Jul-00, get rid of aset.c's
not-very-good handling of mid-size allocation requests. Do everything via
either the "small" case (chunk size rounded up to power of 2) or the "large"
case (pass it straight off to malloc()). Increase the number of freelists
a little to set the breakpoint between these behaviors at 8K.
Tom Lane [Fri, 1 Dec 2000 05:17:19 +0000 (05:17 +0000)]
It seems appropriate that the extended MEMORY_CONTEXT_CHECKING code
immediately uncovered three of Karel's own bugs, including a routine
that scribbled on its input (naughty naughty!)
Tom Lane [Fri, 1 Dec 2000 05:16:45 +0000 (05:16 +0000)]
Clean up MEMORY_CONTEXT_CHECKING code, and apply it more thoroughly. Also,
apply Karel Zak's patch to recycle residual space in an exhausted allocation
block. (Bet you thought I'd forgot about that, Karel?)
Tom Lane [Thu, 30 Nov 2000 18:38:47 +0000 (18:38 +0000)]
Remove VARLENA_FIXED_SIZE hack, which is irreversibly broken now that
both MULTIBYTE and TOAST prevent char(n) from being truly fixed-size.
Simplify and speed up fastgetattr() and index_getattr() macros by
eliminating special cases for attnum=1. It's just as fast to handle
the first attribute by presetting its attcacheoff to zero; so do that
instead when loading the tupledesc in relcache.c.
Peter Eisentraut [Thu, 30 Nov 2000 18:32:52 +0000 (18:32 +0000)]
Remove remaining unixsocket-setting interfaces, since the host parameter
does that. Disable URL-style connection parameter specification code,
which doesn't work.
Tom Lane [Thu, 30 Nov 2000 01:39:08 +0000 (01:39 +0000)]
Rearrange bufmgr header files so that buf_internals.h need not be
included by everything that includes bufmgr.h --- it's supposed to be
internals, after all, not part of the API! This fixes the conflict
against FreeBSD headers reported by Rosenman, by making it unnecessary
for s_lock.h to be included by plperl.c.
Tom Lane [Wed, 29 Nov 2000 22:04:04 +0000 (22:04 +0000)]
Just noticed that with -S switch, MyProcPid is permanently wrong in
postmaster, because it isn't updated after forking away from the terminal.
Apparently it's not used anyplace in the postmaster ... but seems best
to make it show the correct PID ...
Tom Lane [Wed, 29 Nov 2000 20:59:54 +0000 (20:59 +0000)]
Get rid of not-very-portable fcntl(F_SETLK) mechanism for locking the Unix
socket file, in favor of having an ordinary lockfile beside the socket file.
Clean up a few robustness problems in the lockfile code. If postmaster is
going to reject a connection request based on database state, it will now
tell you so before authentication exchange not after. (Of course, a failure
after is still possible if conditions change meanwhile, but this makes life
easier for a yet-to-be-written pg_ping utility.)
Tom Lane [Tue, 28 Nov 2000 23:42:31 +0000 (23:42 +0000)]
aclitemout() shouldn't coredump when it finds an ACL item
for a now-vanished group. Instead, display the numeric group ID, same
as it does for vanished users.
Tom Lane [Tue, 28 Nov 2000 23:27:57 +0000 (23:27 +0000)]
Significant cleanups in SysV IPC handling (shared mem and semaphores).
IPC key assignment will now work correctly even when multiple postmasters
are using same logical port number (which is possible given -k switch).
There is only one shared-mem segment per postmaster now, not 3.
Rip out broken code for non-TAS case in bufmgr and xlog, substitute a
complete S_LOCK emulation using semaphores in spin.c. TAS and non-TAS
logic is now exactly the same.
When deadlock is detected, "Deadlock detected" is now the elog(ERROR)
message, rather than a NOTICE that comes out before an unhelpful ERROR.
Tom Lane [Mon, 27 Nov 2000 02:50:17 +0000 (02:50 +0000)]
After going to the trouble of finding where psql lives, seems like
pg_ctl should invoke it from there, not use whatever random psql might
(or might not) live in its $PATH.
Tatsuo Ishii [Sun, 26 Nov 2000 10:40:43 +0000 (10:40 +0000)]
Unicode conversion fix suggested by Jan Varga...
--------------------------------------------------
Subject: Bug in unicode conversion ...
From: Jan Varga <varga@utcru.sk>
To: t-ishii@sra.co.jp
Date: Sat, 18 Nov 2000 17:41:20 +0100 (CET)
Hi,
I tried this new feature in PostgreSQL. I found one bug.
Script UCS_to_8859.pl skips input lines which
1. code <0x80 or
2. ucs <0x100
I think second one is not good idea because some codes in ISO8859-2
have ucs <0x100 (e.g. 0xE9 - 0x00E9)
--------------------------------------------------
Tom Lane [Sat, 25 Nov 2000 22:43:08 +0000 (22:43 +0000)]
Make PGLC_setlocale() static, and document that it can't be used safely
for any other purpose than PGLC_localeconv()'s internal save/restore of
locale settings. Fix cash.c to call PGLC_localeconv() rather than
making a direct call to localeconv() --- the old way, if PGLC_localeconv()
had already cached a locale result, it would be overwritten by the first
cash_in or cash_out operation, leading to wrong-locale results later.
Probably no demonstrable bug today, since we only appear to be looking
at the LC_MONETARY results which should be the same anyway, but definitely
a gotcha waiting to strike.
Tom Lane [Sat, 25 Nov 2000 21:32:25 +0000 (21:32 +0000)]
Correct portability-related errors in inet expected output. I'm not
sure that broadcast('foo/32') means anything, but if it does, surely
it ought to return foo, not 255.255.255.255.
Tom Lane [Sat, 25 Nov 2000 20:33:54 +0000 (20:33 +0000)]
Store current LC_COLLATE and LC_CTYPE settings in pg_control during initdb;
re-adopt these settings at every postmaster or standalone-backend startup.
This should fix problems with indexes becoming corrupt due to failure to
provide consistent locale environment for postmaster at all times. Also,
refuse to start up a non-locale-enabled compilation in a database originally
initdb'd with a non-C locale. Suppress LIKE index optimization if locale
is not "C" or "POSIX" (are there any other locales where it's safe?).
Issue NOTICE during initdb if selected locale disables LIKE optimization.
Tom Lane [Sat, 25 Nov 2000 19:09:22 +0000 (19:09 +0000)]
Fix elog logic so that error messages displayed during initdb (or
other standalone-backend situations) are not duplicated. Remove some
dead code, add some comments, too.
Bruce Momjian [Sat, 25 Nov 2000 05:00:33 +0000 (05:00 +0000)]
here is a patch for formatting.c (to_char/timestampt()), for 7.1
it fixing Y,YY,YYY,YYYY conversion, the docs and regress tests update
are included too.
During the patch testing I found small bug in miscadmin.h in
convertstr() declaration. Here it's fixed too.
Bruce Momjian [Sat, 25 Nov 2000 04:38:00 +0000 (04:38 +0000)]
> > Looking some more, I found some other places that need a space (I
> > suspect...), so here is an updated patch.
>
> This seems like the wrong way to go about it, because anytime anyone
> changes any elog output anywhere, we'll risk another failure. If
> syslog can't cope with empty lines, I think the right fix is for the
> output-to-syslog routine to change the data just before sending ---
> then there is only one place to fix. See the syslog output routine in
> src/backend/utils/error/elog.c.
Makes sense. Here's a new patch, now the output even looks better:
Peter Eisentraut [Fri, 24 Nov 2000 20:16:40 +0000 (20:16 +0000)]
Make SET SESSION CHARACTERISTICS compliant with SQL 99. Remove redundant,
non-standard clauses. Allow CHARACTERISTICS as unquoted identifier.
Merge related reference pages.
Peter Eisentraut [Fri, 24 Nov 2000 17:44:22 +0000 (17:44 +0000)]
Revive Reference Manual, remove reference pages from User's Guide.
Make version.sgml the central place for updating version numbers in the
documentation. Document titles now contain the version number of the
release they belong to.
filelist.sgml is the central (and only) place to declare system entities
(i.e., sgml files). No longer a need to declare them in each document
header.
There is no longer any need to maintain duplicate chapter lists in
postgres.sgml and user/admin/etc.sgml, everything is build from the same
sources. Some parameter entities allow for different text to be included
when the integrated or a single doc set is generated, which eliminates the
problems that had caused this to fail in the past.
Tom Lane [Thu, 23 Nov 2000 03:57:31 +0000 (03:57 +0000)]
Ensure that mergejoin plan will be considered for FULL OUTER JOIN even
if enable_mergejoin = OFF. Must do this, because we have no other
implementation method for full joins.
Tom Lane [Wed, 22 Nov 2000 19:34:49 +0000 (19:34 +0000)]
Remove old, broken code for query_limit(), assert_enable(),
assert_test() functions --- these weren't accomplishing much except to
render the whole module un-loadable ...