]> granicus.if.org Git - postgresql/log
postgresql
16 years agochange fix for suppress_redundant_updates_trigger() where relation has Oids, to only...
Andrew Dunstan [Wed, 5 Nov 2008 19:15:15 +0000 (19:15 +0000)]
change fix for suppress_redundant_updates_trigger() where relation has Oids, to only apply if present Oid is invalid, per second thought from TGL

16 years agofix suppress_redundant_updates_trigger() where relation has Oids, per gripe from...
Andrew Dunstan [Wed, 5 Nov 2008 18:49:28 +0000 (18:49 +0000)]
fix suppress_redundant_updates_trigger() where relation has Oids, per gripe from KaiGai Kohei

16 years agoA few additional test cases for array functionality
Peter Eisentraut [Wed, 5 Nov 2008 12:27:09 +0000 (12:27 +0000)]
A few additional test cases for array functionality

16 years agoRename several aliases for PLpgSQL_datum.dno to also be called dno.
Tom Lane [Wed, 5 Nov 2008 00:07:54 +0000 (00:07 +0000)]
Rename several aliases for PLpgSQL_datum.dno to also be called dno.
Hopefully this will forestall future confusion about their roles.

Jonah Harris

16 years agoDocument that SSL is only possible on tcp/ip connections in the
Bruce Momjian [Tue, 4 Nov 2008 22:40:40 +0000 (22:40 +0000)]
Document that SSL is only possible on tcp/ip connections in the
postgresql.conf 'ssl' section.

16 years agoDocument that 'sslmode' is ignored for Unix domain socket communication;
Bruce Momjian [Tue, 4 Nov 2008 22:36:07 +0000 (22:36 +0000)]
Document that 'sslmode' is ignored for Unix domain socket communication;
backpatch to 8.3.X.

16 years agoRevert unwanted patch, per Tom.
Alvaro Herrera [Tue, 4 Nov 2008 21:00:15 +0000 (21:00 +0000)]
Revert unwanted patch, per Tom.

16 years agoRemove unused rfno from PLpgSQL_recfield
Alvaro Herrera [Tue, 4 Nov 2008 20:58:46 +0000 (20:58 +0000)]
Remove unused rfno from PLpgSQL_recfield

Jonah Harris

16 years agoFix bug introduced in recent patch to make plpython cope with OUT arguments:
Tom Lane [Tue, 4 Nov 2008 15:16:48 +0000 (15:16 +0000)]
Fix bug introduced in recent patch to make plpython cope with OUT arguments:
the proc->argnames array has to be initialized to zero immediately on creation,
since the error recovery path will try to free its elements.

16 years agoExperimental new support for building man pages via docbook2x, an XSL-based
Peter Eisentraut [Tue, 4 Nov 2008 14:58:22 +0000 (14:58 +0000)]
Experimental new support for building man pages via docbook2x, an XSL-based
tool chain.  With some polishing, this might help us get rid of our ancient
and crufty man page build mechanism.

16 years agoADD array_ndims function
Peter Eisentraut [Tue, 4 Nov 2008 14:49:12 +0000 (14:49 +0000)]
ADD array_ndims function

Author: Robert Haas <robertmhaas@gmail.com>

16 years agoFix compiler warning about uninitialized variable
Peter Eisentraut [Tue, 4 Nov 2008 11:04:06 +0000 (11:04 +0000)]
Fix compiler warning about uninitialized variable

16 years agoAdd missing colon to docs.
Bruce Momjian [Tue, 4 Nov 2008 04:18:50 +0000 (04:18 +0000)]
Add missing colon to docs.

16 years agoRemove tabs from SGML file.
Bruce Momjian [Tue, 4 Nov 2008 00:59:45 +0000 (00:59 +0000)]
Remove tabs from SGML file.

16 years agoDisallow LOCK TABLE outside a transaction block (or function), since this case
Tom Lane [Tue, 4 Nov 2008 00:57:19 +0000 (00:57 +0000)]
Disallow LOCK TABLE outside a transaction block (or function), since this case
almost certainly represents user error.  Per a gripe from Sebastian Böhm
and subsequent discussion.

16 years agoFix compiler warnings (including a seriously bogus elog call); minor
Tom Lane [Tue, 4 Nov 2008 00:29:39 +0000 (00:29 +0000)]
Fix compiler warnings (including a seriously bogus elog call); minor
code beautification.

16 years agoUse bool for a boolean flag.
Tom Lane [Mon, 3 Nov 2008 23:49:07 +0000 (23:49 +0000)]
Use bool for a boolean flag.

