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.
Tom Lane [Thu, 13 Feb 2003 21:40:00 +0000 (21:40 +0000)]
Repair rule permissions-checking bug reported by Tim Burgess 10-Feb-02:
the table(s) modified by the original query would get checked for the
type of write permission needed by a rule query.
Bruce Momjian [Thu, 13 Feb 2003 05:32:58 +0000 (05:32 +0000)]
> > They work the same as table constraints with in-line declaration (no
> > comma).
>
> OK. But the documentation implies there is a comma, so it should probably
> get chenged then.
Tom Lane [Tue, 11 Feb 2003 04:13:39 +0000 (04:13 +0000)]
Use a varno not chosen at random for dummy variables in the top-level
targetlist of a set-operation tree. I'm not sure that this solution
will really stand the test of time --- perhaps we need to make a special
RTE for such vars to refer to. But this quick hack fixes Brandon Craig
Rhodes' complaint of 10-Feb-02 about EXCEPT in CREATE RULE, while not
changing any behavior in the better-tested cases where leftmostRTI is
one anyway.
Barry Lind [Sun, 9 Feb 2003 23:41:46 +0000 (23:41 +0000)]
Merge changes from head to 7.3 branch: better error message on character set conversion problems and patch from Kris Jurka for numeric scale
Modified Files:
Tag: REL7_3_STABLE
jdbc/org/postgresql/errors.properties
jdbc/org/postgresql/core/Encoding.java
jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
Tom Lane [Fri, 7 Feb 2003 01:33:39 +0000 (01:33 +0000)]
Revise mechanism for getting rid of temp tables at backend shutdown.
Instead of grovelling through pg_class to find them, make use of the
handy dandy dependency mechanism: just delete everything that depends
on our temp schema. Unlike the pg_class scan, the dependency mechanism
is smart enough to delete things in an order that doesn't fall foul of
any dependency restrictions. Fixes problem reported by David Heggie:
a temp table with a serial column may cause a backend FATAL exit at
shutdown time, if it chances to try to delete the temp sequence first.
Tom Lane [Wed, 5 Feb 2003 20:16:55 +0000 (20:16 +0000)]
Allow qualified type names in CREATE CAST, DROP CAST. Also allow the
construction 'SETOF type[]' which for some reason was previously
overlooked (you'd have to name the array type directly to make it work).
Tom Lane [Sun, 2 Feb 2003 19:09:08 +0000 (19:09 +0000)]
Fix nodeUnique to behave correctly when reversing direction after reaching
either end of subplan results. This prevents misbehavior of cursors
on SELECT DISTINCT ... queries. Per bug report 1-Feb-02.
Tom Lane [Sat, 1 Feb 2003 22:09:41 +0000 (22:09 +0000)]
Remove restriction that cast functions cannot be volatile. This
restriction was debatable to begin with, but it has now become obvious
that it breaks forward-porting of user-defined types; contrib/lo being
the most salient example.
Tom Lane [Sat, 1 Feb 2003 22:07:14 +0000 (22:07 +0000)]
Cleaner solution to the problem of loading pre-7.3 dumps containing
columns of type lo (see contrib/lo). Rather than hacking the function
definitions on-the-fly, just modify the queries issued by FixupBlobRefs
so that they work even if CREATE CAST hasn't been issued.
Tom Lane [Sat, 1 Feb 2003 00:07:19 +0000 (00:07 +0000)]
Apply ljb's patch to prevent both memory leak and core dump during
connection shutdown. This is a grotty workaround for a Tcl bug, but
said bug has been there long enough that I'm not holding my breath
for a real fix. Per discussions and testing from ljb and g.hintermayer.
Tom Lane [Fri, 31 Jan 2003 22:25:18 +0000 (22:25 +0000)]
Clean up plpython error reporting so that its regression test passes
with some amount of cleanliness. I see no need to report the internal
Python name rather than the SQL procedure name in error tracebacks.
Tom Lane [Fri, 31 Jan 2003 20:58:28 +0000 (20:58 +0000)]
Tweak bison build rules so that we get the same error messages from
bison 1.875 and later as we did from earlier bison releases. Eventually
we will probably want to adopt the newer message spelling ... but not yet.
Per recent discussion on pgpatches.
Note: I didn't change the build rules for bootstrap, ecpg, or plpgsql
grammars, since these do not affect regression test results.
Tom Lane [Wed, 29 Jan 2003 15:24:57 +0000 (15:24 +0000)]
SPI_exec shouldn't return SPI_OK_SELECT if it hasn't actually returned
a tuple table. Fixes core dump in pltcl (and probably other PLs) when
executing a query rewritten by a rule. Per bug report from Wolfgang Walter.
Tom Lane [Wed, 29 Jan 2003 01:09:03 +0000 (01:09 +0000)]
Repair array subscript overrun identified by Yichen Xie. Reduce the
value of MAX_TIME_PRECISION in floating-point-timestamp-storage case
from 13 to 10, which is as much as time_out is actually willing to print.
(The alternative of increasing the number of digits we are willing to
print looks risky; we might find ourselves printing roundoff garbage.)
Tom Lane [Tue, 28 Jan 2003 18:04:13 +0000 (18:04 +0000)]
Convert variable name to canonical spelling before checking for matches
in GUCArrayAdd/GUCArrayDelete. This prevents the multiple-entry bug
exhibited by Frank Lupo 28-Jan-2003.
Tom Lane [Thu, 23 Jan 2003 05:10:57 +0000 (05:10 +0000)]
Change CREATE TABLE AS / SELECT INTO to create the new table with OIDs,
for backwards compatibility with pre-7.3 behavior. Per discussion on
pgsql-general and pgsql-hackers.
Tom Lane [Thu, 23 Jan 2003 01:23:14 +0000 (01:23 +0000)]
Update 'Mathematical Functions' table to reflect 7.3 addition of float8
forms of ceil(), floor(), sign(). Back-patch this and other recent
doc fixes in this file to the 7.3 branch.
Tom Lane [Tue, 21 Jan 2003 22:06:36 +0000 (22:06 +0000)]
Fix coredump problem in plpgsql's RETURN NEXT. When a SELECT INTO
that's selecting into a RECORD variable returns zero rows, make it
assign an all-nulls row to the RECORD; this is consistent with what
happens when the SELECT INTO target is not a RECORD. In support of
this, tweak the SPI code so that a valid tuple descriptor is returned
even when a SPI select returns no rows.
Tom Lane [Thu, 16 Jan 2003 00:27:17 +0000 (00:27 +0000)]
Repair an embarrassingly large number of alphabetization mistakes in the
datetime token tables. Even more embarrassing, the regression tests
revealed some of the problems --- but evidently the bogus output wasn't
questioned. Add code to postmaster startup to directly check the tables
for correct ordering, in hopes of not being embarrassed like this again.
Barry Lind [Tue, 14 Jan 2003 05:07:56 +0000 (05:07 +0000)]
Patch from Kris Jurka to improve the performance of getImportedKeys(). The
fix uses explicit joins to avoid using the genetic query optimizer for
consistent results.
Bruce Momjian [Sat, 11 Jan 2003 05:04:27 +0000 (05:04 +0000)]
> > This patch improves the documentation for the shared_buffers GUC param.
>
> I'd suggest that the runtime.sgml description explicitly say "values of
> at least a few thousand are recommended for production installations".
Tom Lane [Thu, 9 Jan 2003 01:07:18 +0000 (01:07 +0000)]
Repair inconsistent rounding behavior for timestamp, time, interval,
per gripe from Csaba Nagy. There is still potential for platform-specific
behavior for values that are exactly halfway between integers, but at
least we now get the expected answer for all other cases.
Bruce Momjian [Wed, 8 Jan 2003 23:18:35 +0000 (23:18 +0000)]
The second was that renegotiation was just plain broken. I can't
believe I didn't notice this before -- once 64k was sent to/from the
server the client would crash. Basicly, in 7.3 the server SSL code set
the initial state to "about to renegotiate" without actually starting
the renegotiation. In addition, the server and client didn't properly
handle the SSL_ERROR_WANT_(READ|WRITE) error. This is fixed in the
second patch.
Bruce Momjian [Wed, 8 Jan 2003 22:57:05 +0000 (22:57 +0000)]
I was playing around with 7.3.1 and found some more SSL problems. The
first, that I missed when checking over 7.3.1, was that the client
method was switched to SSLv23 along with the server. The SSLv23 client
method does SSLv2 by default, but can also understand SSLv3. In our
situation the SSLv2 backwords compatibility is really only needed on the
server. This is the first patch.
The last thing is that I found a way for the server to understand SSLv2
HELLO messages (sent by pre-7.3 clients) but then get them to talk
SSLv3. This is the last one.