Barry Lind [Tue, 22 Jul 2003 05:13:05 +0000 (05:13 +0000)]
Fix to prevent SQL injection attacks when calling setObject(int,Object,int)
where the Object is a String and the type is numeric (i.e. INTEGER,LONG,etc).
The fix applies the standard escaping for these values.
Tom Lane [Thu, 17 Jul 2003 20:14:09 +0000 (20:14 +0000)]
For COMMENT ON DATABASE where database name is unknown or not the current
database, emit a WARNING and do nothing, rather than raising ERROR.
Per recent discussion in which we concluded this is the best way to deal
with database dumps that are reloaded into a database of a new name.
Tom Lane [Thu, 17 Jul 2003 16:45:25 +0000 (16:45 +0000)]
Repair boundary-case bug introduced by patch of two months ago that
fixed incorrect initial setting of StartUpID. The logic in XLogWrite()
expects that Write->curridx is advanced to the next page as soon as
LogwrtResult points to the end of the current page, but StartupXLOG()
failed to make that happen when the old WAL ended exactly on a page
boundary. Per trouble report from Hannu Krosing.
Tom Lane [Wed, 25 Jun 2003 20:07:54 +0000 (20:07 +0000)]
Don't generate 'zero' typeids in the output from gen_cross_product.
This is no longer necessary or appropriate since we don't use zero typeid
as a wildcard anymore, and it fixes a nasty performance problem with
functions with many parameters. Per recent example from Reuven Lerner.
Bruce Momjian [Wed, 25 Jun 2003 04:09:15 +0000 (04:09 +0000)]
[ Backpatch to 7.3.X.]
If they're not, the below causes problems, as the foreign key is added
after the CHECK. Cluster depends on the index name, so I thought it
wise to ensure all names are available, rather than leaving off the
CONSTRAINT "$n" portion for internally named constraints.
Tom Lane [Fri, 6 Jun 2003 16:25:52 +0000 (16:25 +0000)]
Add defense in assign_session_authorization() against trying to do
catalog lookups when not in a transaction. This prevents bizarre
failures if someone tries to set a value for session_authorization in
postgresql.conf. Per report from Fernando Nasser.
Tom Lane [Thu, 22 May 2003 14:39:49 +0000 (14:39 +0000)]
Repair sometimes-incorrect computation of StartUpID after a crash, per
example from Rao Kumar. This is a very corner corner-case, requiring
a minimum of three closely-spaced database crashes and an unlucky
positioning of the second recovery's checkpoint record before you'd notice
any problem. But the consequences are dire enough that it's a must-fix.
Tom Lane [Mon, 19 May 2003 17:23:54 +0000 (17:23 +0000)]
Back-patch change to avoid O(N^2) behavior with lots of deferred triggers,
by making deferredTriggerInvokeEvents only scan events added since it last ran.
Tom Lane [Sat, 10 May 2003 18:01:49 +0000 (18:01 +0000)]
Adjust CreateCheckpoint so that buffer dumping activities and cleanup of
dead xlog segments are not considered part of a critical section. It is
not necessary to force a database-wide panic if we get a failure in these
operations. Per recent trouble reports.
Tom Lane [Sun, 4 May 2003 04:30:35 +0000 (04:30 +0000)]
Allow 60 in seconds fields of timestamp, time, interval input values.
Per recent discussion on pgsql-general, this is appropriate for spec
compliance, and has the nice side-effect of easing porting from old
pg_dump files that exhibit the 59.999=>60.000 roundoff problem.
Tom Lane [Sun, 4 May 2003 00:04:10 +0000 (00:04 +0000)]
When a TIMESTAMP, TIME, or INTERVAL precision is specified larger than our
implementation limits, do not issue an ERROR; instead issue a NOTICE and use
the max supported value. Per pgsql-general discussion of 28-Apr, this is
needed to allow easy porting from pre-7.3 releases where the limits were
higher.
Unrelated change in same area: accept GLOBAL TEMP/TEMPORARY as a synonym
for TEMPORARY, as per pgsql-hackers discussion of 15-Apr. We previously
rejected it, but that was based on a misreading of the spec --- SQL92's
GLOBAL temp tables are really closer to what we have than their LOCAL ones.
Tom Lane [Sat, 3 May 2003 22:19:18 +0000 (22:19 +0000)]
Fix erroneous space calculation leading to core dump in dumpProcLangs,
per report from Olivier Prenant. Also fix off-by-one space calculation
in ReadToc; this woould not have hurt us until we had more than 100
dependencies for a single object, but wrong is wrong.
Tom Lane [Sat, 26 Apr 2003 22:21:58 +0000 (22:21 +0000)]
Repair permissions problem in RI triggers: query parsing has to be done
as the correct user, not only query execution. Per report from Sean
Chittenden.
Tom Lane [Sat, 26 Apr 2003 15:19:05 +0000 (15:19 +0000)]
Correct oversight in createlang: test for pre-existing handler function
was broken by opaque->language_handler change. I see this is already
fixed in CVS tip, but must back-patch for 7.3.3.
Tom Lane [Sun, 20 Apr 2003 17:37:22 +0000 (17:37 +0000)]
Fix char-vs-pg_wchar confusion in p_ere(), per failure report from
Tom O'Dowd. This fix is not relevant to CVS tip anymore, but we should
fix it in 7.3.*.
Tom Lane [Thu, 17 Apr 2003 04:50:35 +0000 (04:50 +0000)]
Fix abstime-to-time cast function, which has had broken implementation
since 7.2, per bug #947. Turns out it had wrong volatility label, too.
Can't force initdb in 7.3 branch, but fix anyway for future installs.
Barry Lind [Thu, 17 Apr 2003 04:19:55 +0000 (04:19 +0000)]
Applied patches from Kris Jurka fixing a string tokenizing problem and
fixing an order by problem for index metadata results.
Also includes removing some unused code as well as a fix to the toString
method on statement.
Tom Lane [Tue, 15 Apr 2003 05:18:30 +0000 (05:18 +0000)]
eqjoinsel's logic for case where MCV lists are not present should
account for NULLs; in hindsight this is obvious since the code for
the MCV-lists case would reduce to this when there are zero entries
in both lists. Per example from Alec Mitchell.
Tom Lane [Thu, 10 Apr 2003 02:47:57 +0000 (02:47 +0000)]
Remove premature attempt to constant-fold type coercion expressions.
While usually safe, this fails if the coercion function needs the
query snapshot to be set already. Per example from Nigel Andrews.
Tom Lane [Fri, 4 Apr 2003 00:32:57 +0000 (00:32 +0000)]
Back-patch changes to validate page header fields immediately after
reading in any page. Also back-port the zero_damaged_pages boolean
that determines what to do about it.
Tom Lane [Mon, 31 Mar 2003 20:32:50 +0000 (20:32 +0000)]
TestConfiguration returns int, not bool. This mistake is relatively
harmless on signed-char machines but would lead to core dump in the
deadlock detection code if char is unsigned. Amazingly, this bug has
been here since 7.1 and yet wasn't reported till now. Thanks to Robert
Bruccoleri for providing the opportunity to track it down.
Bruce Momjian [Sat, 29 Mar 2003 03:57:05 +0000 (03:57 +0000)]
[ Backpatch to 7.3.X.]
typing error in src/backend/libpq/be-secure.c ???
Long Description
In src/backend/libpq/be-secure.c: secure_write
on SSL_ERROR_WANT_WRITE call secure_read instead
secure_write again. May be is this a typing error?
Sergey N. Yatskevich (syatskevich@n21lab.gosniias.msk.ru)
Dave Cramer [Tue, 25 Mar 2003 02:01:19 +0000 (02:01 +0000)]
added DISTINCT to the query to get cross reference. This is required when two columns in a table are both foreign keys to another table. From Peter Royal proyal@pace2020.com
Tom Lane [Sun, 23 Mar 2003 21:55:14 +0000 (21:55 +0000)]
Band-aid patch for Shraibman's 'out of free buffers' bug: disable the
keys_are_unique optimization introduced in 7.3. A better fix will
appear in 7.4, but I think back-patching it is too risky for the stable
branch.
Barry Lind [Wed, 19 Mar 2003 04:09:09 +0000 (04:09 +0000)]
Backport patch to work around a server bug. Server incorrectly handles the
following: select 1; commit; set autocommit true;
If this is submitted in one call to the server (the select 1 doesn't start a
new transaction like it should), however if the select 1 is sent as a separate
call then it works correctly.
Tom Lane [Fri, 14 Mar 2003 04:44:05 +0000 (04:44 +0000)]
Repair incorrect prorettype entry for timestamptz_izone. Can't force
initdb in the 7.3 branch, but we can at least make it right for people
who install 7.3.3 from scratch.
Tom Lane [Thu, 13 Mar 2003 16:58:49 +0000 (16:58 +0000)]
GROUP BY got confused if there were multiple equal() GROUP BY items.
This bug has been latent since 7.0 or maybe even further back, but it
was only exposed when parse_clause.c stopped suppressing duplicate
items (see its rev 1.96 of 18-Aug-02).
Barry Lind [Sat, 8 Mar 2003 06:09:37 +0000 (06:09 +0000)]
Back ported patches from head to 7.3 branch (fixes for NPE in result set absolute() and NPE when logging enabled)
Modified Files:
Tag: REL7_3_STABLE
jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
jdbc/org/postgresql/util/PSQLException.java
Tom Lane [Thu, 6 Mar 2003 22:55:03 +0000 (22:55 +0000)]
Tweak dependency code to suppress NOTICEs generated by new method for
cleaning out temp namespaces. We don't really want the server log to be
cluttered with 'Drop cascades to table foo' every time someone uses a
temp table...
Tom Lane [Wed, 5 Mar 2003 18:38:26 +0000 (18:38 +0000)]
Repair bug reported by Laurent Perez: bad plan generated when UPDATE or
DELETE of an inheritance tree references another inherited relation.
This bug has been latent since 7.1; I'm still not quite sure why 7.1 and
7.2 don't manifest it (at least, they don't crash on a simple test case).
Tom Lane [Sun, 2 Mar 2003 20:45:59 +0000 (20:45 +0000)]
Repair memory leak introduced by recent change to make SPI return a
tupdesc even with zero tuples returned: some plpgsql routines assumed
they didn't need to do SPI_freetuptable() after retrieving no tuples.
Tom Lane [Thu, 27 Feb 2003 21:37:24 +0000 (21:37 +0000)]
Change EXTRACT(EPOCH FROM timestamp) so that a timestamp without time zone
is assumed to be in local time, not GMT. This improves consistency with
other operations, which all assume local timezone when it matters. Per
bug #897.
Tom Lane [Sun, 23 Feb 2003 04:48:38 +0000 (04:48 +0000)]
If a shutdown request comes in while we're still starting up, don't
service it until after we execute SetThisStartUpID(). Else shutdown
process will write the wrong SUI into the shutdown checkpoint, which
seems likely to be trouble --- although I've not quite figured out
how significant it really is.
Tom Lane [Fri, 21 Feb 2003 18:24:54 +0000 (18:24 +0000)]
Repair nasty oversight in bt_split: if the index is temporary, we weren't
updating the left-link from the split page's right sibling. This could
result in backwards index scans missing some entries.
Same bug exists in HEAD, will be patched later.
Tom Lane [Thu, 20 Feb 2003 05:25:25 +0000 (05:25 +0000)]
Fix timestamptz_in so that parsing of 'now'::timestamptz gives right
answer when SET TIMEZONE has been done since the start of the current
transaction. Per bug report from Robert Haas.
I plan some futher cleanup in HEAD, but this is a low-risk patch for
the immediate issue in 7.3.
Tatsuo Ishii [Wed, 19 Feb 2003 14:14:58 +0000 (14:14 +0000)]
Back patch for GUC client_encoding variable not being handled
correctly. However the patch for PostgresPollingStatusType() is not
included to avoid 7.3 libpq vs. pre-7.3 backend
compatibility problem. See following thread for more details.
Subject: [HACKERS] client_encoding directive is ignored in postgresql.conf
From: Tatsuo Ishii <t-ishii@sra.co.jp>
Date: Wed, 29 Jan 2003 22:24:04 +0900 (JST)
Tom Lane [Tue, 18 Feb 2003 02:53:46 +0000 (02:53 +0000)]
Async_NotifyHandler must save and restore ImmediateInterruptOK. Fixes
known problem with failure to respond to 'pg_ctl stop -m fast', and
probable problems if SIGINT or SIGTERM arrives while processing a
SIGUSR2 interrupt that arrived while waiting for a new client query.