Tom Lane [Tue, 11 May 2004 02:21:55 +0000 (02:21 +0000)]
Repair recalculation failure for nested sub-SELECTs, per bug report from
Didier Moens. Bug is new in 7.4, and was caused by not updating everyplace
I should've when replacing locParam markers by allParam.
Tom Lane [Fri, 7 May 2004 03:20:01 +0000 (03:20 +0000)]
NATURAL CROSS JOIN is a contradiction in terms, not to mention disallowed
by the SQL spec and by our parser. Thanks to Jonathan Scott for finding
this longstanding error.
Tom Lane [Thu, 29 Apr 2004 19:56:35 +0000 (19:56 +0000)]
I thought we'd made initdb safe against newline-munging issues, but on
inspection we fixed only one of the two uses of COPY :-(. Fix the other.
This is already correct in CVS tip, but 7.4.3 could use the patch.
Tom Lane [Sun, 18 Apr 2004 18:13:31 +0000 (18:13 +0000)]
Tweak findTargetlistEntry so that bare names occurring in GROUP BY clauses
are sought first as local FROM columns, then as local SELECT-list aliases,
and finally as outer FROM columns; the former behavior made outer FROM
columns take precedence over aliases. This does not change spec
conformance because SQL99 allows only the first case anyway, and it seems
more useful and self-consistent. Per gripe from Dennis Bjorklund 2004-04-05.
Tom Lane [Tue, 6 Apr 2004 18:46:25 +0000 (18:46 +0000)]
Support FULL JOIN with no join clauses, such as X FULL JOIN Y ON TRUE.
That particular corner case is not exactly compelling, but given 7.4's
ability to discard redundant join clauses, it is possible for the situation
to arise from queries that are not so obviously silly. Per bug report
of 6-Apr-04.
Tom Lane [Tue, 6 Apr 2004 16:39:40 +0000 (16:39 +0000)]
ALTER SEQUENCE RESTART did the wrong thing if sequence last_value was
equal to the desired restart value (must clear is_called, did not).
Per bug report #1127 from Piotr Konieczny.
Bruce Momjian [Mon, 22 Mar 2004 03:57:19 +0000 (03:57 +0000)]
In working through a pg_autovacuum problem with Joe Conway (which turned
out to be the same problem reported by Cott Lang which the previous
patch resolved) a new bug was uncovered when running with a debug level
of greater than 1.
This patch resolves this new found bug and fixes some of the other
debugging output to be more consistent.
Tom Lane [Sat, 13 Mar 2004 00:54:35 +0000 (00:54 +0000)]
Repair memory leakage introduced into the non-hashed aggregate case by
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.
Tom Lane [Fri, 5 Mar 2004 01:54:13 +0000 (01:54 +0000)]
libpq's query to get the OIDs of large-object support functions was not
schema-safe. Make it so, and improve the internal support for knowledge
of server version.
Kris Jurka [Thu, 4 Mar 2004 03:25:10 +0000 (03:25 +0000)]
Update build number in anticipation of 7.4.2 release. With no
currently outstanding issues we'll flag now, so the release doesn't
slip out the door without it.
Tom Lane [Tue, 2 Mar 2004 21:14:59 +0000 (21:14 +0000)]
Always schema-qualify the name of a function referenced in CREATE CAST.
The former coding failed if the cast function was not in the pg_catalog
schema. How'd this escape detection?
Tom Lane [Tue, 2 Mar 2004 18:56:28 +0000 (18:56 +0000)]
Junkfilter logic to force a projection step during SELECT INTO was too
simplistic; it recognized SELECT * FROM but not SELECT * FROM LIMIT.
Per bug report from Jeff Bohmer.
Tom Lane [Sun, 29 Feb 2004 17:36:48 +0000 (17:36 +0000)]
make_sort_from_pathkeys()'s method for choosing which of several
equivalent sort expressions to use was broken: you can't just look
at the relation membership, you have to actually grovel over the
individual Vars in each expression. I think this did work when it
was written, but it was broken by subsequent optimizations that made
join relations not propagate every single input variable upward.
Must find the Var that got propagated, not choose one at random.
Per bug report from Daniel O'Neill.
Tom Lane [Fri, 27 Feb 2004 21:44:44 +0000 (21:44 +0000)]
genericcostestimate() neglected to include qual startup cost in
indexTotalCost. I think this may not make any real difference in 7.4,
but it definitely is a problem with CVS tip's new equation.
Tom Lane [Fri, 27 Feb 2004 21:42:10 +0000 (21:42 +0000)]
process_implied_equality must copy the substructure of the clauses it
is generating, to avoid problems when subselects are involved. Per
report from Damon Hart.
Tom Lane [Tue, 24 Feb 2004 22:59:22 +0000 (22:59 +0000)]
anyarray really needs to be declared with typalign = 'd', so that entries
in pg_statistic are correctly aligned if they contain values that require
double alignment. Too bad we cannot force initdb for this in 7.4 branch.
Joe Conway [Tue, 24 Feb 2004 06:07:34 +0000 (06:07 +0000)]
When returning type "record", replace use of pgresultGetTupleDesc
with ReturnSetInfo->expectedDesc. This allows custom datatypes
(e.g. from tsearch2) to be returned at runtime. Previous behavior
depended on the type oid to match between the remote and local
database, which obviously doesn't work well for custom types.
Per report from Mark Gibson.
Tom Lane [Tue, 24 Feb 2004 03:35:45 +0000 (03:35 +0000)]
Cause pg_dump to emit a 'SET client_encoding' command at the start of
any restore operation, thereby ensuring that dumped data is interpreted
the same way it was dumped even if the target database has a different
encoding. Per suggestions from Pavel Stehule and others. Also,
simplify scheme for handling check_function_bodies ... we may as well
just set that at the head of the script.
Tom Lane [Mon, 23 Feb 2004 23:03:43 +0000 (23:03 +0000)]
Replace opendir/closedir calls throughout the backend with AllocateDir
and FreeDir routines modeled on the existing AllocateFile/FreeFile.
Like the latter, these routines will avoid failing on EMFILE/ENFILE
conditions whenever possible, and will prevent leakage of directory
descriptors if an elog() occurs while one is open.
Also, reduce PANIC to ERROR in MoveOfflineLogs() --- this is not
critical code and there is no reason to force a DB restart on failure.
All per recent trouble report from Olivier Hubaut.
Tom Lane [Mon, 23 Feb 2004 20:46:16 +0000 (20:46 +0000)]
Do a direct probe during postmaster startup to determine the maximum
number of openable files and the number already opened. This eliminates
depending on sysconf(_SC_OPEN_MAX), and allows much saner behavior on
platforms where open-file slots are used up by semaphores.
Tom Lane [Sat, 21 Feb 2004 00:35:13 +0000 (00:35 +0000)]
Implement a solution to the 'Turkish locale downcases I incorrectly'
problem, per previous discussion. Make some additional changes to
centralize the knowledge of just how identifier downcasing is done,
in hopes of simplifying any future tweaking in this area.
Tom Lane [Fri, 13 Feb 2004 22:26:43 +0000 (22:26 +0000)]
Repair optimization bug I introduced in a moment of brain fade back in
Nov 2002: when constant-expression simplification removes all the
aggregate function calls from a query, that doesn't mean we can act as
though there never were any aggregates. Per bug report from Gabor Szucs.
Bruce Momjian [Fri, 13 Feb 2004 04:40:43 +0000 (04:40 +0000)]
Tom Lane wrote:
> momjian@svr1.postgresql.org (Bruce Momjian) writes:
>> someone asked me about the FK deadlock fix, mentioned in the 7.3.3
>> release notes as 3rd change:
>> http://www.postgresql.org/docs/current/static/release-7-3-3.html
>> Actually, that fix was available with 7.4, not 7.3. Don't know if we can
>> retroactively change the release-notes though.
>
> This is completely erroneous, please undo it.
>
> 2003-05-21 14:14 tgl
>
> * src/: backend/utils/adt/ri_triggers.c,
> test/regress/expected/foreign_key.out (REL7_3_STABLE): Back-patch
> Jan's fix to avoid primary key lookup (and lock) if foreign key
> does not change on UPDATE.
Oh ... didn't know that you did a backpatch. Sorry
Kris Jurka [Tue, 3 Feb 2004 05:43:24 +0000 (05:43 +0000)]
V3 NotificationResonse messages were trying to be received as V2
messages. Also the PID was being read in the wrong byte order.
Finally add a test case for listen/notify.
Kris Jurka [Tue, 3 Feb 2004 05:28:17 +0000 (05:28 +0000)]
ConnectionPool and SimpleDataSource are marked Serializable, but their
superclass (which contains a number of state variables) is not. To
correctly serialize these objects we need to manually implement
writeObject and readObject.
Kris Jurka [Tue, 3 Feb 2004 05:25:38 +0000 (05:25 +0000)]
ResultSet.next() and previous() incremented or decremented the
internal current_row variable regardless of wether they succeeded or
not. This generated some ArrayIndexOutOfBoundsExceptions when the
errorneous adjustment current_row led to out of range values.
Kris Jurka [Tue, 3 Feb 2004 05:13:56 +0000 (05:13 +0000)]
Fix the setXXXStream methods. If passed a null InputStream, convert
this to a setNull call. The code originally would try to read the
whole stream in one call to read(), but this doesn't work. The
InputStream API makes it clear you must be prepared to loop and
continue reading if you didn't get the whole request on the first
try.
Neil Conway [Mon, 2 Feb 2004 01:00:58 +0000 (01:00 +0000)]
Use Tcl_PutEnv() in place of putenv() in libpgtcl, as the latter can
apparently corrupt the Tcl runtime. Per suggestion from Michael
Brusser <michael@synchronicity.com>
Tom Lane [Wed, 28 Jan 2004 07:47:07 +0000 (07:47 +0000)]
Fix oversight in check_ungrouped_columns optimization that avoids
unnecessary checks for complex grouping expressions: we cannot check
whether the expressions are simple Vars until after we apply
flatten_join_alias_vars, because in the case of FULL JOIN that routine
can introduce non-Var expressions. Per example from Joel Knight.
Tom Lane [Wed, 28 Jan 2004 00:05:25 +0000 (00:05 +0000)]
simplify_function() mustn't try to evaluate functions that return
composite types, because TupleTableSlots aren't Datums and can't be
stored in Const nodes. We can remove this restriction if we ever
adopt a cleaner runtime representation for whole-tuple results, but
at the moment it's broken. Per example from Thomas Hallgren.
Tom Lane [Tue, 27 Jan 2004 00:50:52 +0000 (00:50 +0000)]
Run stats test separately, not as part of a parallel group, to avoid
possible failures due to stats collector not updating fast enough under
heavy load. Per report from Jeremy Yoder.
Tom Lane [Mon, 26 Jan 2004 19:16:23 +0000 (19:16 +0000)]
Repair incorrect order of operations in GetNewTransactionId(). We must
complete ExtendCLOG() before advancing nextXid, so that if that routine
fails, the next incoming transaction will try it again. Per trouble
report from Christopher Kings-Lynne.