16 years agoAllow uuid_in() to parse a wider variety of variant input formats for the UUID
Peter Eisentraut [Mon, 3 Nov 2008 22:14:40 +0000 (22:14 +0000)]
Allow uuid_in() to parse a wider variety of variant input formats for the UUID
data type.  This patch takes the approach of allowing an optional hyphen after
each group of four hex digits.

Author: Robert Haas <robertmhaas@gmail.com>

16 years agoDept of second thoughts: seems it'd be safer if pg_typeof is marked
Tom Lane [Mon, 3 Nov 2008 21:09:17 +0000 (21:09 +0000)]
Dept of second thoughts: seems it'd be safer if pg_typeof is marked
stable not immutable, since it depends on system catalog contents.

16 years agoClean up the messy semantics (not to mention inefficiency) of PageGetTempPage
Tom Lane [Mon, 3 Nov 2008 20:47:49 +0000 (20:47 +0000)]
Clean up the messy semantics (not to mention inefficiency) of PageGetTempPage
by splitting it into three functions with better-defined behaviors.

Zdenek Kotala

16 years agosuppress_redundant_updates_trigger function.
Andrew Dunstan [Mon, 3 Nov 2008 20:17:21 +0000 (20:17 +0000)]
suppress_redundant_updates_trigger function.

16 years agoFix silly typo in previous commit.
Alvaro Herrera [Mon, 3 Nov 2008 19:26:07 +0000 (19:26 +0000)]
Fix silly typo in previous commit.

16 years agoFix TransactionIdSetStatusBit so that it doesn't try to change a transaction
Alvaro Herrera [Mon, 3 Nov 2008 19:24:03 +0000 (19:24 +0000)]
Fix TransactionIdSetStatusBit so that it doesn't try to change a transaction
from COMMITTED to SUBCOMMITTED during recovery.  This wasn't previously
possible, but it is now due to the recent changes on clog commit protocol for
subtransactions.

Simon Riggs

16 years agoFix two error-recovery bugs in describeOneTableDetails(), and make the code
Tom Lane [Mon, 3 Nov 2008 19:08:56 +0000 (19:08 +0000)]
Fix two error-recovery bugs in describeOneTableDetails(), and make the code
to dump sequence values cope with sequences outside the search path and/or
having names that need quoting.  No back-patch needed because these are new
problems in 8.4.

Kris Jurka  (also a little bit of code beautification by tgl)

16 years agoReduce the acceptable staleness of pgstat data for autovacuum, per the
Alvaro Herrera [Mon, 3 Nov 2008 19:03:41 +0000 (19:03 +0000)]
Reduce the acceptable staleness of pgstat data for autovacuum, per the
longstanding note in the source that this patch removes.

16 years agoAdd pg_typeof() function.
Tom Lane [Mon, 3 Nov 2008 17:51:13 +0000 (17:51 +0000)]
Add pg_typeof() function.

Brendan Jurd

16 years agoSmall shell syntax improvement.
Bruce Momjian [Mon, 3 Nov 2008 15:56:47 +0000 (15:56 +0000)]
Small shell syntax improvement.

16 years agoUpdate URL to Docbook DSSSL stylesheets, per Gabriele Bartolini.
Alvaro Herrera [Mon, 3 Nov 2008 15:39:38 +0000 (15:39 +0000)]
Update URL to Docbook DSSSL stylesheets, per Gabriele Bartolini.

16 years agoFix mistakes in comment headers
Alvaro Herrera [Mon, 3 Nov 2008 15:10:17 +0000 (15:10 +0000)]
Fix mistakes in comment headers

16 years agoFix incorrect comment in SSL code
Magnus Hagander [Mon, 3 Nov 2008 14:18:57 +0000 (14:18 +0000)]
Fix incorrect comment in SSL code

16 years agoChange the pgstat logic so that the stats collector writes the stats file only
Tom Lane [Mon, 3 Nov 2008 01:17:08 +0000 (01:17 +0000)]
Change the pgstat logic so that the stats collector writes the stats file only
upon requests from backends, rather than on a fixed 500msec cycle.  (There's
still throttling logic to ensure it writes no more often than once per
500msec, though.)  This should result in a significant reduction in stats file
write traffic in typical scenarios where the stats are demanded only
infrequently.

This approach also means that the former difficulty with changing
stats_temp_directory on-the-fly has gone away, so remove the caution about
that as well as the thrashing we did to minimize the trouble window.

In passing, also fix pgstat_report_stat() so that we will send a stats
message if we have function call stats but not table stats to report;
this fixes a bug in the recent patch to support function-call stats.

