| Commit message (Collapse) | Author | Age |
|
|
|
| |
for all SPI-created cursors.
|
|
|
|
| |
functions of the aggregate, at both aggregate creation and execution times.
|
|
|
|
|
|
| |
was large enough to be batched and the tuples fell into a batch where
there were no inner tuples at all. Thanks to Xiaoyu Wang for finding a
test case that exposed this long-standing bug.
|
|
|
|
|
| |
Not sure why this isn't causing serious problems in some simple tests,
but it definitely isn't going to do anything desirable...
|
|
|
|
|
|
|
| |
This is required by SQL spec to avoid failures in cases like
SELECT sum(win)/sum(lose) FROM ... GROUP BY ... HAVING sum(lose) > 0;
AFAICT we have gotten this wrong since day one. Kudos to Holger Jakobs
for being the first to notice.
|
|
|
|
| |
Per example from Jiang Wei.
|
|
|
|
|
|
|
| |
7.4 rewrite for hashed aggregate support. If the transition data type
is pass-by-reference, the transValue must be pfreed when starting a new
group boundary, else we have a one-value-per-group leakage. Thanks to
Rae Steining for providing a reproducible test case.
|
|
|
|
|
| |
simplistic; it recognized SELECT * FROM but not SELECT * FROM LIMIT.
Per bug report from Jeff Bohmer.
|
|
|
|
|
|
| |
when scanning a table that we need all the columns from. In case of
SELECT INTO, we have to check that the hasoids flag matches the desired
output type, too. Per report from Mike Mascari.
|
|
|
|
|
| |
number-of-buckets that exceeds the size we actually plan to allow
the hash table to grow to. Per trouble report from Sean Shanny.
|
|
|
|
|
| |
evaluating a set-valued function. This fixes some additional problems
with rescanning partially-evaluated SRFs.
|
|
|
|
|
|
| |
shut down cleanly if the plan node is ReScanned before the SRFs are run
to completion. This fixes the problem for SQL-language functions, but
still need work on functions using the SRF_XXX() macros.
|
|
|
|
|
|
|
|
|
|
| |
per report from Andrew Holm-Hansen. The difficulty arises from the fact
that the planner allowed a Hash node's hashkeys to share substructure
with the parent HashJoin node's hashclauses, plus some rather bizarre
choices about who initializes what during executor startup. A cleaner
but more invasive solution is to not store hashkeys separately in the
plan tree at all, but let the HashJoin node deconstruct hashclauses
during executor startup. I plan to fix it that way in HEAD.
|
| |
|
|
|
|
|
|
| |
rather than allocating them on the stack.
Fixes complaint from gcc 3.3.1.
|
| |
|
|
|
|
|
|
|
| |
when -fstrict-aliasing is turned on, as it is in the latest gcc when you
use -O2
Andrew Dunstan
|
|
|
|
|
|
|
| |
discussion on pgsql-hackers: in READ COMMITTED mode we just have to force
a QuerySnapshot update in the trigger, but in SERIALIZABLE mode we have
to run the scan under a current snapshot and then complain if any rows
would be updated/deleted that are not visible in the transaction snapshot.
|
|
|
|
|
|
|
| |
don't deal well with tuples having dropped columns. The attached fixes
the issue. Please apply.
Joe Conway
|
|
|
|
| |
during ExecInitTidScan, because the rest of the executor isn't ready.
|
| |
|
| |
|
|
|
|
|
|
| |
to allow es_snapshot to be set to SnapshotNow rather than a query snapshot.
This solves a bug reported by Wade Klaver, wherein triggers fired as a
result of RI cascade updates could misbehave.
|
|
|
|
|
| |
terms, add some clarifications, fix some untranslatable attempts at dynamic
message building.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
now able to cope with assigning new relfilenode values to nailed-in-cache
indexes, so they can be reindexed using the fully crash-safe method. This
leaves only shared system indexes as special cases. Remove the 'index
deactivation' code, since it provides no useful protection in the shared-
index case. Require reindexing of shared indexes to be done in standalone
mode, but remove other restrictions on REINDEX. -P (IgnoreSystemIndexes)
now prevents using indexes for lookups, but does not disable index updates.
It is therefore safe to allow from PGOPTIONS. Upshot: reindexing system catalogs
can be done without a standalone backend for all cases except
shared catalogs.
|
|
|
|
| |
_SPI_begin_call. Per gripe from Tomasz Myrta.
|
|
|
|
| |
changed, it should allow a zero value (implying no changes to make).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
really general fix might be difficult, I believe the only case where
AtCommit_Notify could see an uncommitted tuple is where the other guy
has just unlistened and not yet committed. The best solution seems to
be to just skip updating that tuple, on the assumption that the other
guy does not want to hear about the notification anyway. This is not
perfect --- if the other guy rolls back his unlisten instead of committing,
then he really should have gotten this notify. But to do that, we'd have
to wait to see if he commits or not, or make UNLISTEN hold exclusive lock
on pg_listener until commit. Either of these answers is deadlock-prone,
not to mention horrible for interactive performance. Do it this way
for now. (What happened to that project to do LISTEN/NOTIFY in memory
with no table, anyway?)
|
| |
|
|
|
|
|
| |
feature they complain about isn't a feature or cannot be implemented without
definitional changes.
|
|
|
|
|
|
|
| |
handling many-way scans: instead of re-evaluating all prior indexscan
quals to see if a tuple has been fetched more than once, use a hash table
indexed by tuple CTID. But fall back to the old way if the hash table
grows to exceed SortMem.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as well as the hash function (formerly the comparison function was hardwired
as memcmp()). This makes it possible to eliminate the special-purpose
hashtable management code in execGrouping.c in favor of using dynahash to
manage tuple hashtables; which is a win because dynahash knows how to expand
a hashtable when the original size estimate was too small, whereas the
special-purpose code was too stupid to do that. (See recent gripe from
Stephan Szabo about poor performance when hash table size estimate is way
off.) Free side benefit: when using string_hash, the default comparison
function is now strncmp() instead of memcmp(). This should eliminate some
part of the overhead associated with larger NAMEDATALEN values.
|
|
|
|
|
|
|
|
| |
be anything yielding an array of the proper kind, not only sub-ARRAY[]
constructs; do subscript checking at runtime not parse time. Also,
adjust array_cat to make array || array comply with the SQL99 spec.
Joe Conway
|
|
|
|
|
|
|
|
| |
yet, though). Avoid using nth() to fetch tlist entries; provide a
common routine get_tle_by_resno() to search a tlist for a particular
resno. This replaces a couple uses of nth() and a dozen hand-coded
search loops. Also, replace a few uses of nth(length-1, list) with
llast().
|
| |
|
|
|
|
| |
Per report from Mendola Gaetano.
|
| |
|
|
|
|
| |
macros in some platforms' sys/socket.h.
|
|
|
|
| |
so it won't miss 'em again.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
error, if any input element is NULL. This is not what we ultimately want,
but until arrays can have NULL elements, it will have to do. Patch from
Joe Conway.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
It also works to create a non-polymorphic aggregate from polymorphic
functions, should you want to do that. Regression test added, docs still
lacking. By Joe Conway, with some kibitzing from Tom Lane.
|
|
|
|
|
|
|
|
| |
ANYELEMENT. The effect is to postpone typechecking of the function
body until runtime. Documentation is still lacking.
Original patch by Joe Conway, modified to postpone type checking
by Tom Lane.
|
|
|
|
|
|
|
|
|
|
| |
'scalar op ALL (array)', where the operator is applied between the
lefthand scalar and each element of the array. The operator must
yield boolean; the result of the construct is the OR or AND of the
per-element results, respectively.
Original coding by Joe Conway, after an idea of Peter's. Rewritten
by Tom to keep the implementation strictly separate from subqueries.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
comparison functions), replacing the highly bogus bitwise array_eq. Create
a btree index opclass for ANYARRAY --- it is now possible to create indexes
on array columns.
Arrange to cache the results of catalog lookups across multiple array
operations, instead of repeating the lookups on every call.
Add string_to_array and array_to_string functions.
Remove singleton_array, array_accum, array_assign, and array_subscript
functions, since these were for proof-of-concept and not intended to become
supported functions.
Minor adjustments to behavior in some corner cases with empty or
zero-dimensional arrays.
Joe Conway (with some editorializing by Tom Lane).
|