Tom Lane [Sun, 1 Sep 2002 00:58:07 +0000 (00:58 +0000)]
Mark the float8 -> int8 cast as implicit. This resolves the problem
pointed out by Barry Lind: UPDATE bigintcol = 10000000000 fails because
the constant is initially taken as float8. We really need a better way,
but it's not gonna happen for 7.3.
Also, remove int4reltime() function, which is redundant with the
existing binary-compatibility coercion path from int4 to reltime,
and probably has been unreachable code for a long while.
Tom Lane [Sat, 31 Aug 2002 22:10:48 +0000 (22:10 +0000)]
Code review for domain-constraints patch. Use a new ConstraintTest node
type for runtime constraint checks, instead of misusing the parse-time
Constraint node for the purpose. Fix some damage introduced into type
coercion logic; in particular ensure that a coerced expression tree will
read out the correct result type when inspected (patch had broken some
RelabelType cases). Enforce domain NOT NULL constraints against columns
that are omitted from an INSERT.
Tom Lane [Sat, 31 Aug 2002 17:14:28 +0000 (17:14 +0000)]
Code review for pg_locks feature. Make shmemoffset of PROCLOCK structs
available (else there's no way to interpret the list links). Change
pg_locks view to show transaction ID locks separately from ordinary
relation locks. Avoid showing N duplicate rows when the same lock is
held multiple times (seems unlikely that users care about exact hold
count). Improve documentation.
Tom Lane [Fri, 30 Aug 2002 23:59:46 +0000 (23:59 +0000)]
Add expected tuple descriptor to ReturnSetInfo information for table
functions, per suggestion from John Gray and Joe Conway. Also, fix
plpgsql RETURN NEXT to verify that returned values match the expected
tupdesc.
Tom Lane [Fri, 30 Aug 2002 22:18:07 +0000 (22:18 +0000)]
AUTOCOMMIT mode is now an available backend GUC variable; setting it
to false provides more SQL-spec-compliant behavior than we had before.
I am not sure that setting it false is actually a good idea yet; there
is a lot of client-side code that will probably be broken by turning
autocommit off. But it's a start.
Tom Lane [Fri, 30 Aug 2002 19:23:20 +0000 (19:23 +0000)]
Add attisinherited column to pg_attribute; use it to guard against
column additions, deletions, and renames that would let a child table
get out of sync with its parent. Patch by Alvaro Herrera, with some
kibitzing by Tom Lane.
Tom Lane [Fri, 30 Aug 2002 02:01:34 +0000 (02:01 +0000)]
Revert _LARGEFILE64_SOURCE addition; good try but doesn't work,
at least not on HPUX 10.20, and there's no reason to think it
is needed on later versions.
Tom Lane [Fri, 30 Aug 2002 00:28:41 +0000 (00:28 +0000)]
PL/pgSQL functions can return sets. Neil Conway's patch, modified so
that the functionality is available to anyone via ReturnSetInfo, rather
than hard-wiring it to PL/pgSQL.
Bruce Momjian [Thu, 29 Aug 2002 23:06:32 +0000 (23:06 +0000)]
> > > > If you want to put in security restrictions that are actually useful,
> > > > where is the code to verify that PGPASSWORDFILE points at a
> > > > non-world-readable file? That needs to be there now, not later, or
> > > > we'll have people moaning about backward compatibility when we finally
> > > > do plug that hole.
Bruce Momjian [Thu, 29 Aug 2002 23:05:44 +0000 (23:05 +0000)]
Sir Mordred The Traitor <mordred@s-mail.com> writes:
> Upon invoking a polygon(integer, circle) function a
> src/backend/utils/adt/geo_ops.c:circle_poly() function will gets
> called, which suffers from a buffer overflow.
>
> 2) A src/backend/adt/utils/geo_ops.c:path_encode() fails to detect a
> buffer overrun condition. It is called in multiple places, the most
> interesting are path_out() and poly_out() functions.
> 5) A src/backend/utils/adt/geo_ops.c:path_add() also fails to detect
> a simple buffer overrun.
I've attached a patch which should fix these problems.
Bruce Momjian [Thu, 29 Aug 2002 23:03:58 +0000 (23:03 +0000)]
The changes I have made are described in CHANGES. This was based on
diffs to 7.3-devel and may not be applicable to 7.2. I have included a
change covered by a previous bugfix patch I submitted (the problem with
-.1 not being accepted by cube_in). It does not include a fix for the
potential buffer overrun issue I reported for cube_yyerror in
cubeparse.y.
Bruce Momjian [Thu, 29 Aug 2002 21:02:12 +0000 (21:02 +0000)]
This patch reserves the last superuser_reserved_connections slots for
connections by the superuser only.
This patch replaces the last patch I sent a couple of days ago.
It closes a connection that has not been authorised by a superuser if it would
leave less than the GUC variable ReservedBackends
(superuser_reserved_connections in postgres.conf) backend process slots free
in the SISeg. This differs to the first patch which only reserved the last
ReservedBackends slots in the procState array. This has made the free slot
test more expensive due to the use of a lock.
After thinking about a comment on the first patch I've also made it a fatal
error if the number of reserved slots is not less than the maximum number of
connections.
Tom Lane [Thu, 29 Aug 2002 17:14:33 +0000 (17:14 +0000)]
Adjust nodeFunctionscan.c to reset transient memory context between calls
to the table function, thus preventing memory leakage accumulation across
calls. This means that SRFs need to be careful to distinguish permanent
and local storage; adjust code and documentation accordingly. Patch by
Joe Conway, very minor tweaks by Tom Lane.
Tom Lane [Thu, 29 Aug 2002 15:56:20 +0000 (15:56 +0000)]
Cause REINDEX to regard TOAST tables as regular relations, not system
tables that need special defenses. I believe this is okay even for
TOAST tables that belong to system tables.
chkpass_rout returns text so change PG_RETURN_CSTRING to PG_RETURN_TEXT_P.
This is currently a cosmetic difference but I make the change now in case
the macros diverge one day.
Tom Lane [Thu, 29 Aug 2002 04:38:04 +0000 (04:38 +0000)]
Produce a somewhat-useful error message, namely
ERROR: Cannot display a value of type RECORD
rather than a random integer when someone tries to SELECT a tuple
value. Per pghackers discussion around 26-May-02.
Tom Lane [Thu, 29 Aug 2002 04:12:03 +0000 (04:12 +0000)]
FOUND patch was a bit over-enthusiastic: SQL commands that are not
INSERT, UPDATE, or DELETE shouldn't change FOUND. IMHO anyway.
Also, try to make documentation a little clearer.
Tom Lane [Thu, 29 Aug 2002 00:17:06 +0000 (00:17 +0000)]
Code review for standalone composite types, query-specified composite
types, SRFs. Not happy with memory management yet, but I'll commit these
other changes.
Bruce Momjian [Wed, 28 Aug 2002 20:46:47 +0000 (20:46 +0000)]
This trivial patches fixes the error message returned by CREATE INDEX
when it finds an existing relation with the same name as the
to-be-created index.
Old error message:
nconway=# create table foo (a int);
CREATE TABLE
nconway=# create index foo on foo (a);
ERROR: index named "foo" already exists
I replaced 'index' with 'relation' in the error message.
Bruce Momjian [Wed, 28 Aug 2002 20:46:24 +0000 (20:46 +0000)]
backend where a statically sized buffer is written to. Most of these
should be pretty safe in practice, but it's probably better to be safe
than sorry.
I was actually looking for cases where NAMEDATALEN is assumed to be
32, but only found one. That's fixed too, as well as a few bits of
code cleanup.
Bruce Momjian [Wed, 28 Aug 2002 20:18:58 +0000 (20:18 +0000)]
This is a quick patch to fix a crash in pgquery_dictresult() introduced
recently. I just ran into it while running a set of python test scripts,
and I'm not sure who the normal maintainer is for interfaces/python.
Bruce Momjian [Wed, 28 Aug 2002 20:18:29 +0000 (20:18 +0000)]
The following small patch provides a couple of minor updates (against
CVS HEAD):
Amended "strings" regression test. TOAST tests now insert two values
with storage set to "external", to exercise properly the TOAST slice
routines which fetch only a subset of the chunks.
Changed now-misleading comment on AlterTableCreateToastTable in
tablecmds.c, because both columns of the index on a toast table are now
used.
Peter Eisentraut [Tue, 27 Aug 2002 20:16:49 +0000 (20:16 +0000)]
Enable locale, so case conversion (identifier processing) and number
formatting (\timing) works correctly. Change "Total time" to "Time"
since there is nothing that "total" refers to. Remove non-multibyte
code.
Bruce Momjian [Tue, 27 Aug 2002 04:00:28 +0000 (04:00 +0000)]
This patch updates the lock listing code to use Joe Conway's new
anonymous return type SRF code. It gets rid of the superflous
'pg_locks_result' that Bruce/Tom had commented on. Otherwise, no
changes in functionality.
Bruce Momjian [Tue, 27 Aug 2002 03:57:11 +0000 (03:57 +0000)]
This is a 2 line patch to src/interfaces/perl5/GNUMakefile that fixes
the 'override CPPFLAGS' to include the source directory during compile,
and makes the install target look in the proper place for the man page.
Changes are only required when building outside the source directory.
Bruce Momjian [Tue, 27 Aug 2002 03:56:35 +0000 (03:56 +0000)]
This patches replaces a few more usages of strcpy() and sprintf() when
copying into a fixed-size buffer (in this case, a buffer of
NAMEDATALEN bytes). AFAICT nothing to worry about here, but worth
fixing anyway...