Martin Pihlak

16 years agoRemove the last vestiges of the MAKE_PTR/MAKE_OFFSET mechanism. We haven't
Tom Lane [Sun, 2 Nov 2008 21:24:52 +0000 (21:24 +0000)]
Remove the last vestiges of the MAKE_PTR/MAKE_OFFSET mechanism.  We haven't
allowed different processes to have different addresses for the shmem segment
in quite a long time, but there were still a few places left that used the
old coding convention.  Clean them up to reduce confusion and improve the
compiler's ability to detect pointer type mismatches.

Kris Jurka

16 years agoRemove all uses of the deprecated functions heap_formtuple, heap_modifytuple,
Tom Lane [Sun, 2 Nov 2008 01:45:28 +0000 (01:45 +0000)]
Remove all uses of the deprecated functions heap_formtuple, heap_modifytuple,
and heap_deformtuple in favor of the newer functions heap_form_tuple et al
(which do the same things but use bool control flags instead of arbitrary
char values).  Eliminate the former duplicate coding of these functions,
reducing the deprecated functions to mere wrappers around the newer ones.
We can't get rid of them entirely because add-on modules probably still
contain many instances of the old coding style.

Kris Jurka

16 years agoMove from strcmp to strncmp to be more tolerant for changes to the parser.
Michael Meskes [Sat, 1 Nov 2008 19:53:35 +0000 (19:53 +0000)]
Move from strcmp to strncmp to be more tolerant for changes to the parser.

16 years agoUse string component in index structure.
Michael Meskes [Sat, 1 Nov 2008 12:42:14 +0000 (12:42 +0000)]
Use string component in index structure.

16 years agoDo not eat memory even in case of an out-of-memory error.
Michael Meskes [Sat, 1 Nov 2008 08:55:21 +0000 (08:55 +0000)]
Do not eat memory even in case of an out-of-memory error.

16 years agoSimplify ExecutorRun's API and save some trivial number of cycles by having
Tom Lane [Fri, 31 Oct 2008 21:07:55 +0000 (21:07 +0000)]
Simplify ExecutorRun's API and save some trivial number of cycles by having
it just return void instead of sometimes returning a TupleTableSlot.  SQL
functions don't need that anymore, and noplace else does either.  Eliminating
the return value also means one less hassle for the ExecutorRun hook functions
that will be supported beginning in 8.4.

16 years agoUpdate FSM on WAL replay. This is a bit limited; the FSM is only updated
Heikki Linnakangas [Fri, 31 Oct 2008 19:40:27 +0000 (19:40 +0000)]
Update FSM on WAL replay. This is a bit limited; the FSM is only updated
on non-full-page-image WAL records, and quite arbitrarily, only if there's
less than 20% free space on the page after the insert/update (not on HOT
updates, though). The 20% cutoff should avoid most of the overhead, when
replaying a bulk insertion, for example, while ensuring that pages that
are full are marked as full in the FSM.

This is mostly to avoid the nasty worst case scenario, where you replay
from a PITR archive, and the FSM information in the base backup is really
out of date. If there was a lot of pages that the outdated FSM claims to
have free space, but don't actually have any, the first unlucky inserter
after the recovery would traverse through all those pages, just to find
out that they're full. We didn't have this problem with the old FSM
implementation, because we simply threw the FSM information away on a
non-clean shutdown.

16 years agoAllow SQL-language functions to return the output of an INSERT/UPDATE/DELETE
Tom Lane [Fri, 31 Oct 2008 19:37:56 +0000 (19:37 +0000)]
Allow SQL-language functions to return the output of an INSERT/UPDATE/DELETE
RETURNING clause, not just a SELECT as formerly.

A side effect of this patch is that when a set-returning SQL function is used
in a FROM clause, performance is improved because the output is collected into
a tuplestore within the function, rather than using the less efficient
value-per-call mechanism.

16 years agoAdded missing ';'
Michael Meskes [Fri, 31 Oct 2008 16:36:13 +0000 (16:36 +0000)]
Added missing ';'

16 years agoUnite ReadBufferWithFork, ReadBufferWithStrategy, and ZeroOrReadBuffer
Heikki Linnakangas [Fri, 31 Oct 2008 15:05:00 +0000 (15:05 +0000)]
Unite ReadBufferWithFork, ReadBufferWithStrategy, and ZeroOrReadBuffer
functions into one ReadBufferExtended function, that takes the strategy
and mode as argument. There's three modes, RBM_NORMAL which is the default
used by plain ReadBuffer(), RBM_ZERO, which replaces ZeroOrReadBuffer, and
a new mode RBM_ZERO_ON_ERROR, which allows callers to read corrupt pages
without throwing an error. The FSM needs the new mode to recover from
corrupt pages, which could happend if we crash after extending an FSM file,
and the new page is "torn".

