Tom Lane [Fri, 31 Oct 2003 20:00:49 +0000 (20:00 +0000)]
When a superuser does GRANT or REVOKE on an object he doesn't own,
process the command as though it were issued by the object owner.
This prevents creating weird scenarios in which the same privileges
may appear to flow from different sources, and ensures that a superuser
can in fact revoke all privileges if he wants to. In particular this
means that the regression tests work when run by a superuser other than
the original bootstrap userid. Per report from Larry Rosenman.
Tom Lane [Fri, 31 Oct 2003 17:43:10 +0000 (17:43 +0000)]
Minor cleanup of PQunescapeBytea(). Avoid unportable assumptions about
behavior of malloc and realloc when request size is 0. Fix escape
sequence recognizer so that only valid 3-digit octal sequences are
treated as escape sequences ... isdigit() is not a correct test.
Jan Wieck [Fri, 31 Oct 2003 03:58:21 +0000 (03:58 +0000)]
Fix for possible referential integrity violation when a qualified ON INSERT
rule split the query into one INSERT and one UPDATE where the UPDATE
then hit's the just created row without modifying the key fields again.
In this special case, the new key slipped in totally unchecked.
Tom Lane [Fri, 31 Oct 2003 03:58:15 +0000 (03:58 +0000)]
Small fix to Christopher's recent improvements --- underscore is not
a special character in regexes, but it is for LIKE, so NOT LIKE 'pg_%'
is incorrect. Need NOT LIKE 'pg\_%'.
Tom Lane [Fri, 31 Oct 2003 00:18:55 +0000 (00:18 +0000)]
Use Tcl ByteArray objects to avoid unwanted character set translation
in libpgtcl's lo_read/lo_write commands. Also, deal correctly with
failure return from lo_read(). ljb and Tom Lane.
Tom Lane [Thu, 30 Oct 2003 21:37:38 +0000 (21:37 +0000)]
Further work on tab completion code: arrange for system catalogs to be
offered for completion only when the input-so-far is at least 'pg_'.
This seems to be the best compromise behavior emerging from yesterday's
discussion. While at it, refactor code to eliminate repetitive use of
nearly identical queries, which was exceedingly tedious to maintain.
Also const-ify code more thoroughly in hopes of moving constant data into
text segment, and remove unnecessary length limit on queries.
Tom Lane [Wed, 29 Oct 2003 22:20:54 +0000 (22:20 +0000)]
Fix some corner cases in ACL manipulation: don't foul up on an empty
ACL array, and force languages to be treated as owned by the bootstrap
user ID. (pg_language should have a lanowner column, but until it does
this will have to do as a workaround.)
Tom Lane [Tue, 28 Oct 2003 23:35:52 +0000 (23:35 +0000)]
Don't include "schema." in the set of possible tab completions once
"schema." has been typed. This allows readline to complete subsequent
characters immediately if all relations in the target schema start with
the same prefix. This actually worked before, but I unintentionally
broke it a few days ago.
Also, make completion schema-aware for GRANT, REVOKE, VACUUM.
Bruce Momjian [Sun, 26 Oct 2003 04:51:51 +0000 (04:51 +0000)]
Fix two bugs in funcs.source that made the tutorial script fail.
Make a LOT of fixes to syscat.source to:
* Set search_path properly (and reset it)
* Add schema name to all results
* Add schema name to ORDER BY first
* Make checks for user-defined objects match reality
* format_type all type names
* Respect attisdropped
* Change !~ to 'not like' since it's more standard
Peter Eisentraut [Sat, 25 Oct 2003 20:18:53 +0000 (20:18 +0000)]
Get Tru64/cc to compile. Need to add -ieee so that it doesn't choke on
0.0/0.0. That option appears to affect the regression test result as well.
The compiler documentation doesn't recommend -O4 for universal use, so
let's stick to the conservative -O (== -O2) by default.