Commit Graph

5156 Commits

Author SHA1 Message Date
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
Bruce Momjian e46afb588d Fix units in postgresql.conf. 2002-08-27 02:50:41 +00:00
Bruce Momjian 9ede612245 Add units to postgresql.conf file. 2002-08-26 22:23:07 +00:00
Tom Lane 5d6758fd24 Increase WIDTH_THRESHOLD from 256 to 1K. This addresses recent observation
that ANALYZE would not gather any stats for a CHAR(255) column.  I still
think a width threshold is appropriate for the reasons mentioned in the
code, but we can loosen it at least.
2002-08-26 18:45:57 +00:00
Tom Lane 5cabcfccce Modify array operations to include array's element type OID in the
array header, and to compute sizing and alignment of array elements
the same way normal tuple access operations do --- viz, using the
tupmacs.h macros att_addlength and att_align.  This makes the world
safe for arrays of cstrings or intervals, and should make it much
easier to write array-type-polymorphic functions; as examples see
the cleanups of array_out and contrib/array_iterator.  By Joe Conway
and Tom Lane.
2002-08-26 17:54:02 +00:00
Bruce Momjian 39e331be72 Add Bob Devine's name to the optimizer README. 2002-08-25 22:39:37 +00:00
Tom Lane 58de480999 Clean up comments to be careful about the distinction between variable-
width types and varlena types, since with the introduction of CSTRING as
a more-or-less-real type, these concepts aren't identical.  I've tried to
use varlena consistently to denote datatypes with typlen = -1, ie, they
have a length word and are potentially TOASTable; while the term variable
width covers both varlena and cstring (and, perhaps, someday other types
with other rules for computing the actual width).  No code changes in this
commit except for renaming a couple macros.
2002-08-25 17:20:01 +00:00
Tom Lane 976246cc7e The cstring datatype can now be copied, passed around, etc. The typlen
value '-2' is used to indicate a variable-width type whose width is
computed as strlen(datum)+1.  Everything that looks at typlen is updated
except for array support, which Joe Conway is working on; at the moment
it wouldn't work to try to create an array of cstring.
2002-08-24 15:00:47 +00:00
Tom Lane a2a3192802 Further cleanup around the edges of OPAQUE/pseudotype changes. Correct
the declarations of some index access method support functions.  Support
SQL functions returning VOID.
2002-08-23 16:41:38 +00:00
Tom Lane 0f1112923c Code review for recent TRUNCATE changes. Tighten relation-kind check,
tighten foreign-key check (a self-reference should not prevent TRUNCATE),
improve error message, cause a relation's TOAST table to be truncated
along with the relation.
2002-08-22 14:23:36 +00:00
Bruce Momjian b4f24fed7a Commit updated repeat() patch, from Neil Conway 2002-08-22 05:05:19 +00:00
Bruce Momjian d86dee3edd This patch should fix the problem. Doesn't include my previous patch
for repeat(). Again, somewhat off-the-cuff, so I might have missed
something...

test=# select lpad('xxxxx',1431655765,'yyyyyyyyyyyyyyyy');
ERROR:  Requested length too large
test=# select rpad('xxxxx',1431655765,'yyyyyyyyyyyyyyyy');
ERROR:  Requested length too large

(That's on a Unicode DB, haven't tested other encodings but AFAICT
this fix should still work.)

Neil Conway
2002-08-22 04:55:05 +00:00
Bruce Momjian cbe733d752 repeat() fix:
> Neil Conway <neilc@samurai.com> writes:
> > +   /* Check for integer overflow */
> > +   if (tlen / slen != count)
> > +           elog(ERROR, "Requested buffer is too large.");
>
> What about slen == 0?

Good point -- that wouldn't cause incorrect results or a security
problem, but it would reject input that we should really accept.

Revised patch is attached.

Neil Conway
2002-08-22 04:54:20 +00:00
Bruce Momjian 47b37a6bfa # Disallow TRUNCATE on tables that are involved in referential
constraints


The issue with finding and removing foreign key constraints is no longer
an issue, so please apply the attached.

It does NOT check for rules or on delete triggers (old style foreign
keys) as those are difficult to deal with (remove, truncate, re-add).

Rod Taylor
2002-08-22 04:51:06 +00:00
Bruce Momjian a334ae3f22 As suggested by Tom, this patch restricts the right-hand argument of
bytealike to TEXT.

This leaves like_escape_bytea() without anything to do, but I left it in
place in anticipation of the eventual bytea pattern selectivity
functions. If there is agreement that this would be the best long term
solution, I'll take it as a TODO for 7.4.

Joe Conway
2002-08-22 04:45:11 +00:00
Bruce Momjian 89260124db Add:
replace(string, from, to)
   -- replaces all occurrences of "from" in "string" to "to"
split(string, fldsep, column)
   -- splits "string" on "fldsep" and returns "column" number piece
to_hex(int32_num) & to_hex(int64_num)
   -- takes integer number and returns as hex string

Joe Conway
2002-08-22 03:24:01 +00:00
Bruce Momjian ff1793f036 Remove erroneous character from Makefile due to editor error. 2002-08-22 02:18:45 +00:00
Tom Lane b663f3443b Add a bunch of pseudo-types to replace the behavior formerly associated
with OPAQUE, as per recent pghackers discussion.  I still want to do some
more work on the 'cstring' pseudo-type, but I'm going to commit the bulk
of the changes now before the tree starts shifting under me ...
2002-08-22 00:01:51 +00:00
Bruce Momjian d46e3dc00f Changes made so new conversion Makefiles will build out of the source tree. 2002-08-21 21:33:55 +00:00
Peter Eisentraut 41c92ace2f Move PO files into subdirectories separate from the source code. 2002-08-21 20:42:27 +00:00
Tom Lane 0d6f613817 Increase buffer size in cash_words(). Pure paranoia; I don't think the
code is broken, but any small change in the output format might overrun
the buffer with the old size.
2002-08-20 16:46:29 +00:00
Bruce Momjian 5243f9a998 Allow pg_statistics to be reset by calling pg_stat_reset().
Christopher Kings-Lynne
2002-08-20 04:47:52 +00:00
Bruce Momjian de9801fc62 Add current_database().
> Quick system function to pull out the current database.
>
> I've used this a number of times to allow stored procedures to find out
> where they are.  Especially useful for those that do logging or hit a
> remote server.
>
> It's called current_database() to match with current_user().

It's also a necessity for an informational schema.  The catalog
(database) name is required in a number of places.

Rod Taylor
2002-08-20 04:46:00 +00:00
Tom Lane a0bf1a7f2e Fix pg_dump to dump serial columns as serials. Per pghackers discussion,
cause SERIAL column declaration not to imply UNIQUE, so that this can be
done without creating an extra index.
2002-08-19 19:33:36 +00:00
Tom Lane 6ebc90b045 Remove Ident nodetype in favor of using String nodes; this fixes some
latent wrong-struct-type bugs and makes the coding style more uniform,
since the majority of places working with lists of column names were
already using Strings not Idents.  While at it, remove vestigial
support for Stream node type, and otherwise-unreferenced nodes.h entries
for T_TupleCount and T_BaseNode.
NB: full recompile is recommended due to changes of Node type numbers.
This shouldn't force an initdb though.
2002-08-19 15:08:47 +00:00