Add fork number to some error messages in bufmgr.c, that still lacked it.

16 years agoThe conversion rule from postgres.sgml to postgres.xml didn't work with
Peter Eisentraut [Fri, 31 Oct 2008 14:35:30 +0000 (14:35 +0000)]
The conversion rule from postgres.sgml to postgres.xml didn't work with
BSD sed.  So write it in Perl, which is more portable and a bit faster, too.
We already use Perl for standard documentation builds, so this imposes no
additional requirement.

16 years agoAdd test case for CREATE CAST.
Heikki Linnakangas [Fri, 31 Oct 2008 09:17:17 +0000 (09:17 +0000)]
Add test case for CREATE CAST.

16 years agoAdd support for user-defined I/O conversion casts.
Heikki Linnakangas [Fri, 31 Oct 2008 08:39:22 +0000 (08:39 +0000)]
Add support for user-defined I/O conversion casts.

16 years agoMessage improvement
Peter Eisentraut [Fri, 31 Oct 2008 07:15:11 +0000 (07:15 +0000)]
Message improvement
(also backported to 8.3)

16 years agoUpdate back-branch release notes.
Tom Lane [Thu, 30 Oct 2008 22:22:24 +0000 (22:22 +0000)]
Update back-branch release notes.

16 years agoRevert previous patch to put the shared memory segment on win32
Magnus Hagander [Thu, 30 Oct 2008 17:04:09 +0000 (17:04 +0000)]
Revert previous patch to put the shared memory segment on win32
in the Global\ namespace, because it caused permission errors on
a lot of platforms.

We need to come up with something better for 8.4, but for now
revert to the pre-8.3.4 behaviour.

