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...
Bruce Momjian [Tue, 27 Aug 2002 03:38:28 +0000 (03:38 +0000)]
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.
Tom Lane [Mon, 26 Aug 2002 18:45:57 +0000 (18:45 +0000)]
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.
Tom Lane [Mon, 26 Aug 2002 17:54:02 +0000 (17:54 +0000)]
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.
Tom Lane [Sun, 25 Aug 2002 17:20:01 +0000 (17:20 +0000)]
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.
Tom Lane [Sat, 24 Aug 2002 15:00:47 +0000 (15:00 +0000)]
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.
Barry Lind [Fri, 23 Aug 2002 20:45:49 +0000 (20:45 +0000)]
Enhancements to how queries with bind values are stored internally and sent to
the server. Previously we allocated a new String object for the entire final
query we were sending to the database. If you had a big query, or especially
if you had large bind values you ended up with essentially two copies in memory.
This change will reuse the existing objects and therefore should take 1/2 the
memory it does today for a given query. This restructuring will also allow
in the future the ability to stream bytea data to the server instead of the current approach of pulling it all into memory.
I also fixed a test that was failing on a 7.2 database.
Also renamed some internal variables and some minor cleanup.
Tom Lane [Fri, 23 Aug 2002 16:41:38 +0000 (16:41 +0000)]
Further cleanup around the edges of OPAQUE/pseudotype changes. Correct
the declarations of some index access method support functions. Support
SQL functions returning VOID.
Bruce Momjian [Fri, 23 Aug 2002 02:54:18 +0000 (02:54 +0000)]
This patch updates the CREATE OPERATOR sgml docs for the new default
settings of NAMEDATALEN. I looked through the docs for other
references to NAMEDATALEN, but this is the only one I could find.
Tom Lane [Thu, 22 Aug 2002 14:23:36 +0000 (14:23 +0000)]
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.