Tom Lane [Tue, 18 Oct 2005 20:38:58 +0000 (20:38 +0000)]
Code review for regexp_replace patch. Improve documentation and comments,
fix problems with replacement-string backslashes that aren't followed by
one of the expected characters, avoid giving the impression that
replace_text_regexp() is meant to be called directly as a SQL function,
etc.
Tom Lane [Tue, 18 Oct 2005 17:13:14 +0000 (17:13 +0000)]
Code review for spi_query/spi_fetchrow patch: handle errors sanely,
avoid leaking memory. I would add a regression test for error handling
except it seems eval{} can't be used in unprivileged plperl :-(
Joe Conway [Tue, 18 Oct 2005 02:55:49 +0000 (02:55 +0000)]
When a cursor is opened using dblink_open, only start a transaction
if there isn't one already open. Upon dblink_close, only commit
the open transaction if it was started by dblink_open, and only
then when all cursors opened by dblink_open are closed. The transaction
accounting is done individually for all named connections, plus
the persistent unnamed connection.
Tom Lane [Tue, 18 Oct 2005 01:06:24 +0000 (01:06 +0000)]
A few trivial code cleanups motivated by reading warnings generated
by a recent HP C compiler. Mostly, get rid of useless local variables
that are assigned to but never used.
Tom Lane [Mon, 17 Oct 2005 16:24:20 +0000 (16:24 +0000)]
Clean up libpq's pollution of application namespace by renaming the
exported routines of ip.c, md5.c, and fe-auth.c to begin with 'pg_'.
Also get rid of the vestigial fe_setauthsvc/fe_getauthsvc routines
altogether.
Tom Lane [Sun, 16 Oct 2005 21:22:12 +0000 (21:22 +0000)]
Add note that some versions of OS X require SHMMAX to be an exact multiple
of 4096. Also add comment explaining why we don't suggest using
/etc/sysctl.conf to avoid needing to edit /etc/rc.
Tom Lane [Sat, 15 Oct 2005 20:37:36 +0000 (20:37 +0000)]
Suppress warnings on platforms where fprintf is a macro (eg, recent
Fedora). This was already done by somebody for the core flex files,
but these contrib files seem to have been missed.
Neil Conway [Sat, 15 Oct 2005 01:47:12 +0000 (01:47 +0000)]
Merge some user-submitted suggestions for improvement into the
documentation. Mostly add some <xref>s, fix a few typos, and
document that zlib is required in the installation docs.
Tom Lane [Fri, 14 Oct 2005 20:53:56 +0000 (20:53 +0000)]
Fix syslog bug: if any messages are emitted to write_syslog before
the facility has been set, the facility gets set to LOCAL0 and cannot
be changed later. This seems reasonably plausible to happen, particularly
at higher debug log levels, though I am not certain it explains Han Holl's
recent report. Easiest fix is to teach the code how to change the value
on-the-fly, which is nicer anyway. I made the settings PGC_SIGHUP to
conform with log_destination.
Tom Lane [Fri, 14 Oct 2005 16:41:02 +0000 (16:41 +0000)]
Pass a strdup'd ident string to openlog(), to ensure that reallocation
of GUC memory doesn't cause us to start emitting a bogus ident string.
Per report from Han Holl. Also some trivial code cleanup in write_syslog.
Bruce Momjian [Thu, 13 Oct 2005 22:55:55 +0000 (22:55 +0000)]
This makes the error messages for PREPARE TRANSACTION, COMMIT PREPARED
etc. match the docs, which talk about "transaction identifier" not
"gid" or "global transaction identifier".
Tom Lane [Thu, 13 Oct 2005 21:09:38 +0000 (21:09 +0000)]
Adjust the discussion of triggers to more clearly guide people in the
direction of writing triggers in a procedural language, rather than C.
Per discussion.
Bruce Momjian [Thu, 13 Oct 2005 20:58:42 +0000 (20:58 +0000)]
The patch updates the documentation to reflect the fact that higher values
of client_min_messages (fatal + panic) are valid and also fixes a slight
issue with how psql tried to display error messages that aren't sent to
the client.
We often tell people to ignore errors in response to requests for things
like "drop if exists", but there's no good way to completely hide this
without upping client_min_messages past ERROR. When running a file like
SET client_min_messages TO 'FATAL';
DROP TABLE doesntexist;
with "psql -f filename" you get an error prefix of
"psql:/home/username/filename:3" even though there is no error message to
prefix because it isn't sent to the client.
Tom Lane [Thu, 13 Oct 2005 17:58:44 +0000 (17:58 +0000)]
Go back to emitting path names with forward slashes on Windows.
I'm not clear on what the double-backslash idea was intended to fix,
but it breaks at least mingw GNU Make. Per report from Thomas Hallgren.
Bruce Momjian [Thu, 13 Oct 2005 17:57:57 +0000 (17:57 +0000)]
Back out this because of fear of changing error strings:
This makes the error messages for PREPARE TRANSACTION, COMMIT PREPARED
etc. match the docs, which talk about "transaction identifier" not
"gid" or "global transaction identifier".
Bruce Momjian [Thu, 13 Oct 2005 17:57:17 +0000 (17:57 +0000)]
This makes the error messages for PREPARE TRANSACTION, COMMIT PREPARED
etc. match the docs, which talk about "transaction identifier" not
"gid" or "global transaction identifier".
Tom Lane [Thu, 13 Oct 2005 15:34:19 +0000 (15:34 +0000)]
Fix small oversight in recent patch to add more CREATE-FUNCTION-time
syntax checking to plpgsql: check_sql_expr() wasn't being called by
make_select_stmt(), so that there was no SQL syntax check for SELECT
statements.
Bruce Momjian [Thu, 13 Oct 2005 01:23:49 +0000 (01:23 +0000)]
Update:
> * Prevent PQfnumber() from lowercasing unquoted the column name
>
> PQfnumber() should never have been doing lowercasing, but historically
> it has so we need a way to prevent it
>
Tom Lane [Thu, 13 Oct 2005 00:06:46 +0000 (00:06 +0000)]
Don't try to remove duplicate OR-subclauses in create_bitmap_subplan and
make_restrictinfo_from_bitmapqual. The likelihood of finding duplicates
seems much less than in the AND-subclause case, and the cost much higher,
because OR lists with hundreds or even thousands of subclauses are not
uncommon. Per discussion with Ilia Kantor and andrew@supernews.
Bruce Momjian [Wed, 12 Oct 2005 22:39:35 +0000 (22:39 +0000)]
Remove item:
< * Prevent libpq's PQfnumber() from lowercasing the column name
<
< One idea is to lowercase all identifiers except those that are
< surrounded by quotes.
<
Tom Lane [Wed, 12 Oct 2005 17:18:03 +0000 (17:18 +0000)]
Fix longstanding bug found by Atsushi Ogawa: _bt_check_unique would mark
the wrong buffer dirty when trying to kill a dead index entry that's on
a page after the one it started on. No risk of data corruption, just
inefficiency, but still a bug.
Tom Lane [Wed, 12 Oct 2005 16:45:14 +0000 (16:45 +0000)]
Do all accesses to shared buffer headers through volatile-qualified
pointers, to ensure that compilers won't rearrange accesses to occur
while we're not holding the buffer header spinlock. It's probably
not necessary to mark volatile in every single place in bufmgr.c,
but better safe than sorry. Per trouble report from Kevin Grittner.
Bruce Momjian [Wed, 12 Oct 2005 14:06:46 +0000 (14:06 +0000)]
No longer needed:
<
< * Add code to detect an SMP machine and handle spinlocks accordingly
< from distributted.net, http://www1.distributed.net/source,
< in client/common/cpucheck.cpp
<
< On SMP machines, it is possible that locks might be released shortly,
< while on non-SMP machines, the backend should sleep so the process
< holding the lock can complete and release it.
Bruce Momjian [Wed, 12 Oct 2005 13:41:08 +0000 (13:41 +0000)]
Rearrange:
< o %Add dumping of comments on composite type columns
< o %Add dumping of comments on index columns
< o Stop dumping CASCADE on DROP TYPE commands in clean mode
> o %Add dumping of comments on index columns and composite type columns 604a603
> o Stop dumping CASCADE on DROP TYPE commands in clean mode
Bruce Momjian [Wed, 12 Oct 2005 03:26:38 +0000 (03:26 +0000)]
Add description:
< * Prevent libpq's PQfnumber() from lowercasing the column name?
> * Prevent libpq's PQfnumber() from lowercasing the column name
>
> One idea is to lowercase all identifiers except those that are
> surrounded by quotes.
>
Bruce Momjian [Tue, 11 Oct 2005 23:55:10 +0000 (23:55 +0000)]
Add:
> o Allow selection of individual object(s) of all types, not just
> tables
> o In a selective dump, allow dumping of an object and all its
> dependencies
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.