Commit Graph

299 Commits

Author SHA1 Message Date
Tom Lane fb97d2b6bf Correct permissions-checking bugs associated with ancient decision to
copy PUBLIC access rights into each newly created ACL entry.  Instead
treat each ACL entry as independent flags.  Also clean up some ugliness
in acl.h API.
2001-06-05 19:34:56 +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
Bruce Momjian 9e1552607a pgindent run. Make it all clean. 2001-03-22 04:01:46 +00:00
Bruce Momjian 623bf843d2 Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group. 2001-01-24 19:43:33 +00:00
Tom Lane 786f1a59cd Fix all the places that called heap_update() and heap_delete() without
bothering to check the return value --- which meant that in case the
update or delete failed because of a concurrent update, you'd not find
out about it, except by observing later that the transaction produced
the wrong outcome.  There are now subroutines simple_heap_update and
simple_heap_delete that should be used anyplace that you're not prepared
to do the full nine yards of coping with concurrent updates.  In
practice, that seems to mean absolutely everywhere but the executor,
because *noplace* else was checking.
2001-01-23 04:32:23 +00:00
Tom Lane 175f52083b aclitemout() shouldn't coredump when it finds an ACL item
for a now-vanished group.  Instead, display the numeric group ID, same
as it does for vanished users.
2000-11-28 23:42:31 +00:00
Tom Lane a933ee38bb Change SearchSysCache coding conventions so that a reference count is
maintained for each cache entry.  A cache entry will not be freed until
the matching ReleaseSysCache call has been executed.  This eliminates
worries about cache entries getting dropped while still in use.  See
my posting to pg-hackers of even date for more info.
2000-11-16 22:30:52 +00:00
Tom Lane 6be6a185d9 Minor code cleanups, make in_group() check faster. 2000-11-03 19:02:18 +00:00
Tom Lane 7215f74b89 Make default ACL be consistent --- ie, starting point for ChangeAcl
is the same as the access permissions granted when a relation's relacl
field is NULL, ie, owner=all rights, world=no rights.
2000-10-02 04:49:28 +00:00
Peter Eisentraut 6dc249610a Code cleanup of user name and user id handling in the backend. The current
user is now defined in terms of the user id, the user name is only computed
upon request (for display purposes). This is kind of the opposite of the
previous state, which would maintain the user name and compute the user id
for permission checks.

Besides perhaps saving a few cycles (integer vs string), this now creates a
single point of attack for changing the user id during a connection, for
purposes of "setuid" functions, etc.
2000-09-06 14:15:31 +00:00
Tom Lane 7d0c4188f1 Make acl-related functions safe for TOAST. Mark pg_class.relacl as
compressible but not externally storable (since we're not sure about
whether creating a toast relation for pg_class would work).
2000-07-31 22:39:17 +00:00
Bruce Momjian 52f77df613 Ye-old pgindent run. Same 4-space tabs. 2000-04-12 17:17:23 +00:00
Bruce Momjian 5c25d60244 Add:
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc

to all files copyright Regents of Berkeley.  Man, that's a lot of files.
2000-01-26 05:58:53 +00:00
Tom Lane 9e0b463473 setheapoverride() is history. Uses replaced with CommandCounterIncrement()
where necessary --- several of them didn't really need it, though.
tqual-checking macros simplified accordingly.
2000-01-17 23:57:48 +00:00
Peter Eisentraut 759fba4873 Included all yacc and lex files into the distribution. 2000-01-16 20:05:00 +00:00
Peter Eisentraut 1cd4c14116 Fixed all elog related warnings, as well as a few others. 2000-01-15 02:59:43 +00:00
Peter Eisentraut 46a28f1b14 Fixed everything in and surrounding createdb and dropdb to make it more
error-proof. Rearranged some old code and removed dead sections.
2000-01-13 18:26:18 +00:00
Bruce Momjian 74f418eb9a Add pg_statistic index, add missing Hiroshi file. 1999-11-24 16:52:50 +00:00
Bruce Momjian bb10bf319e Rename heap_replace to heap_update. 1999-11-24 00:44:37 +00:00
Bruce Momjian fc955b14ea Add system indexes to match all caches.
Make all system indexes unique.
Make all cache loads use system indexes.
Rename *rel to *relid in inheritance tables.
Rename cache names to be clearer.
1999-11-22 17:56:41 +00:00
Bruce Momjian 86ef36c907 New NameStr macro to convert Name to Str. No need for var.data anymore.
Fewer calls to nameout.

