Commit Graph

719 Commits

Author SHA1 Message Date
Bruce Momjian 1be615f381 Here is a patch to the resultmap to make the regression tests work on
OU8.

Larry Rosenman
2001-08-26 00:55:15 +00:00
Tom Lane f933766ba7 Restructure pg_opclass, pg_amop, and pg_amproc per previous discussions in
pgsql-hackers.  pg_opclass now has a row for each opclass supported by each
index AM, not a row for each opclass name.  This allows pg_opclass to show
directly whether an AM supports an opclass, and furthermore makes it possible
to store additional information about an opclass that might be AM-dependent.
pg_opclass and pg_amop now store "lossy" and "haskeytype" information that we
previously expected the user to remember to provide in CREATE INDEX commands.
Lossiness is no longer an index-level property, but is associated with the
use of a particular operator in a particular index opclass.

Along the way, IndexSupportInitialize now uses the syscaches to retrieve
pg_amop and pg_amproc entries.  I find this reduces backend launch time by
about ten percent, at the cost of a couple more special cases in catcache.c's
IndexScanOK.

Initial work by Oleg Bartunov and Teodor Sigaev, further hacking by Tom Lane.

initdb forced.
2001-08-21 16:36:06 +00:00
Tom Lane d4f4b971a4 Sequences are now based on int8, not int4, arithmetic. SERIAL pseudo-type
has an alias SERIAL4 and a sister SERIAL8.  SERIAL8 is just the same
except the created column is type int8 not int4.
initdb forced.  Note this also breaks any chance of pg_upgrade from 7.1,
unless we hack up pg_upgrade to drop and recreate sequences.  (Which is
not out of the question, but I don't wanna do it.)
2001-08-16 20:38:56 +00:00
Tom Lane 5f7c2bdb53 sum() on int2 and int4 columns now uses an int8, not numeric, accumulator
for speed reasons; its result type also changes to int8.  avg() on these
datatypes now accumulates the running sum in int8 for speed; but we still
deliver the final result as numeric, so that fractional accuracy is
preserved.

count() now counts and returns in int8, not int4.  I am a little nervous
about this possibly breaking users' code, but there didn't seem to be
a strong sentiment for avoiding the problem.  If we get complaints during
beta, we can change count back to int4 and add a "count8" aggregate.
For that matter, users can do it for themselves with a simple CREATE
AGGREGATE command; the int4inc function is still present, so no C hacking
is needed.

Also added max() and min() aggregates for OID that do proper unsigned
comparison, instead of piggybacking on int4 aggregates.

initdb forced.
2001-08-14 22:21:59 +00:00
Tom Lane bf56f0759b Make OIDs optional, per discussions in pghackers. WITH OIDS is still the
default, but OIDS are removed from many system catalogs that don't need them.
Some interesting side effects: TOAST pointers are 20 bytes not 32 now;
pg_description has a three-column key instead of one.

Bugs fixed in passing: BINARY cursors work again; pg_class.relhaspkey
has some usefulness; pg_dump dumps comments on indexes, rules, and
triggers in a valid order.

initdb forced.
2001-08-10 18:57:42 +00:00
Tom Lane d062f0f4e9 Fix collateral damage from error message cleanup. 2001-08-10 18:40:53 +00:00
Peter Eisentraut 9c90a2b045 This should be the right expected file. 2001-08-09 21:03:11 +00:00
Peter Eisentraut 2e57875b97 Use format_type sibling in backend error messages, so the user sees
consistent type naming.
2001-08-09 18:28:18 +00:00
Tom Lane 2f4759d5ce Doesn't seem to be much point in keeping this README up to date anymore,
since it's completely redundant with regress.sgml.  I think we agreed to
remove it awhile back, actually, but no one got around to doing it.
2001-08-06 22:55:00 +00:00
Peter Eisentraut bf51b8608b Use a fixed error message for ERANGE to avoid duplicate test result files.
Add some resultmap entries for SCO OpenServer.
2001-08-06 21:55:16 +00:00
Tom Lane f31dc0ada7 Partial indexes work again, courtesy of Martijn van Oosterhout.
Note: I didn't force an initdb, figuring that one today was enough.
However, there is a new function in pg_proc.h, and pg_dump won't be
able to dump partial indexes until you add that function.
2001-07-16 05:07:00 +00:00
Tom Lane c8076f09d2 Restructure index AM interface for index building and index tuple deletion,
per previous discussion on pghackers.  Most of the duplicate code in
different AMs' ambuild routines has been moved out to a common routine
in index.c; this means that all index types now do the right things about
inserting recently-dead tuples, etc.  (I also removed support for EXTEND
INDEX in the ambuild routines, since that's about to go away anyway, and
it cluttered the code a lot.)  The retail indextuple deletion routines have
been replaced by a "bulk delete" routine in which the indexscan is inside
the access method.  I haven't pushed this change as far as it should go yet,
but it should allow considerable simplification of the internal bookkeeping
for deletions.  Also, add flag columns to pg_am to eliminate various
hardcoded tests on AM OIDs, and remove unused pg_am columns.

Fix rtree and gist index types to not attempt to store NULLs; before this,
gist usually crashed, while rtree managed not to crash but computed wacko
bounding boxes for NULL entries (which might have had something to do with
the performance problems we've heard about occasionally).

Add AtEOXact routines to hash, rtree, and gist, all of which have static
state that needs to be reset after an error.  We discovered this need long
ago for btree, but missed the other guys.

Oh, one more thing: concurrent VACUUM is now the default.
2001-07-15 22:48:19 +00:00
Tom Lane 997439f59e Add ORDER BY to a couple of test queries whose output ordering is not
as predictable as it used to be, due to recycling of free space with
new VACUUM.
2001-07-15 20:16:17 +00:00
Tom Lane cb052e0bf1 Fix rule rewriter so that new ordering of ON INSERT actions applies
in cases of qualified rules as well as unqualified ones.  Tweak rules
test to avoid cluttering output with dummy SELECT results.  Update
documentation to match code.
2001-07-09 23:50:32 +00:00
Tom Lane 755e367cb2 Update abstime expected results to match post-30-June-2001 reality.
Probably the right fix is to remove 'current' special value entirely,
but I don't want to see regression test failures until that happens.
2001-07-02 19:31:52 +00:00
Jan Wieck 8d80b0d980 Statistical system views (yet without the config stuff, but
it's hard to keep such massive changes in sync with the tree
so I need to get it in and work from there now).

Jan
2001-06-22 19:16:24 +00:00
Bruce Momjian 7dac778561 Add GUC setting for Australian timezones. Uses new GUC boolean callback
functions to clear date cache.  Allow regression tests to pass when
timezone set.
2001-06-18 16:14:44 +00:00
Tom Lane 1f1ca182be Make inet/cidr << and <<= operators indexable. From Alex Pilosov <alex@pilosoft.com>. 2001-06-17 02:05:20 +00:00
Tom Lane 16ea152b7e Revoke public read access from pg_statistic, create new system view
pg_stats to provide controlled (and, hopefully, more readable) access
to statistics.  Comments on definition of pg_stats welcome.
I didn't force initdb, but the rules regress test will fail until you
do one.
2001-06-14 19:47:25 +00:00
Tom Lane c9499e68da has_table_privilege functions from Joe Conway (with some kibitzing from
Tom Lane).  For the moment, only the OID/name variants are provided.
I didn't force initdb, but the additions to the 'privileges' regress
test won't pass until you do one.
2001-06-14 01:09:22 +00:00
Bruce Momjian d4a4d4c326 Attached is a patch adding following functions:
inet(text), cidr(text): convert a text value into inet/cidr
set_masklen(inet): set masklen on the inet value

Patch also contains regression checks for these functions.

Alex Pilosov
2001-06-13 21:09:00 +00:00
Bruce Momjian 76e9ad1f55 Back out has_table_privilege patch. 2001-06-12 16:34:27 +00:00
Bruce Momjian 58c909bb8d OK -- here's take #5.
It "make"s and "make check"s clean against current cvs tip.

There are now both Text and Name variants, and the regression test support
is rolled into the patch. Note that to be complete wrt Name based variants,
there are now 12 user visible versions of has_table_privilege:

has_table_privilege(Text usename, Text relname, Text priv_type)
has_table_privilege(Text usename, Name relname, Text priv_type)
has_table_privilege(Name usename, Text relname, Text priv_type)
has_table_privilege(Name usename, Name relname, Text priv_type)
has_table_privilege(Text relname, Text priv_type) /* assumes current_user */
has_table_privilege(Name relname, Text priv_type) /* assumes current_user */
has_table_privilege(Text usename, Oid reloid, Text priv_type)
has_table_privilege(Name usename, Oid reloid, Text priv_type)
has_table_privilege(Oid reloid, Text priv_type)  /* assumes current_user */
has_table_privilege(Oid usesysid, Text relname, Text priv_type)
has_table_privilege(Oid usesysid, Name relname, Text priv_type)
has_table_privilege(Oid usesysid, Oid reloid, Text priv_type)

For the Text based inputs, a new internal function, get_Name is used
(shamelessly copied from get_seq_name in sequence.c) to downcase if not
quoted, or remove quotes if quoted, and truncate. I also added a few test
cases for the downcasing, quote removal, and Name based variants to the
regression test.

Joe Conway
2001-06-12 15:58:34 +00:00
Tom Lane 1d584f97b9 Clean up various to-do items associated with system indexes:
pg_database now has unique indexes on oid and on datname.
pg_shadow now has unique indexes on usename and on usesysid.
pg_am now has unique index on oid.
pg_opclass now has unique index on oid.
pg_amproc now has unique index on amid+amopclaid+amprocnum.
Remove pg_rewrite's unnecessary index on oid, delete unused RULEOID syscache.
Remove index on pg_listener and associated syscache for performance reasons
(caching rows that are certain to change before you need 'em again is
rather pointless).
Change pg_attrdef's nonunique index on adrelid into a unique index on
adrelid+adnum.

Fix various incorrect settings of pg_class.relisshared, make that the
primary reference point for whether a relation is shared or not.
IsSharedSystemRelationName() is now only consulted to initialize relisshared
during initial creation of tables and indexes.  In theory we might now
support shared user relations, though it's not clear how one would get
entries for them into pg_class &etc of multiple databases.

Fix recently reported bug that pg_attribute rows created for an index all have
the same OID.  (Proof that non-unique OID doesn't matter unless it's
actually used to do lookups ;-))

There's no need to treat pg_trigger, pg_attrdef, pg_relcheck as bootstrap
relations.  Convert them into plain system catalogs without hardwired
entries in pg_class and friends.

Unify global.bki and template1.bki into a single init script postgres.bki,
since the alleged distinction between them was misleading and pointless.
Not to mention that it didn't work for setting up indexes on shared
system relations.

Rationalize locking of pg_shadow, pg_group, pg_attrdef (no need to use
AccessExclusiveLock where ExclusiveLock or even RowExclusiveLock will do).
Also, hold locks until transaction commit where necessary.
2001-06-12 05:55:50 +00:00
Peter Eisentraut 7ceed2a9b5 Allow GRANT/REVOKE to/from more than one user per invocation. Command tag
for GRANT/REVOKE is now just that, not "CHANGE".

On the way, migrate some of the aclitem internal representation away from
the parser and build a real parse tree instead.  Also add some 'const'
qualifiers.
2001-06-09 23:21:55 +00:00
Bruce Momjian 28d2420eef This patch adds support for %TYPE in CREATE FUNCTION argument and return
types.  This version has an elog() to remind the user the type
resolution is not dynamic.

Ian Lance Taylor
2001-06-04 23:27:23 +00:00
Tom Lane 7c0c9b3cce New improved version of bpcharin() may have got the truncation case
right, but it failed to get the padding case right.

This was obscured by subsequent application of bpchar() in all but one
regression test case, and that one didn't fail in an obvious way ---
trailing blanks are hard to see.  Add another test case to make it
more obvious if it breaks again.
2001-06-01 17:49:17 +00:00
Bruce Momjian 7160c86ec2 These patches should fix check constraints not inheriting
when added by alter table add constraint.  The first file
patches backend/commands/command.c and the latter is a patch
to the alter table regression test.

Stephan Szabo
2001-05-30 13:00:03 +00:00
Peter Eisentraut 96147a6d1c Make UPDATE and DELETE privileges distinct. Add REFERENCES and TRIGGER
privileges.  INSERT and COPY FROM now require INSERT (only).  Add
privileges regression test.
2001-05-27 09:59:30 +00:00
Peter Eisentraut efcecd9eca Make bit and bit varying types reject too long input. (They already tried
to do that, but inconsistently.)  Make bit type reject too short input,
too, per SQL.  Since it no longer zero pads, 'zpbit*' has been renamed to
'bit*' in the source, hence initdb.
2001-05-22 16:37:17 +00:00
Peter Eisentraut 5546ec289b Make char(n) and varchar(n) types raise an error if the inserted string is
too long.  While I was adjusting the regression tests I moved the array
things all into array.sql, to make things more manageable.
2001-05-21 16:54:46 +00:00
Tom Lane be03eb25f3 Modify optimizer data structures so that IndexOptInfo lists built for
create_index_paths are not immediately discarded, but are available for
subsequent planner work.  This allows avoiding redundant syscache lookups
in several places.  Change interface to operator selectivity estimation
procedures to allow faster and more flexible estimation.
Initdb forced due to change of pg_proc entries for selectivity functions!
2001-05-20 20:28:20 +00:00
Tom Lane 78b674ba35 Add regression test to catch future breakage of avg(interval). This
aggregate seems uniquely fragile, because it's the only one with an
agginitval that's at all likely to change in format.
2001-05-18 16:02:01 +00:00
Bruce Momjian 0eacc60e23 Fix regression for new oids. 2001-05-15 04:12:56 +00:00
Bruce Momjian 9d17a1dd29 Update regression for new oids, some now two smaller. 2001-05-14 22:16:15 +00:00
Tom Lane 1c1eb0fa0e Suppress failures in parallel regress tests due to use of same table
name in two different tests.  This solution does not meet with universal
approval, so it may get changed later ...
2001-05-11 05:09:03 +00:00
Bruce Momjian 1f7cb07905 BSD/OS has new precision, and negative zeros now. 2001-05-10 23:46:25 +00:00
Bruce Momjian 8678929c22 This patch should catch cases where the types
in referencing and referenced columns of an fk constraint
aren't comparable using '=' at constraint definition time
rather than insert/update time.

Stephan Szabo
2001-05-09 21:10:39 +00:00
Tom Lane f905d65ee3 Rewrite of planner statistics-gathering code. ANALYZE is now available as
a separate statement (though it can still be invoked as part of VACUUM, too).
pg_statistic redesigned to be more flexible about what statistics are
stored.  ANALYZE now collects a list of several of the most common values,
not just one, plus a histogram (not just the min and max values).  Random
sampling is used to make the process reasonably fast even on very large
tables.  The number of values and histogram bins collected is now
user-settable via an ALTER TABLE command.

There is more still to do; the new stats are not being used everywhere
they could be in the planner.  But the remaining changes for this project
should be localized, and the behavior is already better than before.

A not-very-related change is that sorting now makes use of btree comparison
routines if it can find one, rather than invoking '<' twice.
2001-05-07 00:43:27 +00:00
Bruce Momjian 3f8e21c34a apply a little patch:
Oleg Bartunov
2001-05-03 19:20:24 +00:00
Tom Lane 2792374cff Ensure that btree sort ordering functions and boolean comparison operators
give consistent results for all datatypes.  Types float4, float8, and
numeric were broken for NaN values; abstime, timestamp, and interval
were broken for INVALID values; timetz was just plain broken (some
possible pairs of values were neither < nor = nor >).  Also clean up
text, bpchar, varchar, and bit/varbit to eliminate duplicate code and
thereby reduce the probability of similar inconsistencies arising in
the future.
2001-05-03 19:00:37 +00:00
Thomas G. Lockhart 9c3bbf256b Alter the previous test for "time with time zone" implicit time zone
(which failed miserably during DST) to just compare against a time
 derived from a timestamp value.
Certainly not a direct check for a correct result, but should work
 at any time of year.
2001-04-06 05:50:29 +00:00
Tom Lane 6faf150a30 Fix/cleanup DLLLIBS handling for Cygwin port. If it works it's to
Jason Tishler's credit, if it's broken it's my fault ...
2001-04-04 21:15:56 +00:00
Tom Lane 71d578ab68 Remove daylight-savings-time-dependent tests of 'time with time zone'
datatype.  Perhaps someday we can figure out a way of getting reproducible
results from testing this type, but for now ...
2001-04-04 20:03:11 +00:00
Tom Lane 648c09181e Re-allow specification of a new default value for an inherited column
in CREATE TABLE, but give a warning notice.  Clean up inconsistent
handling of defaults and NOT NULL flags from multiply-inherited columns.
Per pghackers discussion 28-Mar through 30-Mar.
2001-03-30 20:50:36 +00:00
Bruce Momjian 153237cc45 OpenBSD resultmap change:
I posted this to the list a few days ago,  but it was not addressed.  Can
someone please make the changes to the src/test/regress/resultmap?

Thanks.

- brandon
2001-03-26 17:51:41 +00:00
Peter Eisentraut 6ba0f31bdd Make less misleading message for failed + ignored tests. 2001-03-24 23:32:25 +00:00
Marc G. Fournier 69a2c2bad2 geometry tests 'FAILED' from a precision standpoint, but differently then
what solaris-precision takes into account ... its possible that solaris-precision
is 'stale', but created a new one "just in case" ...
2001-03-22 15:13:19 +00:00
Bruce Momjian 9e1552607a pgindent run. Make it all clean. 2001-03-22 04:01:46 +00:00
Tom Lane ca03b551fc Discuss LOCALE differences as a reason for regression test failure. 2001-03-20 00:09:36 +00:00