mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Privileges on functions and procedural languages
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.99 2001/10/10 00:02:42 petere Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.100 2002/02/18 23:11:18 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -269,6 +269,7 @@ static ScanKeyword ScanKeywords[] = {
|
||||
{"unlisten", UNLISTEN},
|
||||
{"until", UNTIL},
|
||||
{"update", UPDATE},
|
||||
{"usage", USAGE},
|
||||
{"user", USER},
|
||||
{"using", USING},
|
||||
{"vacuum", VACUUM},
|
||||
@@ -354,3 +355,36 @@ ScanKeywordLookup(char *text)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This does the reverse mapping from token number to string.
|
||||
*/
|
||||
const char *
|
||||
TokenString(int token)
|
||||
{
|
||||
int i = 0;
|
||||
static char buf[NAMEDATALEN];
|
||||
|
||||
while (i < sizeof(ScanKeywords))
|
||||
{
|
||||
if (ScanKeywords[i].value == token)
|
||||
{
|
||||
int k;
|
||||
|
||||
/* uppercase */
|
||||
for (k = 0; k < NAMEDATALEN; k++)
|
||||
if (ScanKeywords[i].name[k] >= 'a'
|
||||
&& ScanKeywords[i].name[k] <= 'z')
|
||||
buf[k] = ScanKeywords[i].name[k] + ('A' - 'a');
|
||||
else
|
||||
buf[k] = ScanKeywords[i].name[k];
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user