diff options
author | Bruce Momjian <bruce@momjian.us> | 2001-06-12 15:58:34 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2001-06-12 15:58:34 +0000 |
commit | 58c909bb8d37eeaea9d73fe904313fa3a8aedc89 (patch) | |
tree | 52e6a23de826c58930f08fb8a085b1836b10e0e6 /src/include/utils/builtins.h | |
parent | 13a52c1f0345c1b86b2bf43d766851a6ab852934 (diff) | |
download | postgresql-58c909bb8d37eeaea9d73fe904313fa3a8aedc89.tar.gz postgresql-58c909bb8d37eeaea9d73fe904313fa3a8aedc89.zip |
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
Diffstat (limited to 'src/include/utils/builtins.h')
-rw-r--r-- | src/include/utils/builtins.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 109d144494a..ea53e503039 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: builtins.h,v 1.150 2001/06/09 22:16:17 tgl Exp $ + * $Id: builtins.h,v 1.151 2001/06/12 15:58:34 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -22,6 +22,24 @@ /* * Defined in adt/ */ + +/* acl.c */ +extern Datum has_table_privilege_tname_tname(PG_FUNCTION_ARGS); +extern Datum has_table_privilege_tname_name(PG_FUNCTION_ARGS); +extern Datum has_table_privilege_name_tname(PG_FUNCTION_ARGS); +extern Datum has_table_privilege_name_name(PG_FUNCTION_ARGS); +extern Datum has_table_privilege_tname(PG_FUNCTION_ARGS); +extern Datum has_table_privilege_name(PG_FUNCTION_ARGS); + +extern Datum has_table_privilege_tname_id(PG_FUNCTION_ARGS); +extern Datum has_table_privilege_name_id(PG_FUNCTION_ARGS); +extern Datum has_table_privilege_id(PG_FUNCTION_ARGS); + +extern Datum has_table_privilege_id_tname(PG_FUNCTION_ARGS); +extern Datum has_table_privilege_id_name(PG_FUNCTION_ARGS); + +extern Datum has_table_privilege_id_id(PG_FUNCTION_ARGS); + /* bool.c */ extern Datum boolin(PG_FUNCTION_ARGS); extern Datum boolout(PG_FUNCTION_ARGS); |