Tom Lane [Fri, 1 Mar 2002 04:09:28 +0000 (04:09 +0000)]
Teach planner about the idea that a mergejoin won't necessarily read
both input streams to the end. If one variable's range is much less
than the other, an indexscan-based merge can win by not scanning all
of the other table. Per example from Reinhard Max.
Tom Lane [Wed, 27 Feb 2002 23:16:07 +0000 (23:16 +0000)]
Tweak pg_exec_query_string so that we close down transaction command
before reporting command-complete message for the final command of a
query string. This way, any errors detected during finish_xact_command
(such as RI violations) will appear to be part of the final command,
rather than coming out after the command is reported complete. This
avoids confusing PQendcopy and other not-overly-bright clients.
Per Lee Harr's bug report of 25-Feb-02.
Tom Lane [Wed, 27 Feb 2002 20:59:05 +0000 (20:59 +0000)]
#ifdef out pg_dump's check on whether a sequence's sequence_name field
matches the sequence name from pg_class. This fails if the sequence has
been renamed, and seems rather pointless in any case.
Also improve a couple of error messages about inconsistencies.
Tom Lane [Wed, 27 Feb 2002 19:36:13 +0000 (19:36 +0000)]
Clean up BeginCommand and related routines. BeginCommand and EndCommand
are now both invoked once per received SQL command (raw parsetree) from
pg_exec_query_string. BeginCommand is actually just an empty routine
at the moment --- all its former operations have been pushed into tuple
receiver setup routines in printtup.c. This makes for a clean distinction
between BeginCommand/EndCommand (once per command) and the tuple receiver
setup/teardown routines (once per ExecutorRun call), whereas the old code
was quite ad hoc. Along the way, clean up the calling conventions for
ExecutorRun a little bit.
Tatsuo Ishii [Wed, 27 Feb 2002 01:34:41 +0000 (01:34 +0000)]
Fix bug in COPY FROM when DELIMITER is not in ASCII range.
See pgsql-bugs/pgsql-hackers discussion "COPY FROM is not 8bit clean"
around 2002/02/26 for more details -- Tatsuo Ishii
Tom Lane [Tue, 26 Feb 2002 22:47:12 +0000 (22:47 +0000)]
Restructure command-completion-report code so that there is just one
report for each received SQL command, regardless of rewriting activity.
Also ensure that this report comes from the 'original' command, not the
last command generated by rewrite; this fixes 7.2 breakage for INSERT
commands that have actions added by rules. Fernando Nasser and Tom Lane.
Tom Lane [Mon, 25 Feb 2002 21:37:42 +0000 (21:37 +0000)]
Tweak psql's \connect command to not downcase unquoted database and user
names. This is a temporary measure to allow backwards compatibility with
7.2 and earlier pg_dump. 7.2.1 and later pg_dump will double-quote mixed
case names in \connect. Once we feel that older dumps are not a problem
anymore, we can revert this change and treat \connect arguments as normal
SQL identifiers.
Bruce Momjian [Mon, 25 Feb 2002 18:48:54 +0000 (18:48 +0000)]
Add items and JDBC maintainers:
> o Add LISTEN/NOTIFY support to the JDBC driver (Barry) 479a481
> * Barry is Barry Lind <barry@xythos.com> 482a485
> * Dave is Dave Cramer <dave@fastcrypt.com>
Bruce Momjian [Mon, 25 Feb 2002 06:23:54 +0000 (06:23 +0000)]
Update completed items:
> * -Prevent SIGHUP and 'pg_ctl reload' from changing command line
> * -Remove LIMIT #,# and force use LIMIT and OFFSET clauses in 7.3 (Bruce)
> * -Prevent create/drop scripts from allowing extra args (Bruce)
> * -Have pg_dump -C dump database location and encoding information
Bruce Momjian [Mon, 25 Feb 2002 04:21:55 +0000 (04:21 +0000)]
This patch will allow arbitrary levels of analyze / rewriting
by making the static variables extra_before and extra_after
automatic so we can use recursion.
It gets much easier to generate extra commands now, and one can rest
assured that the extra commands will be properly analyzed/rewritten.
Without this patch, if a command produced by transformation tries to
use these static lists their first contents would be lost with
unpredictable results. I know I could fix this by just using nconc()
instead of assignments, but the resulting order of the commands would
not be exactly what one could expect.
Bruce Momjian [Mon, 25 Feb 2002 04:06:52 +0000 (04:06 +0000)]
I've attached a simple patch which should improve the performance of
hashname() and reduce the penalty incured when NAMEDATALEN is increased.
I posted this to -hackers a couple days ago, and there haven't been any
major complaints. It passes the regression tests. See -hackers for more
discussion, as well as the suggestion from Tom Lane on which this patch
is based.
Unless anyone sees any problems, please apply for 7.3.
Tom Lane [Sun, 24 Feb 2002 21:57:23 +0000 (21:57 +0000)]
Modify pg_dumpall so that output script uses new OWNER option of CREATE
DATABASE; also make it use SET SESSION AUTHORIZATION commands rather than
\connect commands. This makes it possible to restore databases belonging
to users who do not have CREATEDB privilege. It should also become at
least somewhat feasible to run the restore script under password
authentication --- you'll get one superuser password prompt per database,
rather than a large number of challenges for passwords belonging to
varying unspecified user names.
Tom Lane [Sun, 24 Feb 2002 20:20:21 +0000 (20:20 +0000)]
Add OWNER option to CREATE DATABASE, so superusers can create databases
on behalf of unprivileged users. Also, make '=' optional in CREATE
DATABASE syntax. From Gavin Sherry, with kibitzing and docs by Tom Lane.
Bruce Momjian [Sat, 23 Feb 2002 21:49:10 +0000 (21:49 +0000)]
OK'ed by Peter.
The attached patch enables plperl to build under Cygwin. It is
basically yet another BE_DLLLIBS patch with a perl MakeMaker twist. I
tried the patch under Red Hat 7.1 Linux too and I did not observe any
ill effects.
Tom Lane [Sat, 23 Feb 2002 20:55:46 +0000 (20:55 +0000)]
Guard against createdb --location=PGDATA foo; without this, the code
tries to create a symlink pointing at itself. Per trouble report from
Kenneth McDowell.
Bruce Momjian [Fri, 22 Feb 2002 05:47:50 +0000 (05:47 +0000)]
Please, apply attached patch of contrib/btree_gist to 7.2.1 and current
cvs.
The patch fixes memory leak during creation GiST index on timestamp
column.
Dave Cramer [Fri, 22 Feb 2002 02:58:24 +0000 (02:58 +0000)]
This patch fixes the exception thrown to inform the user the method
getColumnClassName(int) is not implemented. This will futher fixes method
ResultSet.getObject(int) since it requires the getColumnClassName(int) method to return the proper java class used to map the database column.
Tom Lane [Tue, 19 Feb 2002 20:11:20 +0000 (20:11 +0000)]
A bunch of changes aimed at reducing backend startup time...
Improve 'pg_internal.init' relcache entry preload mechanism so that it is
safe to use for all system catalogs, and arrange to preload a realistic
set of system-catalog entries instead of only the three nailed-in-cache
indexes that were formerly loaded this way. Fix mechanism for deleting
out-of-date pg_internal.init files: this must be synchronized with transaction
commit, not just done at random times within transactions. Drive it off
relcache invalidation mechanism so that no special-case tests are needed.
Cache additional information in relcache entries for indexes (their pg_index
tuples and index-operator OIDs) to eliminate repeated lookups. Also cache
index opclass info at the per-opclass level to avoid repeated lookups during
relcache load.
Generalize 'systable scan' utilities originally developed by Hiroshi,
move them into genam.c, use in a number of places where there was formerly
ugly code for choosing either heap or index scan. In particular this allows
simplification of the logic that prevents infinite recursion between syscache
and relcache during startup: we can easily switch to heapscans in relcache.c
when and where needed to avoid recursion, so IndexScanOK becomes simpler and
does not need any expensive initialization.
Eliminate useless opening of a heapscan data structure while doing an indexscan
(this saves an mdnblocks call and thus at least one kernel call).