Commit Graph

22526 Commits

Author SHA1 Message Date
Tom Lane 91d568e9bb Fix the sense of the test on DH_check()'s return value. This was preventing
custom-generated DH parameters from actually being used by the server.
Found by Michael Fuhr.
2006-05-12 22:44:36 +00:00
Tom Lane 2246e31775 Upon closer inspection, the sparc code in s_lock.c is dead code, and
always has been, because it's not got any .globl declaration!  We've
been relying on the solaris_sparc.s code instead.  Rip it out.
(Not back-patched, since this is just cosmetic cleanup.)
2006-05-12 16:50:52 +00:00
Bruce Momjian ce84b24c48 Fix typo in comment. 2006-05-11 23:27:35 +00:00
Tom Lane ab1ad7a653 Remove unnecessary .seg/.section directives, per Alan Stange. 2006-05-11 21:58:22 +00:00
Bruce Momjian ad98575617 Use SQL standard '' rather than \' for tutorial/sample code.
Backpatch to 8.1.X.
2006-05-11 19:21:14 +00:00
Tom Lane 637028afe1 Code review for standard_conforming_strings patch. Fix it so it does not
throw warnings for 100%-SQL-standard constructs, clean up some minor
infelicities, try to un-break ecpg to the best of my ability.  (It's not clear
how ecpg is going to find out the setting of standard_conforming_strings,
though.)  I think pg_dump still needs work, too.
2006-05-11 19:15:36 +00:00
Tom Lane 3fdeb189e9 Clean up code associated with updating pg_class statistics columns
(relpages/reltuples).  To do this, create formal support in heapam.c for
"overwrite" tuple updates (including xlog replay capability) and use that
instead of the ad-hoc overwrites we'd been using in VACUUM and CREATE INDEX.
Take the responsibility for updating stats during CREATE INDEX out of the
individual index AMs, and do it where it belongs, in catalog/index.c.  Aside
from being more modular, this avoids having to update the same tuple twice in
some paths through CREATE INDEX.  It's probably not measurably faster, but
for sure it's a lot cleaner than before.
2006-05-10 23:18:39 +00:00
Teodor Sigaev c1f39437d0 Some optimizations by Volkan YAZICI <yazicivo@ttnet.net.tr> 2006-05-10 11:39:12 +00:00
Teodor Sigaev 10dd8df68e Reduce size of critical section and remove call of user-defined functions in
insertion and deletion, modify gistSplit() to do not use buffers.

 TODO: gistvacuumcleanup and XLOG
2006-05-10 09:19:54 +00:00
Bruce Momjian 12049d343e Revert documentation mention of array dimension checking, in next paragraph. 2006-05-09 23:12:54 +00:00
Bruce Momjian 0c9fab6c3b Mention array dimmensions are not enforced either. 2006-05-09 16:31:23 +00:00
Bruce Momjian 3cd77da334 Build server libpgport with all non-FRONTEND object files. This is to
fix a Win32 bug where pipe.c included a file that used FRONTEND, but it
wasn't on the server-build list.
2006-05-08 02:18:50 +00:00
Tom Lane 5749f6ef0c Rewrite btree vacuuming to fold the former bulkdelete and cleanup operations
into a single mostly-physical-order scan of the index.  This requires some
ticklish interlocking considerations, but should create no material
performance impact on normal index operations (at least given the
already-committed changes to make scans work a page at a time).  VACUUM
itself should get significantly faster in any index that's degenerated to a
very nonlinear page order.  Also, we save one pass over the index entirely,
except in the case where there were no deletions to do and so only one pass
happened anyway.

Original patch by Heikki Linnakangas, rework by Tom Lane.
2006-05-08 00:00:17 +00:00
Tom Lane 09cb5c0e7d Rewrite btree index scans to work a page at a time in all cases (both
btgettuple and btgetmulti).  This eliminates the problem of "re-finding" the
exact stopping point, since the stopping point is effectively always a page
boundary, and index items are never moved across pre-existing page boundaries.
A small penalty is that the keys_are_unique optimization is effectively
disabled (and, therefore, is removed in this patch), causing us to apply
_bt_checkkeys() to at least one more tuple than necessary when looking up a
unique key.  However, the advantages for non-unique cases seem great enough to
accept this tradeoff.  Aside from simplifying and (sometimes) speeding up the
indexscan code, this will allow us to reimplement btbulkdelete as a largely
sequential scan instead of index-order traversal, thereby significantly
reducing the cost of VACUUM.  Those changes will come in a separate patch.

