Commit Graph

4743 Commits

Author SHA1 Message Date
Tom Lane 789ddcb5fe Add tgconstrrelid to stored Trigger structures, make RI trigger functions
depend on this rather than the trigger argument strings to locate the
other relation to test.  This makes RI triggers function properly in
the presence of schemas and temp tables.  Along the way, fix bogus lack
of locking in RI triggers, handle quoting of names fully correctly,
compute required sizes of query buffers with some semblance of accuracy.
2002-04-01 22:36:13 +00:00
Bruce Momjian 6a25cd6b26 Attached is a patch which adds 2 missing semi-colons to
bootstrap/bootparse.y, so that recent versions of bison don't emit a
warning.

Neil Conway
2002-04-01 14:22:41 +00:00
Tom Lane 9b77f61930 ALTER TABLE SET/DROP NOT NULL, from Christopher Kings-Lynne. 2002-04-01 04:35:40 +00:00
Tom Lane 838fe25a95 Create a new GUC variable search_path to control the namespace search
path.  The default behavior if no per-user schemas are created is that
all users share a 'public' namespace, thus providing behavior backwards
compatible with 7.2 and earlier releases.  Probably the semantics and
default setting will need to be fine-tuned, but this is a start.
2002-04-01 03:34:27 +00:00
Tom Lane 87b0808020 Temporary kluge to let RI triggers work on tables outside the system
catalog namespace.  This will not do as a production solution because
the interpretation of RI trigger arguments will vary depending on the
current namespace search path.  I'm just putting it in so that the RI
regression tests don't fail while schema development proceeds.  We
must find a better answer before 7.3 can be released.
2002-04-01 02:02:34 +00:00
Tom Lane d51675169f Make renamerel take an OID, not a RangeVar, to identify the relation
to rename.  Avoids some corner-case bugs in cluster.c, improves
consistency with renameatt.
2002-03-31 07:49:30 +00:00
Tom Lane 3114102521 Reimplement temp tables using schemas. The temp table map is history;
temp table entries in pg_class have the names the user would expect.
2002-03-31 06:26:32 +00:00
Tom Lane 5f4745adf4 Further cleanups for relations in schemas: teach nextval and other
sequence functions how to cope with qualified names.  Same code is
also used for int4notin, currtid_byrelname, pgstattuple.  Also,
move TOAST tables into special pg_toast namespace.
2002-03-30 01:02:42 +00:00
Tom Lane d67442ccfd Mop-up some infelicities in new relation lookup handling. 2002-03-29 22:10:34 +00:00
Tom Lane d5e99ab4d6 pg_type has a typnamespace column; system now supports creating types
in different namespaces.  Also, cleanup work on relation namespace
support: drop, alter, rename commands work for tables in non-default
namespaces.
2002-03-29 19:06:29 +00:00
Tom Lane 1dbf8aa7a8 pg_class has a relnamespace column. You can create and access tables
in schemas other than the system namespace; however, there's no search
path yet, and not all operations work yet on tables outside the system
namespace.
2002-03-26 19:17:02 +00:00
Tom Lane ea10ec1b69 Tweak labeling of plan qual conditions for more consistency. 2002-03-24 17:11:37 +00:00
Tom Lane 10d3995057 EXPLAIN output now comes out as a query result, not a NOTICE message.
Also, fix debug logging of parse/plan trees so that the messages actually
go through elog(), not directly to stdout.
2002-03-24 04:31:09 +00:00
Tom Lane a25b94c080 Create the pg_namespace system catalog. Doesn't do much yet, but it's
there and CREATE SCHEMA will make entries in it...
2002-03-22 21:34:44 +00:00
Tom Lane 48c9164901 Improve catalog commentary. 2002-03-22 20:14:42 +00:00
Tom Lane 108a0ec87d A little further progress on schemas: push down RangeVars into
addRangeTableEntry calls.  Remove relname field from RTEs, since
it will no longer be a useful unique identifier of relations;
we want to encourage people to rely on the relation OID instead.
Further work on dumping qual expressions in EXPLAIN, too.
2002-03-22 02:56:37 +00:00
Tom Lane 56c9b73c1d Change the aclchk.c routines to uniformly use OIDs to identify the
objects to be privilege-checked.  Some change in their APIs would be
necessary no matter what in the schema environment, and simply getting
rid of the name-based interface entirely seems like the best way.
2002-03-21 23:27:25 +00:00
Tom Lane 95ef6a3448 First phase of SCHEMA changes, concentrating on fixing the grammar and
the parsetree representation.  As yet we don't *do* anything with schema
names, just drop 'em on the floor; but you can enter schema-compatible
command syntax, and there's even a primitive CREATE SCHEMA command.
No doc updates yet, except to note that you can now extract a field
from a function-returning-row's result with (foo(...)).fieldname.
2002-03-21 16:02:16 +00:00
Tom Lane a13ddd36b0 Remove long-dead 'fix for SELECT NULL' to stop current coredump. 2002-03-21 06:21:04 +00:00
Tom Lane 337b22cb47 Code review for DOMAIN patch. 2002-03-20 19:45:13 +00:00
Tom Lane 251282d4b7 Tweak behavior of array slicing operations: seems like it ought to be
okay to omit low-order dimensions when accessing an array slice.
2002-03-20 19:41:47 +00:00
Bruce Momjian f2842a969d Make CREATE DOMAIN emit CREATE DOMAIN on completion, per Peter E. 2002-03-19 16:10:48 +00:00
Bruce Momjian b9c7b0a2ba Fix DOMAIN breakage. 2002-03-19 12:52:22 +00:00
Bruce Momjian a9819ca253 The attached patch cleans up the implementation of the TRUNCATE command;
in the current code, the authentication logic (check user, check the
relation we're operating on, etc) is done in tcop/utility.c, whereas the
actual TRUNCATE command in done in TruncateRelation() in
commands/createinh.c (which is really just a wrapper over
heap_truncate() in catalog/heap.c). This patch moves the authentication
logic into TruncateRelation(), as well as making some minor code
cleanups.

Neil Conway
2002-03-19 02:58:20 +00:00
Bruce Momjian d8e70cd829 Fix for trigger handling:
* We should not even consider checking the row if it is no longer
         * valid since it was either deleted (doesn't matter) or updated
         * (in which case it'll be checked with its final values).

Stephan Szabo
2002-03-19 02:57:15 +00:00
Bruce Momjian d3788c3305 Add DOMAIN support. Includes manual pages and regression tests, from
Rod Taylor.
2002-03-19 02:18:25 +00:00
Bruce Momjian 1f0e5f6792 Comment patch:
This one better describes the problem.

heap.c needs to be updated to include 'Hard coded badness' for that
table.
--
Rod Taylor
2002-03-19 01:14:41 +00:00
Tom Lane 0f2fbbbac1 Try to make array_in's behavior a tad less bizarre. Leading whitespace
before a data item is now always skipped, rather than only sometimes.
Backslashes not within double-quoted text are treated reasonably, as
are multiple sequences of quoted text in a single data item.  But it
still seems rather prone to misbehavior if the input is not completely
syntactically correct --- in particular, garbage following a right brace
will be ignored.
2002-03-16 22:47:13 +00:00
Tom Lane 01747692fe Repair two problems with WAL logging of sequence nextvalI() ops, as
per recent pghackers discussion: force a new WAL record at first nextval
after a checkpoint, and ensure that xlog is flushed to disk if a nextval
record is the only thing emitted by a transaction.
2002-03-15 19:20:36 +00:00
Bruce Momjian 31effd10fe The attached patch changes ALTER TABLE OWNER to also change the
ownership of any toast tables that belong to the table that is being
operated upon (as suggested by Tom Lane).

Neil Conway
2002-03-14 22:44:50 +00:00
Peter Eisentraut f362dcec61 Move
src/GNUmakefile.in to src/Makefile
and
  src/backend/port/Makefile.in to src/backend/port/Makefile

All configure substitutions are now done in Makefile.global.
2002-03-13 00:05:06 +00:00
Tom Lane 6eeb95f0f5 Restructure representation of join alias variables. An explicit JOIN
now has an RTE of its own, and references to its outputs now are Vars
referencing the JOIN RTE, rather than CASE-expressions.  This allows
reverse-listing in ruleutils.c to use the correct alias easily, rather
than painfully reverse-engineering the alias namespace as it used to do.
Also, nested FULL JOINs work correctly, because the result of the inner
joins are simple Vars that the planner can cope with.  This fixes a bug
reported a couple times now, notably by Tatsuo on 18-Nov-01.  The alias
Vars are expanded into COALESCE expressions where needed at the very end
of planning, rather than during parsing.
Also, beginnings of support for showing plan qualifier expressions in
EXPLAIN.  There are probably still cases that need work.
initdb forced due to change of stored-rule representation.
2002-03-12 00:52:10 +00:00
Bruce Momjian a35b6b6418 Add DEFAULT_INDEX_TYPE == "btree", for clarity. 2002-03-10 06:02:24 +00:00
Bruce Momjian ee27436f6c Disable brackets in multi-statement rules, as discussed. 2002-03-10 06:00:15 +00:00
Thomas G. Lockhart f20509551d Guard against NULL strings in SET key=val constructs.
Problem noted by Fernando Nasser.
2002-03-09 17:37:16 +00:00
Tom Lane c422b5ca6b Code review for improved-hashing patch. Fix some portability issues
(char != unsigned char, Datum != uint32); make use of new hash code in
dynahash hash tables and hash joins.
2002-03-09 17:35:37 +00:00
Bruce Momjian fdcb8516d4 Wording improvements to runtime.sgml. Add mention in postgresql.conf
file that SIGHUP or "pg_ctl reload" are required for changes to take
affect on a running server.
2002-03-09 05:11:38 +00:00
Bruce Momjian db1d7a9ada Improve wording of pg_hba.conf file. 2002-03-08 20:36:58 +00:00
Tom Lane 21f8aa396f analyze.o need not depend on parser.h. 2002-03-08 07:12:11 +00:00
Tom Lane 01fe40f5c5 Remove unnecessary inclusion. 2002-03-08 06:55:08 +00:00
Tom Lane cf68a686a6 Fix copying/equality-check bugs in GrantStmt and ConstraintsSetStmt,
per reports from Fernando Nasser.  Also, rearrange order of declarations
in parsenodes.h as suggested by Fernando.
2002-03-08 04:37:18 +00:00
Bruce Momjian ee81126d1f TODO item done:
* Change FIXED_CHAR_SEL to 0.20 from 0.04 to give better selectivity (Bruce)
2002-03-08 04:29:01 +00:00
Tom Lane 98b3ae7378 Add missing colon to getopt() arg. 2002-03-08 00:42:09 +00:00
Bruce Momjian b976b8af80 Back out domain patch until it works properly. 2002-03-07 16:35:41 +00:00
Bruce Momjian 9178b7fcea Fix syntax error introduced by patch. 2002-03-06 21:49:52 +00:00
Bruce Momjian 7ab7467318 I've attached a patch which implements Bob Jenkin's hash function for
PostgreSQL. This hash function replaces the one used by hash indexes and
the catalog cache. Hash joins use a different, relatively poor-quality
hash function, but I'll fix that later.

As suggested by Tom Lane, this patch also changes the size of the fixed
hash table used by the catalog cache to be a power-of-2 (instead of a
prime: I chose 256 instead of 257). This allows the catcache to lookup
hash buckets using a simple bitmask. This should improve the performance
of the catalog cache slightly, since the previous method (modulo a
prime) was slow.

In my tests, this improves the performance of hash indexes by between 4%
and 8%; the performance when using btree indexes or seqscans is
basically unchanged.

Neil Conway <neilconway@rogers.com>
2002-03-06 20:49:46 +00:00
Bruce Momjian 01c76f7411 Ok. Updated patch attached.
- domain.patch -> source patch against pgsql in cvs
- drop_domain.sgml and create_domain.sgml -> New doc/src/sgml/ref docs

- dominfo.txt -> basic domain related queries I used for testing
[ ADDED TO /doc]

Enables domains of array elements -> CREATE DOMAIN dom int4[3][2];

Uses a typbasetype column to describe the origin of the domain.

Copies data to attnotnull rather than processing in execMain().

Some documentation differences from earlier.

If this is approved, I'll start working on pg_dump, and a \dD <domain>
option in psql, and regression tests.  I don't really feel like doing
those until the system table structure settles for pg_type.


CHECKS when added, will also be copied to to the table attributes.  FK
Constraints (if I ever figure out how) will be done similarly.  Both
will lbe handled by MergeDomainAttributes() which is called shortly
before MergeAttributes().

Rod Taylor
2002-03-06 20:35:02 +00:00
Bruce Momjian 3d9f865e94 Modify ALTER TABLE OWNER to change index ownership; code cleanup.
Neil Conway
2002-03-06 19:58:26 +00:00
Bruce Momjian e6227fd0ec Add missing Unicode multibyte files. 2002-03-06 06:12:59 +00:00
Bruce Momjian 92288a1cf9 Change made to elog:
o  Change all current CVS messages of NOTICE to WARNING.  We were going
to do this just before 7.3 beta but it has to be done now, as you will
see below.

o Change current INFO messages that should be controlled by
client_min_messages to NOTICE.

o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc.
to always go to the client.

o Remove INFO from the client_min_messages options and add NOTICE.

Seems we do need three non-ERROR elog levels to handle the various
behaviors we need for these messages.

Regression passed.
2002-03-06 06:10:59 +00:00