Commit Graph

5180 Commits

Author SHA1 Message Date
Tom Lane c7a165adc6 Code review for HeapTupleHeader changes. Add version number to page headers
(overlaying low byte of page size) and add HEAP_HASOID bit to t_infomask,
per earlier discussion.  Simplify scheme for overlaying fields in tuple
header (no need for cmax to live in more than one place).  Don't try to
clear infomask status bits in tqual.c --- not safe to do it there.  Don't
try to force output table of a SELECT INTO to have OIDs, either.  Get rid
of unnecessarily complex three-state scheme for TupleDesc.tdhasoids, which
has already caused one recent failure.  Improve documentation.
2002-09-02 01:05:06 +00:00
Bruce Momjian 548d646e65 Add log_duration to GUC/postgresql.conf.
Rename debug_print_query to log_statement and rename show_query_stats to
show_statement_stats.
2002-09-01 23:26:06 +00:00
Tom Lane 681ed4e2fe Code cleanups: make non-implicit WITHOUT FUNCTION casts work, avoid
redundant pg_cast searches, fix obsolete comments.
2002-09-01 02:27:32 +00:00
Bruce Momjian d64e6392fb Remove code that suggested increasing wal_files. 2002-09-01 01:58:42 +00:00
Tom Lane 3c49c4b152 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.
2002-09-01 00:58:07 +00:00
Tom Lane 845a6c3acc 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.
2002-08-31 22:10:48 +00:00
Tom Lane 1440acd703 Wups, didn't mean to commit that just yet. 2002-08-31 19:10:08 +00:00
Tom Lane 0da6cf54ec The UNDEFOID later causes an assertion failure in heap_formtuple when
you try to use the tupdesc to build a tuple.

Joe Conway
2002-08-31 19:09:27 +00:00
Tom Lane 1bab464eb4 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.
2002-08-31 17:14:28 +00:00
Tom Lane 7bacf2befa 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.
2002-08-30 23:59:46 +00:00
Tom Lane 26993b2918 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.

Loosely based on a patch by David Van Wie.
2002-08-30 22:18:07 +00:00
Tom Lane 549928d99b Fix for breakage of C-coded SRFs, from Joe Conway. 2002-08-30 19:56:49 +00:00
Tom Lane e2d156fa6e 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.
2002-08-30 19:23:20 +00:00
Bruce Momjian 63653f7ffa Complete TODO item:
* Remove wal_files postgresql.conf option because WAL files are
	  now recycled
2002-08-30 16:50:50 +00:00
Bruce Momjian f7e089b3fa Back out password packet length check.
Improve wording of pre-7.3 syntax mention.
2002-08-30 16:00:41 +00:00
Tom Lane fac3dd56b3 Group-manipulating code neglected to fill in array element type,
which is now required.
2002-08-30 01:01:02 +00:00
Tom Lane e107f3a7e3 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.
2002-08-30 00:28:41 +00:00
Hiroshi Inoue 82ccb420d5 Fix a bug introduced in 7.2. 2002-08-29 23:39:05 +00:00
Bruce Momjian 9858a3a43f 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.

Neil Conway
2002-08-29 23:05:44 +00:00
Bruce Momjian f81ce4a0f6 Prevent problem with extra-long password packets from allocating lots of
memory.

Neil Conway
2002-08-29 21:50:36 +00:00
Bruce Momjian 626eca697c 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.

