Tom Lane [Tue, 11 Oct 2005 20:41:32 +0000 (20:41 +0000)]
Add infrastructure for making spins_per_delay variable depending on
whether we seem to be running in a uniprocessor or multiprocessor.
The adjustment rules could probably still use further tweaking, but
I'm convinced this should be a win overall.
Tom Lane [Tue, 11 Oct 2005 20:01:30 +0000 (20:01 +0000)]
Don't use a non-locked pre-test of the spinlock on x86_64 machines.
The pre-test has been shown to be a big loss on Opterons and at best a
wash on EM64T.
Tom Lane [Tue, 11 Oct 2005 17:27:14 +0000 (17:27 +0000)]
Document that get_attstatsslot/free_attstatsslot only need to be passed
valid type information if they are asked to fetch the values part of a
pg_statistic slot; these arguments are unneeded if fetching only the
numbers part. Use this to save a catcache lookup in btcostestimate,
which is looking like a bit of a hotspot in recent profiling. Not a
big savings, but since it's essentially free, might as well do it.
Tom Lane [Tue, 11 Oct 2005 16:44:40 +0000 (16:44 +0000)]
Fix oversight in 8.0 modification of RestrictInfo data structures.
A RestrictInfo representing an OR clause now contains two versions of
the contained expression, one with sub-RestrictInfos and one without.
clause_selectivity() should descend to the version with sub-RestrictInfos
so that it has a chance of caching its results for the OR's sub-clauses.
Failing to do so resulted in redundant planner effort.
Tom Lane [Mon, 10 Oct 2005 22:29:48 +0000 (22:29 +0000)]
Remove the DELETEs from pg_shadow and pg_group that pg_dumpall used to
emit when given the --clean option, in favor of individual DROP ROLE
commands. The old technique could not possibly work in 8.1, and was
never a very good idea anyway IMHO. The DROP ROLE approach has the
defect that the DROPs will fail for roles that own objects or have
privileges, but perhaps we can improve that later.
Tom Lane [Mon, 10 Oct 2005 20:02:20 +0000 (20:02 +0000)]
Use a safer order of operations in dropdb(): rollbackable operations,
ie removing shared-dependency entries, should happen before non-rollbackable
ones. That way a failure during the rollbackable part doesn't leave us
with inconsistent state.
Tom Lane [Mon, 10 Oct 2005 18:49:04 +0000 (18:49 +0000)]
Fix the problem of GRANTs creating "dangling" privileges not directly
traceable to grant options. As per my earlier proposal, a GRANT made by
a role member has to be recorded as being granted by the role that actually
holds the grant option, and not the member.
Tom Lane [Sun, 9 Oct 2005 17:21:47 +0000 (17:21 +0000)]
Fix (hopefully for the last time) problems with datetime values displaying
like '23:59:60' because of fractional-second roundoff problems. Trying
to control this upstream of the actual display code was hopeless; the right
way is to explicitly round fractional seconds in the display code and then
refigure the results if the fraction rounds up to 1. Per bug #1927.
Tom Lane [Sat, 8 Oct 2005 19:32:58 +0000 (19:32 +0000)]
Fix Kerberos authentication in wake of virtual-hosts changes --- need
to call krb5_sname_to_principal() always. Also, use krb_srvname rather
than the hardwired string 'postgres' as the appl_version string in the
krb5_sendauth/recvauth calls, to avoid breaking compatibility with PG
8.0. Magnus Hagander
Tom Lane [Fri, 7 Oct 2005 19:59:34 +0000 (19:59 +0000)]
Marginal performance improvement in aclmask(): don't bother with
testing ownership if the caller isn't interested in any GOPTION bits
(which is the common case). It did not matter in 8.0 where the ownership
test was just a trivial equality test, but it matters now.
Tom Lane [Fri, 7 Oct 2005 16:34:48 +0000 (16:34 +0000)]
Recognize ERROR_SHARING_VIOLATION (translate to EACCES), increase log
level for unrecognized win32 error codes to LOG, and make messages
conform to style guide. Per old suggestion from Qingqing Zhou, which
seems to have gotten lost in the shuffle.
Tom Lane [Fri, 7 Oct 2005 15:34:17 +0000 (15:34 +0000)]
(Apologies for fat-fingering cvs commit command...) Should have read:
Remove unportable use of tfind/tsearch in favor of bsearch. Fix up
random number generator to use random() not rand() and to actually honor
its min/max arguments properly. That wasn't so important before, but
with exposure of capability to ask for general ranges, it will be.
Bruce Momjian [Fri, 7 Oct 2005 14:04:19 +0000 (14:04 +0000)]
Update:
< * Consider compressing indexes by storing key prefix values shared by
> * Consider compressing indexes by storing key values duplicated in 735a736,737
>
> This is difficult because it requires datatype-specific knowledge.
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.