Better use of RelationGetRelationName.
1999-11-07 23:08:36 +00:00
Tom Lane bd272cace6 Mega-commit to make heap_open/heap_openr/heap_close take an
additional argument specifying the kind of lock to acquire/release (or
'NoLock' to do no lock processing).  Ensure that all relations are locked
with some appropriate lock level before being examined --- this ensures
that relevant shared-inval messages have been processed and should prevent
problems caused by concurrent VACUUM.  Fix several bugs having to do with
mismatched increment/decrement of relation ref count and mismatched
heap_open/close (which amounts to the same thing).  A bogus ref count on
a relation doesn't matter much *unless* a SI Inval message happens to
arrive at the wrong time, which is probably why we got away with this
sloppiness for so long.  Repair missing grab of AccessExclusiveLock in
DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi.
Recommend 'make clean all' after pulling this update; I modified the
Relation struct layout slightly.
Will post further discussion to pghackers list shortly.
1999-09-18 19:08:25 +00:00
Bruce Momjian 44763a2b23 Make usecatupd disabled for normal users, and allow normal users to
update temp tables with this setting.
1999-07-30 18:09:49 +00:00
Bruce Momjian 3406901a29 Move some system includes into c.h, and remove duplicates. 1999-07-17 20:18:55 +00:00
Bruce Momjian a71802e12e Final cleanup. 1999-07-16 05:00:38 +00:00
Bruce Momjian 9b645d481c Update #include cleanups 1999-07-16 03:14:30 +00:00
Bruce Momjian 2e6b1e63a3 Remove unused #includes in *.c files. 1999-07-15 22:40:16 +00:00
Bruce Momjian db4a6a2618 I have a small patch for 6.5.
aclchk.c: heap_close() is not called after calling heap_openr().

Atsushi Ogawa
1999-06-19 05:05:52 +00:00
Bruce Momjian 4853495e03 Change error messages to oids come out as %u and not %d. Change has no
real affect now.
1999-05-10 00:46:32 +00:00
Bruce Momjian 58118db39d Add new postgres -O option to allow system table structure changes. 1999-03-17 22:53:31 +00:00
Bruce Momjian 6724a50787 Change my-function-name-- to my_function_name, and optimizer renames. 1999-02-13 23:22:53 +00:00
Vadim B. Mikheev 3f7fbf85dc Initial MVCC code.
New code for locking buffer' context.
1998-12-15 12:47:01 +00:00
Vadim B. Mikheev 6beba218d7 New HeapTuple structure/interface. 1998-11-27 19:52:36 +00:00
Bruce Momjian fa1a8d6a97 OK, folks, here is the pgindent output. 1998-09-01 04:40:42 +00:00
Bruce Momjian af74855a60 Renaming cleanup, no pgindent yet. 1998-09-01 03:29:17 +00:00
Bruce Momjian 7971539020 heap_fetch requires buffer pointer, must be released; heap_getnext
no longer returns buffer pointer, can be gotten from scan;
	descriptor; bootstrap can create multi-key indexes;