Original patch by Heikki Linnakangas, rework by Tom Lane.
2006-05-07 01:21:30 +00:00
Bruce Momjian 88d94a11bb Use $(LIBS:-lpgport=) rather than $(patsubst -lpgport,, $(LIBS)), for consistency. 2006-05-07 01:05:11 +00:00
Bruce Momjian 5ff2838c57 Add description:
* %Disallow changing DEFAULT expression of a SERIAL column?

>
>   This should be done only if the existing SERIAL problems cannot be
>   fixed.
>
2006-05-06 23:35:32 +00:00
Bruce Momjian d9d2d91544 Recommend more clearly custom pg_dump format over tar, buy showing
custom format examples first.
2006-05-06 23:25:37 +00:00
Bruce Momjian bcf860b7f3 Document SSL CRL usage by libpq. 2006-05-06 16:25:11 +00:00
Tom Lane cbc0539c2a Further minor simplification of relcache startup: don't need a static
needNewCacheFile flag anymore, it can just be local in RelationCacheInitializePhase2.
2006-05-06 15:51:07 +00:00
Bruce Momjian 069ad5fcc3 Add SSL CRL support to libpq. Recently added to the backend. 2006-05-06 02:24:39 +00:00
Bruce Momjian 3ecfdceaec Issue a log message if a CRL file exists and the SSL library does not
support CRL certificates.
2006-05-06 01:31:38 +00:00
Bruce Momjian 25c1c3cfd6 Seems some NetBSD 3.0 x86 systems still need float8-small-is-zero, so
patch reverted.
2006-05-05 18:10:35 +00:00
Bruce Momjian f454d6264d On Solaris ASM, / '/' is the comment for x86, while '!' is the comment
for Sparc

Robert Lor
2006-05-05 16:23:20 +00:00
Bruce Momjian c51c2777ec Use regression results float8-small-is-zero only for NetBSD < 3.0.
Backpatch to 8.1.X.

Simon Burge
2006-05-05 16:16:49 +00:00
Bruce Momjian e451014d8c Change Solaris comments from / to !.
Robert Lor
2006-05-05 12:22:42 +00:00
Bruce Momjian ee1b63a48b Update standards URL.
Robert Treat
2006-05-05 09:51:53 +00:00
Bruce Momjian 9bd5181068 Add/ cleanup:
< * %Disallow changing default expression of a SERIAL column?
> * %Disallow changing DEFAULT expression of a SERIAL column?
472a473,476
> * Add DEFAULT .. AS OWNER so permission checks are done as the table
>   owner
>
>   This would be useful for SERIAL nextval() calls and CHECK constraints.
2006-05-05 09:35:58 +00:00
Tom Lane 1e3496f26a Don't try to compile SSL CRL support if local SSL installation hasn't
got it.  Per buildfarm failure on 'canary'.
2006-05-04 22:18:38 +00:00
Tom Lane a43974c6ba Code review for contrib/pg_freespacemap. Add a storedpages column to
pg_freespacemap_relations --- while one could theoretically get that
number by counting rows in pg_freespacemap_pages, it's surely the hard
way to do it.  Avoid expensive and inconvenient conversion to and from
text format.  Minor code and docs cleanup.
2006-05-04 20:39:34 +00:00
Tom Lane 46287bd660 Simplify relcache startup sequence. With the new design of InitPostgres
it's not necessary to have three separate calls anymore.  This patch also
fixes things so we don't try to read pg_internal.init until after we've
obtained lock on the target database; which was fairly harmless, but it's
certainly cleaner this way.
2006-05-04 18:51:36 +00:00
Tom Lane 52667d56a3 Rethink the locking mechanisms used for CREATE/DROP/RENAME DATABASE.
The former approach used ExclusiveLock on pg_database, which being a
cluster-wide lock meant only one of these operations could proceed at
a time; worse, it also blocked all incoming connections in ReverifyMyDatabase.
Now that we have LockSharedObject(), we can use locks of different types
applied to databases considered as objects.  This allows much more
flexible management of the interlocking: two CREATE DATABASEs need not
block each other, and need not block connections except to the template
database being used.  Similarly DROP DATABASE doesn't block unrelated
operations.  The locking used in flatfiles.c is also much narrower in
scope than before.  Per recent proposal.
2006-05-04 16:07:29 +00:00
Tom Lane cb98e6fb8f Create a syscache for pg_database-indexed-by-oid, and make use of it
in various places that were previously doing ad hoc pg_database searches.
This may speed up database-related privilege checks a little bit, but
the main motivation is to eliminate the performance reason for having
ReverifyMyDatabase do such a lot of stuff (viz, avoiding repeat scans
of pg_database during backend startup).  The locking reason for having
that routine is about to go away, and it'd be good to have the option
to break it up.
2006-05-03 22:45:26 +00:00
Teodor Sigaev 5320c6cf6b Make GIN opclass worked with intarray extensions 2006-05-03 16:31:07 +00:00
Teodor Sigaev 2a58f3bff6 Fix typo noticed by Alvaro Herrera 2006-05-03 06:56:47 +00:00
Tom Lane f4923880b3 Fix calculation of plan node extParams to account for the possibility that one
initPlan sets a parameter for another.  This could not (I think) happen before
8.1, but it's possible now because the initPlans generated by MIN/MAX
optimization might themselves use initPlans.  We attach those initPlans as
siblings of the MIN/MAX ones, not children, to avoid duplicate computation
when multiple MIN/MAX aggregates are present; so this leads to the case of an
initPlan needing the result of a sibling initPlan, which is not possible with
ordinary query nesting.  Hadn't been noticed because in most contexts having
too much stuff listed in extParam is fairly harmless.  Fixes "plan should not
reference subplan's variable" bug reported by Catalin Pitis.
2006-05-03 00:24:56 +00:00
Tom Lane e57345975c Clean up API for ambulkdelete/amvacuumcleanup as per today's discussion.
This formulation requires every AM to provide amvacuumcleanup, unlike before,
but it's surely a whole lot cleaner.  Also, add an 'amstorage' column to
pg_am so that we can get rid of hardwired knowledge in DefineOpClass().
2006-05-02 22:25:10 +00:00
Tom Lane d3171dd64b Fix broken markup. 2006-05-02 18:07:51 +00:00
Tom Lane 67030eec1e Suppress some gcc warnings. 2006-05-02 15:48:11 +00:00
Tom Lane 2610a1fd5e Fix grammar of new error message. 2006-05-02 15:45:37 +00:00
Teodor Sigaev 2bee77e600 Add GIN opclases for another types 2006-05-02 15:23:16 +00:00
Teodor Sigaev 8a3631f8d8 GIN: Generalized Inverted iNdex.
text[], int4[], Tsearch2 support for GIN.
2006-05-02 11:28:56 +00:00
Tom Lane 427c6b5b98 Avoid assuming that statistics for a parent relation reflect the properties of
the union of its child relations as well.  This might have been a good idea
when it was originally coded, but it's a fatally bad idea when inheritance is
being used for partitioning.  It's better to have no stats at all than
completely misleading stats.  Per report from Mark Liberman.