16 years agoUpdate time zone data files to tzdata release 2008i (DST law changes in
Tom Lane [Thu, 30 Oct 2008 13:16:52 +0000 (13:16 +0000)]
Update time zone data files to tzdata release 2008i (DST law changes in
Argentina, Brazil, Mauritius, Syria).

16 years agoMissing space in error message
Peter Eisentraut [Thu, 30 Oct 2008 12:28:51 +0000 (12:28 +0000)]
Missing space in error message

16 years agoFix recoveryLastXTime logic so that it actually does what one would expect.
Tom Lane [Thu, 30 Oct 2008 04:06:16 +0000 (04:06 +0000)]
Fix recoveryLastXTime logic so that it actually does what one would expect.
Per gripe from Kevin Grittner.  Backpatch to 8.3, where the bug was introduced.

16 years agoMove forgotten comment closer to where it matters.
Peter Eisentraut [Wed, 29 Oct 2008 16:23:07 +0000 (16:23 +0000)]
Move forgotten comment closer to where it matters.

16 years agoSupport for Sun Studio compiler on Linux
Peter Eisentraut [Wed, 29 Oct 2008 16:06:47 +0000 (16:06 +0000)]
Support for Sun Studio compiler on Linux

This basically takes some build system code that was previously labeled
"Solaris" and ties it to the compiler rather than the operating system.

Author: Julius Stroffek <Julius.Stroffek@Sun.COM>

16 years agoRemove tab from sgml file.
Bruce Momjian [Wed, 29 Oct 2008 14:35:04 +0000 (14:35 +0000)]
Remove tab from sgml file.

16 years agoUpdate on array features support
Peter Eisentraut [Wed, 29 Oct 2008 11:33:46 +0000 (11:33 +0000)]
Update on array features support

16 years agoSince SQL:2003, the array size specification in the SQL ARRAY syntax has
Peter Eisentraut [Wed, 29 Oct 2008 11:24:53 +0000 (11:24 +0000)]
Since SQL:2003, the array size specification in the SQL ARRAY syntax has
been optional.

16 years agoUse Autoconf provided AS_HELP_STRING macro to automatically format and
Peter Eisentraut [Wed, 29 Oct 2008 09:27:24 +0000 (09:27 +0000)]
Use Autoconf provided AS_HELP_STRING macro to automatically format and
align strings in the --help output.  Do this through our abstraction layer
to eliminate redundancy and randomness in configure.in.

16 years agoUnicode escapes in strings and identifiers
Peter Eisentraut [Wed, 29 Oct 2008 08:04:54 +0000 (08:04 +0000)]
Unicode escapes in strings and identifiers

16 years agoBe more tense about not creating tuplestores with randomAccess = true unless
Tom Lane [Wed, 29 Oct 2008 00:00:39 +0000 (00:00 +0000)]
Be more tense about not creating tuplestores with randomAccess = true unless
backwards scan could actually happen.  In particular, pass a flag to
materialize-mode SRFs that tells them whether they need to require random
access.  In passing, also suppress unneeded backward-scan overhead for a
Portal's holdStore tuplestore.  Per my proposal about reducing I/O costs for
tuplestores.

16 years agoExtend ExecMakeFunctionResult() to support set-returning functions that return
Tom Lane [Tue, 28 Oct 2008 22:02:06 +0000 (22:02 +0000)]
Extend ExecMakeFunctionResult() to support set-returning functions that return
via a tuplestore instead of value-per-call.  Refactor a few things to reduce
ensuing code duplication with nodeFunctionscan.c.  This represents the
reasonably noncontroversial part of my proposed patch to switch SQL functions
over to returning tuplestores.  For the moment, SQL functions still do things
the old way.  However, this change enables PL SRFs to be called in targetlists
(observe changes in plperl regression results).

16 years agoChange WorkTableScan to not support backward scan. The apparent support
Tom Lane [Tue, 28 Oct 2008 17:13:51 +0000 (17:13 +0000)]
Change WorkTableScan to not support backward scan.  The apparent support
didn't actually work, because nodeRecursiveunion.c creates the underlying
tuplestore with backward scan disabled; which is a decision that we shouldn't
reverse because of performance cost.  We could imagine adding signaling from
WorkTableScan to RecursiveUnion about whether backward scan is needed ...
but in practice it'd be a waste of effort, because there simply isn't any
current or plausible future scenario where WorkTableScan would be called on
to scan backward.  So just dike out the code that claims to support it.

16 years agoArrange to squeeze out the MINIMAL_TUPLE_PADDING in the tuple representation
Tom Lane [Tue, 28 Oct 2008 15:51:03 +0000 (15:51 +0000)]
Arrange to squeeze out the MINIMAL_TUPLE_PADDING in the tuple representation
written to temp files by tuplesort.c and tuplestore.c.  This saves 2 bytes per
row for 32-bit machines, and 6 bytes per row for 64-bit machines, which seems
worth the slight additional uglification of the tuple read/write routines.

16 years agoAdd WITH [NO] DATA clause to CREATE TABLE AS, per SQL.
Peter Eisentraut [Tue, 28 Oct 2008 14:09:45 +0000 (14:09 +0000)]
Add WITH [NO] DATA clause to CREATE TABLE AS, per SQL.

Also, since WITH is now a reserved word, simplify the token merging code to
only deal with WITH_TIME.

by Tom Lane and myself

16 years agoRemove support for (insecure) crypt authentication.
Magnus Hagander [Tue, 28 Oct 2008 12:10:44 +0000 (12:10 +0000)]
Remove support for (insecure) crypt authentication.

This breaks compatibility with pre-7.2 versions.

16 years agoDowngrade can't-happen error reports to elog().
Alvaro Herrera [Mon, 27 Oct 2008 22:15:05 +0000 (22:15 +0000)]
Downgrade can't-happen error reports to elog().

16 years agoNo need for extra code to log freezing zero tuples. Callers already check that
Alvaro Herrera [Mon, 27 Oct 2008 21:50:12 +0000 (21:50 +0000)]
No need for extra code to log freezing zero tuples.  Callers already check that
they are freezing a nonzero amount anyway.

16 years agoMake hba parsing error messages more specific.
Magnus Hagander [Mon, 27 Oct 2008 20:04:45 +0000 (20:04 +0000)]
Make hba parsing error messages more specific.

16 years agoInstall a more robust solution for the problem of infinite error-processing
Tom Lane [Mon, 27 Oct 2008 19:37:22 +0000 (19:37 +0000)]
Install a more robust solution for the problem of infinite error-processing
recursion when we are unable to convert a localized error message to the
client's encoding.  We've been over this ground before, but as reported by
Ibrar Ahmed, it still didn't work in the case of conversion failures for
the conversion-failure message itself :-(.  Fix by installing a "circuit
breaker" that disables attempts to localize this message once we get into
recursion trouble.

Patch all supported branches, because it is in fact broken in all of them;
though I had to add some missing translations to the older branches in
order to expose the failure in the particular test case I was using.

16 years agoAdd support for multiple error messages from libpq, by simply appending them
Magnus Hagander [Mon, 27 Oct 2008 09:42:31 +0000 (09:42 +0000)]
Add support for multiple error messages from libpq, by simply appending them
after each other (since we already add a newline on each, this makes them
multiline).

Previously a new error would just overwrite the old one, so for example any
error caused when trying to connect with SSL enabled would be overwritten
by the error message form the non-SSL connection when using sslmode=prefer.

16 years agoSQL:2008 syntax CURRENT_CATALOG, CURRENT_SCHEMA, SET CATALOG, SET SCHEMA.
Peter Eisentraut [Mon, 27 Oct 2008 09:37:47 +0000 (09:37 +0000)]
SQL:2008 syntax CURRENT_CATALOG, CURRENT_SCHEMA, SET CATALOG, SET SCHEMA.

16 years agoUpdate standalong libpq makefiles for msvc and bcc to work with the new
Magnus Hagander [Mon, 27 Oct 2008 09:10:04 +0000 (09:10 +0000)]
Update standalong libpq makefiles for msvc and bcc to work with the new
libpq events code.

Hiroshi Saito

16 years agoAllow EXPLAIN on CREATE TABLE AS.
Peter Eisentraut [Mon, 27 Oct 2008 08:47:14 +0000 (08:47 +0000)]
Allow EXPLAIN on CREATE TABLE AS.

16 years agoFeature list update
Peter Eisentraut [Mon, 27 Oct 2008 07:26:24 +0000 (07:26 +0000)]
Feature list update

16 years agoBetter solution to the IN-list issue: instead of having an arbitrary cutoff,
Tom Lane [Sun, 26 Oct 2008 02:46:25 +0000 (02:46 +0000)]
Better solution to the IN-list issue: instead of having an arbitrary cutoff,
treat Var and non-Var IN-list items differently.  Only non-Var items are
candidates to go into an ANY(ARRAY) construct --- we put all Vars as separate
OR conditions on the grounds that that leaves more scope for optimization.
Per suggestion from Robert Haas.

16 years agoBe a little smarter about qual handling for semi-joins: a qual that mentions
Tom Lane [Sat, 25 Oct 2008 19:51:32 +0000 (19:51 +0000)]
Be a little smarter about qual handling for semi-joins: a qual that mentions
only the outer side can be pushed down rather than having to be evaluated
at the join.

16 years agoAdd a heuristic to transformAExprIn() to make it prefer expanding "x IN (list)"
Tom Lane [Sat, 25 Oct 2008 17:19:09 +0000 (17:19 +0000)]
Add a heuristic to transformAExprIn() to make it prefer expanding "x IN (list)"
into an OR of equality comparisons, rather than x = ANY(ARRAY[...]), when there
are Vars in the right-hand side.  This avoids a performance regression compared
to pre-8.2 releases, in cases where the OR form can be optimized into scans
of multiple indexes.  Limit the possible downside by preferring this form only
when the list isn't very long (I set the cutoff at 32 elements, which is a
bit arbitrary but in the right ballpark).  Per discussion with Jim Nasby.

In passing, also make it try the OR form if it cannot select a common type
for the array elements; we've seen a complaint or two about how the OR form
worked for such cases and ARRAY doesn't.

16 years agoReduce the memory footprint of large pending-trigger-event lists, as per my
Tom Lane [Fri, 24 Oct 2008 23:42:35 +0000 (23:42 +0000)]
Reduce the memory footprint of large pending-trigger-event lists, as per my
recent proposal.  In typical cases, we now need 12 bytes per insert or delete
event and 16 bytes per update event; previously we needed 40 bytes per
event on 32-bit hardware and 80 bytes per event on 64-bit hardware.  Even
in the worst case usage pattern with a large number of distinct triggers being
fired in one query, usage is at most 32 bytes per event.  It seems to be a
bit faster than the old code as well, due to reduction of palloc overhead.

This commit doesn't address the TODO item of allowing the event list to spill
to disk; rather it's trying to stave off the need for that.  However, it
probably makes that task a bit easier by reducing the data structure's
dependency on pointers.  It would now be practical to dump an event list to
disk by "chunks" instead of individual events.

16 years agoReplace now unnecessary goto statements by using return directly.
Magnus Hagander [Fri, 24 Oct 2008 12:48:31 +0000 (12:48 +0000)]
Replace now unnecessary goto statements by using return directly.

16 years agoRemove notes from the frontend SSL source that are incorrect or
Magnus Hagander [Fri, 24 Oct 2008 12:29:11 +0000 (12:29 +0000)]
Remove notes from the frontend SSL source that are incorrect or
end-user documentation that lives in the actual documentation.

16 years agoRemove a "TODO-list" structure at the top of the file, referring back
Magnus Hagander [Fri, 24 Oct 2008 12:24:35 +0000 (12:24 +0000)]
Remove a "TODO-list" structure at the top of the file, referring back
to the old set of SSL patches. Hasn't been updated since, and we keep
the TODOs in the "real" TODO list, really...

16 years agoRemove large parts of the old SSL readme, that consisted of a couple
Magnus Hagander [Fri, 24 Oct 2008 11:48:29 +0000 (11:48 +0000)]
Remove large parts of the old SSL readme, that consisted of a couple
of copy/paste:d emails. Much of the contents had already been migrated
into the main documentation, some was out of date and some just plain
wrong.

Keep the "protocol-flowchart" which can still be useful.

16 years agoFix memory leak when using gsslib parameter in libpq connections
Magnus Hagander [Thu, 23 Oct 2008 16:17:19 +0000 (16:17 +0000)]
Fix memory leak when using gsslib parameter in libpq connections

16 years agoFix an oversight in two different recent patches: nodes that support SRFs
Tom Lane [Thu, 23 Oct 2008 15:29:23 +0000 (15:29 +0000)]
Fix an oversight in two different recent patches: nodes that support SRFs
in their targetlists had better reset ps_TupFromTlist during ReScan calls.
There's no need to back-patch here since nodeAgg and nodeGroup didn't
even pretend to support SRFs in prior releases.

16 years agoRemove useless ps_OuterTupleSlot field from PlanState. I suppose this was
Tom Lane [Thu, 23 Oct 2008 14:34:34 +0000 (14:34 +0000)]
Remove useless ps_OuterTupleSlot field from PlanState.  I suppose this was
used long ago, but in the current code the ecxt_outertuple field of
ExprContext is doing all the work.  Spotted by Ran Tang.

16 years ago* make pg_hba authoption be a set of 0 or more name=value pairs
Magnus Hagander [Thu, 23 Oct 2008 13:31:10 +0000 (13:31 +0000)]
* make pg_hba authoption be a set of 0 or more name=value pairs
* make LDAP use this instead of the hacky previous method to specify
  the DN to bind as
* make all auth options behave the same when they are not compiled
  into the server
* rename "ident maps" to "user name maps", and support them for all
  auth methods that provide an external username

This makes a backwards incompatible change in the format of pg_hba.conf
for the ident, PAM and LDAP authentication methods.

16 years agoFeature T173 "Extended LIKE clause in table definition" is supported
Peter Eisentraut [Thu, 23 Oct 2008 08:52:51 +0000 (08:52 +0000)]
Feature T173 "Extended LIKE clause in table definition" is supported
(INCLUDING/EXCLUDING DEFAULTS)

16 years agoFeature T401 is not listed in the SQL standard. Must have been a mistake.
Peter Eisentraut [Thu, 23 Oct 2008 06:58:02 +0000 (06:58 +0000)]
Feature T401 is not listed in the SQL standard.  Must have been a mistake.

16 years agoWhen estimating without benefit of MCV lists (suggesting that one or both
Tom Lane [Thu, 23 Oct 2008 00:24:50 +0000 (00:24 +0000)]
When estimating without benefit of MCV lists (suggesting that one or both
inputs is unique or nearly so), make eqjoinsel() clamp the ndistinct estimates
to be not more than the estimated number of rows coming from the input
relations.  This allows the estimate to change in response to the selectivity
of restriction conditions on the inputs.

This is a pretty narrow patch and maybe we should be more aggressive about
similarly clamping ndistinct in other cases; but I'm worried about
double-counting the effects of the restriction conditions.  However, it seems
to help for the case exhibited by Grzegorz Jaskiewicz (antijoin against a
small subset of a relation), so let's try this for awhile.

16 years agoDept of better ideas: refrain from creating the planner's placeholder_list
Tom Lane [Wed, 22 Oct 2008 20:17:52 +0000 (20:17 +0000)]
Dept of better ideas: refrain from creating the planner's placeholder_list
until vars are distributed to rels during query_planner() startup.  We don't
really need it before that, and not building it early has some advantages.
First, we don't need to put it through the various preprocessing steps, which
saves some cycles and eliminates the need for a number of routines to support
PlaceHolderInfo nodes at all.  Second, this means one less unused plan for any
sub-SELECT appearing in a placeholder's expression, since we don't build
placeholder_list until after sublink expansion is complete.

16 years agoFix GiST's killing tuple: GISTScanOpaque->curpos wasn't
Teodor Sigaev [Wed, 22 Oct 2008 12:53:56 +0000 (12:53 +0000)]
Fix GiST's killing tuple: GISTScanOpaque->curpos wasn't
correctly set. As result, killtuple() marks as dead
wrong tuple on page. Bug was introduced by me while fixing
possible duplicates during GiST index scan.

16 years agoSQL:2008 alternative syntax for LIMIT/OFFSET:
Peter Eisentraut [Wed, 22 Oct 2008 11:00:34 +0000 (11:00 +0000)]
SQL:2008 alternative syntax for LIMIT/OFFSET:
OFFSET num {ROW|ROWS} FETCH {FIRST|NEXT} [num] {ROW|ROWS} ONLY

16 years agoAdd a concept of "placeholder" variables to the planner. These are variables
Tom Lane [Tue, 21 Oct 2008 20:42:53 +0000 (20:42 +0000)]
Add a concept of "placeholder" variables to the planner.  These are variables
that represent some expression that we desire to compute below the top level
of the plan, and then let that value "bubble up" as though it were a plain
Var (ie, a column value).

The immediate application is to allow sub-selects to be flattened even when
they are below an outer join and have non-nullable output expressions.
Formerly we couldn't flatten because such an expression wouldn't properly
go to NULL when evaluated above the outer join.  Now, we wrap it in a
PlaceHolderVar and arrange for the actual evaluation to occur below the outer
join.  When the resulting Var bubbles up through the join, it will be set to
NULL if necessary, yielding the correct results.  This fixes a planner
limitation that's existed since 7.1.

In future we might want to use this mechanism to re-introduce some form of
Hellerstein's "expensive functions" optimization, ie place the evaluation of
an expensive function at the most suitable point in the plan tree.

16 years agoClean regression.out
Peter Eisentraut [Tue, 21 Oct 2008 10:51:24 +0000 (10:51 +0000)]
Clean regression.out

16 years agoUse format_type_be() instead of TypeNameToString() for some more user-facing
Peter Eisentraut [Tue, 21 Oct 2008 10:38:51 +0000 (10:38 +0000)]
Use format_type_be() instead of TypeNameToString() for some more user-facing
error messages where the type existence is established.

16 years agoAllow SQL:2008 syntax ALTER TABLE ... ALTER COLUMN ... SET DATA TYPE
Peter Eisentraut [Tue, 21 Oct 2008 08:38:16 +0000 (08:38 +0000)]
Allow SQL:2008 syntax ALTER TABLE ... ALTER COLUMN ... SET DATA TYPE
alongside our traditional syntax.

16 years agoProperly access a buffer's LSN using existing access macros instead of abusing
Alvaro Herrera [Mon, 20 Oct 2008 21:11:15 +0000 (21:11 +0000)]
Properly access a buffer's LSN using existing access macros instead of abusing
knowledge of page layout.

Stolen from Jonah Harris' CRC patch

16 years agoThese functions no longer return a value, per complaint from gothic_moth via
Alvaro Herrera [Mon, 20 Oct 2008 20:38:24 +0000 (20:38 +0000)]
These functions no longer return a value, per complaint from gothic_moth via
Zdenek Kotala.

16 years agoRework subtransaction commit protocol for hot standby.
Alvaro Herrera [Mon, 20 Oct 2008 19:18:18 +0000 (19:18 +0000)]
Rework subtransaction commit protocol for hot standby.

This patch eliminates the marking of subtransactions as SUBCOMMITTED in pg_clog
during their commit; instead they remain in-progress until main transaction
commit.  At main transaction commit, the commit protocol is atomic-by-page
instead of one transaction at a time.  To avoid a race condition with some
subtransactions appearing committed before others in the case where they span
more than one pg_clog page, we conserve the logic that marks them subcommitted
before marking the parent committed.

Simon Riggs with minor help from me

16 years agoRemove support of backward scan in GiST. Per discussion
Teodor Sigaev [Mon, 20 Oct 2008 16:35:14 +0000 (16:35 +0000)]
Remove support of backward scan in GiST. Per discussion
http://archives.postgresql.org/pgsql-hackers/2008-10/msg00857.php

16 years agoSQL 200N -> SQL:2003
Peter Eisentraut [Mon, 20 Oct 2008 14:26:28 +0000 (14:26 +0000)]
SQL 200N -> SQL:2003

16 years agoFeature T411 is not found in SQL:2003 or 2008 anymore, so it must have been
Peter Eisentraut [Mon, 20 Oct 2008 14:22:57 +0000 (14:22 +0000)]
Feature T411 is not found in SQL:2003 or 2008 anymore, so it must have been
dropped or it was a mistake.