pg_procname index now is multi-key index; oidint2, oidint4, oidname
are gone (must be removed from regression tests); use System Cache
rather than sequential scan in many places; heap_modifytuple no
longer takes buffer parameter; remove unused buffer parameter in
a few other functions; oid8 is not index-able; remove some use of
single-character variable names; cleanup Buffer variables usage
and scan descriptor looping; cleaned up allocation and freeing of
tuples; 18k lines of diff;
1998-08-19 02:04:17 +00:00
Bruce Momjian 79c8d2e3a0 Change owner from oid to int4 type. 1998-08-11 18:28:49 +00:00
Vadim B. Mikheev be8300b18f Use Snapshot in heap access methods. 1998-07-27 19:38:40 +00:00
Bruce Momjian 6bd323c6b3 Remove un-needed braces around single statements. 1998-06-15 19:30:31 +00:00
Thomas G. Lockhart de75f9ef49 Change parameters to func_error(). 1998-05-09 23:43:45 +00:00
Bruce Momjian 09baa3cc81 This patch...
1. Removes the unnecessary "#define AbcRegProcedure 123"'s from
pg_proc.h.

2. Changes those #defines to use the names already defined in
fmgr.h.

3. Forces the make of fmgr.h in backend/Makefile instead of having
it
   made as a dependency in access/common/Makefile  *hack*hack*hack*

4. Rearranged the #includes to a less helter-skelter arrangement,
also
    changing <file.h> to "file.h" to signify a non-system header.

5. Removed "pg_proc.h" from files where its only purpose was for
the
   #defines removed in item #1.

6. Added "fmgr.h" to each file changed for completeness sake.

Turns out that #6 was not necessary for some files because fmgr.h
was being included in a roundabout way SIX levels deep by the first
include.

"access/genam.h"
 ->"access/relscan.h"
   ->"utils/rel.h"
     ->"access/strat.h"
       ->"access/skey.h"
	 ->"fmgr.h"

So adding fmgr.h really didn't add anything to the compile, hopefully
just made it clearer to the programmer.

S Darren.
1998-04-27 04:08:07 +00:00
Bruce Momjian a32450a585 pgindent run before 6.3 release, with Thomas' requested changes. 1998-02-26 04:46:47 +00:00
Marc G. Fournier 780068f812 From: Jan Wieck <jwieck@debis.com>
seems  that  my last post didn't make it through. That's good
    since  the  diff  itself  didn't  covered  the  renaming   of
    pg_user.h to pg_shadow.h and it's new content.

    Here  it's  again.  The  complete regression test passwd with
    only some  float  diffs.  createuser  and  destroyuser  work.
    pg_shadow cannot be read by ordinary user.
1998-02-25 13:09:49 +00:00
Marc G. Fournier 5cf1964fc6 From: Jan Wieck <jwieck@debis.com>
So   if   the   relname   is   given   to   acldefault()   in
    utils/adt/acl.c, it can do a IsSystemRelationName() on it and
    return ACL_RD instead of ACL_WORLD_DEFAULT.
1998-02-24 03:31:50 +00:00
Bruce Momjian 24cab6bd0d Goodbye register keyword. Compiler knows better. 1998-02-11 19:14:04 +00:00
Bruce Momjian 726c3854cb Inline fastgetattr and others so data access does not use function
calls.
1998-01-31 04:39:26 +00:00
PostgreSQL Daemon baef78d96b Thank god for searchable mail archives.
Patch by: wieck@sapserv.debis.de (Jan Wieck)

   One  of  the design rules of PostgreSQL is extensibility. And
   to follow this rule means (at least for me) that there should
   not  only  be a builtin PL.  Instead I would prefer a defined
   interface for PL implemetations.
1998-01-15 19:46:37 +00:00
Bruce Momjian 9d00fbbeb0 Change some labels in bootparse to make ctags happy. Clean up outfunc/readfunc code and add missing fields for Query structure and new Union fields. Fix optimizer bug shown in new \do command. Change WARN to ERROR in contrib and regression stuff. 1998-01-06 18:53:02 +00:00
Bruce Momjian 9db64857e0 Move variable.c to commands/ and aclchk.c to catalog/. 1998-01-05 18:43:18 +00:00