Tom Lane [Thu, 6 Oct 2005 22:43:16 +0000 (22:43 +0000)]
Marginal speedup in RelationIsVisible and TypeIsVisible: avoid a redundant
cache lookup in the success case. This won't help much for cases where
the given relation is far down the search path, but it does not hurt in
any cases either; and it requires only a little new code. Per gripe from
Jim Nasby about slowness of \d with many tables.
Neil Conway [Thu, 6 Oct 2005 21:30:39 +0000 (21:30 +0000)]
Minor API cleanup for async notifications: we can only register the
current backend in pg_listener, so there is little point in making
the PID to register part of async.c's public API. Other minor tweaks.
Tom Lane [Thu, 6 Oct 2005 19:51:16 +0000 (19:51 +0000)]
When a function not returning RECORD has a single OUT parameter, use
the parameter's name (if any) as the default column name for SELECT FROM
the function, rather than the function name as previously. I still think
this is a bad idea, but I lost the argument. Force decompilation of
function RTEs to specify full aliases always, to reduce the odds of this
decision breaking dumped views.
Tom Lane [Thu, 6 Oct 2005 16:01:55 +0000 (16:01 +0000)]
Fix oversight in indexscan plan creation. I recently added code to use
predicate_implied_by() to detect redundant filter conditions, but forgot
that predicate_implied_by() assumes its first argument contains only
immutable functions. Add a check to guarantee that. Also, test to see
if filter conditions can be discarded because they are redundant with
the predicate of a partial index.
Tom Lane [Thu, 6 Oct 2005 02:29:23 +0000 (02:29 +0000)]
Revise pgstats stuff to fix the problems with not counting accesses
generated by bitmap index scans. Along the way, simplify and speed up
the code for counting sequential and index scans; it was both confusing
and inefficient to be taking care of that in the per-tuple loops, IMHO.
initdb forced because of internal changes in pg_stat view definitions.
Michael Meskes [Tue, 4 Oct 2005 13:28:21 +0000 (13:28 +0000)]
Somehow I missed some parser changes, so this commit comes pretty late. I just synced the parser of ecpg against the backend version, but still have to sync the lexer.
Also I fixed a bug in a bug fix I committed a few weeks ago. he check for a varchar pointer was incomplete.
Tom Lane [Mon, 3 Oct 2005 00:28:43 +0000 (00:28 +0000)]
Expand pg_control information so that we can verify that the database
was created on a machine with alignment rules and floating-point format
similar to the current machine. Per recent discussion, this seems like
a good idea with the increasing prevalence of 32/64 bit environments.
Tom Lane [Sun, 2 Oct 2005 23:50:16 +0000 (23:50 +0000)]
Change nextval and other sequence functions to specify their sequence
argument as a 'regclass' value instead of a text string. The frontend
conversion of text string to pg_class OID is now encapsulated as an
implicitly-invocable coercion from text to regclass. This provides
backwards compatibility to the old behavior when the sequence argument
is explicitly typed as 'text'. When the argument is just an unadorned
literal string, it will be taken as 'regclass', which means that the
stored representation will be an OID. This solves longstanding problems
with renaming sequences that are referenced in default expressions, as
well as new-in-8.1 problems with renaming such sequences' schemas or
moving them to another schema. All per recent discussion.
Along the way, fix some rather serious problems in dbmirror's support
for mirroring sequence operations (int4 vs int8 confusion for instance).
Tom Lane [Sat, 1 Oct 2005 18:43:19 +0000 (18:43 +0000)]
_SPI_execute_plan failed to return result tuple table to caller in
the ProcessUtility case, resulting in an intratransaction memory leak
if a utility command actually did return any tuples, as reported by
Dmitry Karasik. Fix this and also make the behavior more consistent
for cases involving nested SPI operations and multiple query trees,
by ensuring that we store the state locally until it is ready to be
returned to the caller.
Bruce Momjian [Fri, 30 Sep 2005 22:38:44 +0000 (22:38 +0000)]
One of the web pages mentioned in dmetaphone.c has moved. Also fix
a few typos in comments.
The dictionaries I checked list "altho" as a variant of "although,"
but I didn't find any other instances of the former in the source
tree so I changed it.
Tom Lane [Wed, 28 Sep 2005 21:17:02 +0000 (21:17 +0000)]
Repair planning bug introduced in 7.4: outer-join ON clauses that referenced
only the inner-side relation would be considered as potential equijoin clauses,
which is wrong because the condition doesn't necessarily hold above the point
of the outer join. Per test case from Kevin Grittner (bug#1916).
Tom Lane [Tue, 27 Sep 2005 17:43:31 +0000 (17:43 +0000)]
Some marginal tweaks to make 'make installcheck' mostly work when
building contrib with USE_PGXS. To make it work all the way, the
pg_regress script would need to be included in the installation tree.
Tom Lane [Tue, 27 Sep 2005 17:39:35 +0000 (17:39 +0000)]
Fix problems with PGXS builds against an installation tree that was
relocated after installation. We can't trust the installation paths
inserted into Makefile.global by configure, so instead we must get the
paths from pg_config. This requires extending pg_config to support all
the separately-configurable path names, but that was on TODO anyway.
Tom Lane [Tue, 27 Sep 2005 04:53:23 +0000 (04:53 +0000)]
Fix our version of strdup() to adhere to the standard semantics for
out-of-memory --- that is, return NULL rather than dumping core.
Noted by Qingqing Zhou.
Bruce Momjian [Mon, 26 Sep 2005 02:44:28 +0000 (02:44 +0000)]
Add:
> * Allow protocol-level BIND parameter values to be logged
> * Allow protocol-level EXECUTE that is actually a fetch to appear
> in the logs as a fetch rather than another execute
Tom Lane [Sun, 25 Sep 2005 19:37:35 +0000 (19:37 +0000)]
The original patch to avoid building a hash join's hashtable when the
outer relation is empty did not work, per test case from Patrick Welche.
It tried to use nodeHashjoin.c's high-level mechanisms for fetching an
outer-relation tuple, but that code expected the hash table to be filled
already. As patched, the code failed in corner cases such as having no
outer-relation tuples for the first hash batch. Revert and rewrite.
Tom Lane [Sat, 24 Sep 2005 15:34:07 +0000 (15:34 +0000)]
In a machine where INT64_IS_BUSTED, we can only support 32-bit values
for int8 and related types. However we might be talking to a client
that has working int64; so pq_getmsgint64 really needs to check the
incoming value and throw an overflow error if we can't represent it
accurately.
Bruce Momjian [Fri, 23 Sep 2005 20:32:49 +0000 (20:32 +0000)]
Add:
>
> o Display IN, INOUT, and OUT parameters in \df+
>
> It probably requires psql to output newlines in the proper
> column, which is already on the TODO list.