Nigel J. Andrews
2002-08-29 21:02:12 +00:00
Tom Lane e4186762ff 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.
2002-08-29 17:14:33 +00:00
Tom Lane 0201dac1c3 Push down outer qualification clauses into UNION and INTERSECT subqueries.
Per pghackers discussion from back around 1-August.
2002-08-29 16:03:49 +00:00
Tom Lane d2236800ee 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.
2002-08-29 15:56:20 +00:00
Tatsuo Ishii ed7baeaf4d Remove #ifdef MULTIBYTE per hackers list discussion. 2002-08-29 07:22:30 +00:00
Tom Lane 8e80dbb849 Rephrase 'Cannot insert into a view' and related messages, per
pghackers discussion around 31-Jul-02.
2002-08-29 06:05:27 +00:00
Tom Lane dc4e983ff6 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.
2002-08-29 04:38:04 +00:00
Tom Lane 5241a6259f Remove support for version-0 FE/BE protocol, per pghackers discussion.
This breaks support for 6.2 or older client libraries.
2002-08-29 03:22:01 +00:00
Tom Lane 8a24a55c81 Fix ruleutils to dump column definition lists for anonymous record types
defined in the FROM clause.  From Joe Conway, with some tweaks.
2002-08-29 01:19:41 +00:00
Tom Lane 64505ed58b Code review for standalone composite types, query-specified composite
types, SRFs.  Not happy with memory management yet, but I'll commit these
other changes.
2002-08-29 00:17:06 +00:00
Peter Eisentraut 12f80d7c69 Initial Spanish translation from Karim Mribti <karim@inlosa.com> 2002-08-28 21:01:14 +00:00
Bruce Momjian 03d39ce080 Remove TIOGA files from CVS current; they remain in repositiry. 2002-08-28 20:55:23 +00:00
Bruce Momjian fbb1966cf3 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.

Neil Conway
2002-08-28 20:46:47 +00:00
Bruce Momjian 81dfa2ce43 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.

Neil Conway
2002-08-28 20:46:24 +00:00
Bruce Momjian b60acaf568 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.

John Gray
2002-08-28 20:18:29 +00:00
Bruce Momjian 6077db92c2 Allow FOR UPDATE to appear after LIMIT/OFFSET to match MySQL syntax and as
a more logical ordering.
2002-08-28 14:35:37 +00:00
Tom Lane 65a34e93c6 Bring comments back in sync with code. 2002-08-27 20:54:47 +00:00
Bruce Momjian 73b94657b0 Throw error on pg_atoi(''), regression adjustments. 2002-08-27 20:29:11 +00:00
Bruce Momjian a1c218cae4 The attached patch implements the password packet length sanity check
(using an elog(LOG) ), as well as includes a few more comment fixes.

Neil Conway
2002-08-27 16:21:51 +00:00
Bruce Momjian fd3c4b2eaf Add most of Neil Conway's cleanups. 2002-08-27 15:15:23 +00:00
Bruce Momjian 0582ad91ac Add fsm sizes. 2002-08-27 14:06:05 +00:00
Tom Lane 28e82066a1 PREPARE/EXECUTE statements. Patch by Neil Conway, some kibitzing
from Tom Lane.
2002-08-27 04:55:12 +00:00
Bruce Momjian a77d34f0b8 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.

Neil Conway
2002-08-27 04:00:28 +00:00
Bruce Momjian dd912c6977 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...

Neil Conway
2002-08-27 03:56:35 +00:00
Bruce Momjian c0ad595386 I attach a little patch to make CLUSTER set and reset the indisclustered
bit on the indexes.

I also attach clusterdb and clusterdb.sgml; both of them are blatant
rips of vacuumdb and vacuumdb.sgml, but get the job done.  Please review
them, as I'm probably making a lot of mistakes with SGML and I can't
compile it here.

vacuumdb itself is not very comfortable to use when the databases have
passwords, because it has to connect once for each table (I can probably
make it connect only once for each database; should I?).  Because of
this I added a mention of PGPASSWORDFILE in the documentation, but I
don't know if that is the correct place for that.

Alvaro Herrera
2002-08-27 03:38:28 +00:00
Bruce Momjian b7e272429c Add to skip list in check_guc 2002-08-27 03:06:16 +00:00
Bruce Momjian fd9d665908 Comment cleanup. 2002-08-27 03:02:31 +00:00
Bruce Momjian fc67e1fb94 Script cleanups. 2002-08-27 03:01:13 +00:00
Bruce Momjian f20ec2e8f8 Clean up script. 2002-08-27 02:54:39 +00:00
Bruce Momjian 1051346fb7 Add check_guc utility to compare guc.c and postgresql.conf.sample. 2002-08-27 02:52:42 +00:00