The bug arguably exists all the way back, but I've only patched HEAD and 8.1
because we weren't particularly trying to support partitioning before 8.1.

Eventually we ought to look at deriving union statistics instead of just
punting, but for now the drop kick looks good.
2006-05-02 04:34:18 +00:00
Tom Lane a65a49429f Provide a namespace.c function for lookup of an operator with exact
input datatypes given, and use this before trying OpernameGetCandidates.
This is faster than the old method when there's an exact match, and it
does not seem materially slower when there's not.  And it definitely
makes some of the callers cleaner, because they didn't really want to
know about a list of candidates anyway.  Per discussion with Atsushi Ogawa.
2006-05-01 23:22:43 +00:00
Tom Lane 82a2881c5b Code review for GRANT CONNECT patch. Spell the privilege as CONNECT not
CONNECTION, fix a number of places that were missed (eg pg_dump support),
avoid executing an extra search of pg_database during startup.
2006-04-30 21:15:33 +00:00
Tom Lane 986085a7f0 Improve the representation of FOR UPDATE/FOR SHARE so that we can
support both FOR UPDATE and FOR SHARE in one command, as well as both
NOWAIT and normal WAIT behavior.  The more general code is actually
simpler and cleaner.
2006-04-30 18:30:40 +00:00
Bruce Momjian 931bfc9664 Done:
> 	o -Allow per-database permissions to be set via GRANT
2006-04-30 02:10:41 +00:00
Bruce Momjian 4899aaf2d5 Add GRANT CONNECTION ON DATABASE, to be used in addition to pg_hba.conf.
Gevik Babakhani
2006-04-30 02:09:07 +00:00
Bruce Momjian 87db3ad078 Add question mark:
> * %Disallow changing default expression of a SERIAL column?
2006-04-30 01:45:26 +00:00
Bruce Momjian 782df58a1c Revert patch pending more discussion:
Disallow changing DEFAULT expression of a SERIAL column.
2006-04-30 01:08:07 +00:00
Tom Lane 366682fb66 Remove sema.c, superseded by win32_sema.c. 2006-04-29 20:52:56 +00:00