Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
3357e1d2
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3357e1d2
编写于
6月 12, 2000
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Back out pg_shadow changes to allow create table and locking permissions.
上级
64948dbe
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
53 addition
and
225 deletion
+53
-225
src/backend/commands/command.c
src/backend/commands/command.c
+1
-17
src/backend/commands/creatinh.c
src/backend/commands/creatinh.c
+2
-20
src/backend/commands/user.c
src/backend/commands/user.c
+4
-35
src/backend/parser/gram.y
src/backend/parser/gram.y
+20
-47
src/backend/parser/keywords.c
src/backend/parser/keywords.c
+2
-6
src/backend/tcop/pquery.c
src/backend/tcop/pquery.c
+1
-21
src/bin/initdb/initdb.sh
src/bin/initdb/initdb.sh
+1
-3
src/bin/scripts/createuser
src/bin/scripts/createuser
+1
-45
src/include/catalog/catversion.h
src/include/catalog/catversion.h
+2
-2
src/include/catalog/pg_attribute.h
src/include/catalog/pg_attribute.h
+7
-9
src/include/catalog/pg_class.h
src/include/catalog/pg_class.h
+2
-2
src/include/catalog/pg_shadow.h
src/include/catalog/pg_shadow.h
+8
-12
src/include/nodes/parsenodes.h
src/include/nodes/parsenodes.h
+2
-6
未找到文件。
src/backend/commands/command.c
浏览文件 @
3357e1d2
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.7
8 2000/06/09 15:50:43
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.7
9 2000/06/12 03:40:29
momjian Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
...
...
@@ -30,7 +30,6 @@
#include "commands/command.h"
#include "executor/spi.h"
#include "catalog/heap.h"
#include "catalog/pg_shadow.h"
#include "miscadmin.h"
#include "optimizer/prep.h"
#include "utils/acl.h"
...
...
@@ -1212,21 +1211,6 @@ LockTableCommand(LockStmt *lockstmt)
{
Relation
rel
;
int
aclresult
;
HeapTuple
tup
;
/* ----------
* Check pg_shadow for global lock setting
* ----------
*/
tup
=
SearchSysCacheTuple
(
SHADOWNAME
,
PointerGetDatum
(
GetPgUserName
()),
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
tup
))
elog
(
ERROR
,
"LOCK TABLE: look at pg_shadow failed"
);
if
(
!
((
Form_pg_shadow
)
GETSTRUCT
(
tup
))
->
uselocktable
)
elog
(
ERROR
,
"LOCK TABLE: permission denied"
);
rel
=
heap_openr
(
lockstmt
->
relname
,
NoLock
);
if
(
!
RelationIsValid
(
rel
))
...
...
src/backend/commands/creatinh.c
浏览文件 @
3357e1d2
...
...
@@ -9,9 +9,9 @@
*
* IDENTIFICATION
<<<<<<< creatinh.c
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.6
0 2000/06/09 15:50:43
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.6
1 2000/06/12 03:40:29
momjian Exp $
=======
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.6
0 2000/06/09 15:50:43
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.6
1 2000/06/12 03:40:29
momjian Exp $
>>>>>>> 1.58
*
*-------------------------------------------------------------------------
...
...
@@ -26,10 +26,8 @@
#include "catalog/pg_inherits.h"
#include "catalog/pg_ipl.h"
#include "catalog/pg_type.h"
#include "catalog/pg_shadow.h"
#include "commands/creatinh.h"
#include "utils/syscache.h"
#include "miscadmin.h"
/* ----------------
* local stuff
...
...
@@ -65,22 +63,6 @@ DefineRelation(CreateStmt *stmt, char relkind)
int
i
;
AttrNumber
attnum
;
if
(
!
stmt
->
istemp
)
{
HeapTuple
tup
;
/* ----------
* Check pg_shadow for global createTable setting
* ----------
*/
tup
=
SearchSysCacheTuple
(
SHADOWNAME
,
PointerGetDatum
(
GetPgUserName
()),
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
tup
))
elog
(
ERROR
,
"CREATE TABLE: look at pg_shadow failed"
);
if
(
!
((
Form_pg_shadow
)
GETSTRUCT
(
tup
))
->
usecreatetable
)
elog
(
ERROR
,
"CREATE TABLE: permission denied"
);
}
if
(
strlen
(
stmt
->
relname
)
>=
NAMEDATALEN
)
elog
(
ERROR
,
"the relation name %s is >= %d characters long"
,
stmt
->
relname
,
NAMEDATALEN
);
...
...
src/backend/commands/user.c
浏览文件 @
3357e1d2
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.
59 2000/06/09 15:50:43
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.
60 2000/06/12 03:40:29
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -250,10 +250,6 @@ CreateUser(CreateUserStmt *stmt)
return
;
}
AssertState
(
BoolIsValid
(
stmt
->
createtable
));
new_record
[
Anum_pg_shadow_usecreatetable
-
1
]
=
(
Datum
)(
stmt
->
createtable
);
AssertState
(
BoolIsValid
(
stmt
->
locktable
));
new_record
[
Anum_pg_shadow_uselocktable
-
1
]
=
(
Datum
)(
stmt
->
locktable
);
/*
* Build a tuple to insert
*/
...
...
@@ -267,8 +263,6 @@ CreateUser(CreateUserStmt *stmt)
AssertState
(
BoolIsValid
(
stmt
->
createuser
));
new_record
[
Anum_pg_shadow_usesuper
-
1
]
=
(
Datum
)
(
stmt
->
createuser
);
/* superuser gets catupd right by default */
new_record_nulls
[
Anum_pg_shadow_usecreatetable
-
1
]
=
' '
;
new_record_nulls
[
Anum_pg_shadow_uselocktable
-
1
]
=
' '
;
new_record
[
Anum_pg_shadow_usecatupd
-
1
]
=
(
Datum
)
(
stmt
->
createuser
);
if
(
stmt
->
password
)
...
...
@@ -358,8 +352,7 @@ AlterUser(AlterUserStmt *stmt)
/* must be superuser or just want to change your own password */
if
(
!
superuser
()
&&
!
(
stmt
->
createdb
==
0
&&
stmt
->
createuser
==
0
&&
stmt
->
createtable
==
0
&&
stmt
->
locktable
==
0
&&
!
stmt
->
validUntil
!
(
stmt
->
createdb
==
0
&&
stmt
->
createuser
==
0
&&
!
stmt
->
validUntil
&&
stmt
->
password
&&
strcmp
(
GetPgUserName
(),
stmt
->
user
)
==
0
))
elog
(
ERROR
,
"ALTER USER: permission denied"
);
...
...
@@ -387,32 +380,8 @@ AlterUser(AlterUserStmt *stmt)
/*
* Build a tuple to update, perusing the information just obtained
*/
/* createtable */
if
(
stmt
->
createtable
==
0
)
{
/* don't change */
new_record
[
Anum_pg_shadow_usecreatetable
-
1
]
=
heap_getattr
(
tuple
,
Anum_pg_shadow_usecreatetable
,
pg_shadow_dsc
,
&
null
);
new_record_nulls
[
Anum_pg_shadow_usecreatetable
-
1
]
=
null
?
'n'
:
' '
;
}
else
{
new_record
[
Anum_pg_shadow_usecreatetable
-
1
]
=
(
Datum
)(
stmt
->
createtable
>
0
?
true
:
false
);
new_record_nulls
[
Anum_pg_shadow_usecreatetable
-
1
]
=
' '
;
}
/* locktable */
if
(
stmt
->
locktable
==
0
)
{
/* don't change */
new_record
[
Anum_pg_shadow_uselocktable
-
1
]
=
heap_getattr
(
tuple
,
Anum_pg_shadow_uselocktable
,
pg_shadow_dsc
,
&
null
);
new_record_nulls
[
Anum_pg_shadow_uselocktable
-
1
]
=
null
?
'n'
:
' '
;
}
else
{
new_record
[
Anum_pg_shadow_uselocktable
-
1
]
=
(
Datum
)(
stmt
->
locktable
>
0
?
true
:
false
);
new_record_nulls
[
Anum_pg_shadow_uselocktable
-
1
]
=
' '
;
}
new_record
[
Anum_pg_shadow_usename
-
1
]
=
PointerGetDatum
(
namein
(
stmt
->
user
));
new_record_nulls
[
Anum_pg_shadow_usename
-
1
]
=
' '
;
/* sysid - leave as is */
new_record
[
Anum_pg_shadow_usesysid
-
1
]
=
heap_getattr
(
tuple
,
Anum_pg_shadow_usesysid
,
pg_shadow_dsc
,
&
null
);
...
...
src/backend/parser/gram.y
浏览文件 @
3357e1d2
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.17
1 2000/06/09 15:50:44
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.17
2 2000/06/12 03:40:30
momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -145,8 +145,7 @@ static void doNegateFloat(Value *v);
%type <ival> opt_lock, lock_type
%type <boolean> opt_lmode, opt_force
%type <ival> user_createdb_clause, user_createuser_clause, user_createtable_clause,
user_locktable_clause
%type <ival> user_createdb_clause, user_createuser_clause
%type <str> user_passwd_clause
%type <ival> sysid_clause
%type <str> user_valid_clause
...
...
@@ -340,14 +339,14 @@ static void doNegateFloat(Value *v);
*/
%token ABORT_TRANS, ACCESS, AFTER, AGGREGATE, ANALYZE,
BACKWARD, BEFORE, BINARY, BIT,
CACHE, CLUSTER, COMMENT, COPY, CREATEDB, CREATE
TABLE, CREATE
USER, CYCLE,
CACHE, CLUSTER, COMMENT, COPY, CREATEDB, CREATEUSER, CYCLE,
DATABASE, DELIMITERS, DO,
EACH, ENCODING, EXCLUSIVE, EXPLAIN, EXTEND,
FORCE, FORWARD, FUNCTION, HANDLER,
INCREMENT, INDEX, INHERITS, INSTEAD, ISNULL,
LANCOMPILER, LIMIT, LISTEN, LOAD, LOCATION, LOCK_P,
LOCKTABLE,
LANCOMPILER, LIMIT, LISTEN, LOAD, LOCATION, LOCK_P,
MAXVALUE, MINVALUE, MODE, MOVE,
NEW, NOCREATEDB, NOCREATE
TABLE, NOCREATEUSER, NOLOCKTABLE
, NONE, NOTHING, NOTIFY, NOTNULL,
NEW, NOCREATEDB, NOCREATE
USER
, NONE, NOTHING, NOTIFY, NOTNULL,
OFFSET, OIDS, OPERATOR, PASSWORD, PROCEDURAL,
REINDEX, RENAME, RESET, RETURNS, ROW, RULE,
SEQUENCE, SERIAL, SETOF, SHARE, SHOW, START, STATEMENT, STDIN, STDOUT, SYSID,
...
...
@@ -474,37 +473,32 @@ stmt : AlterTableStmt
*
*****************************************************************************/
CreateUserStmt: CREATE USER UserId
user_createdb_clause user_createuser_clause
user_create
table_clause user_locktable
_clause user_group_clause
CreateUserStmt: CREATE USER UserId
user_create
db_clause user_createuser
_clause user_group_clause
user_valid_clause
{
CreateUserStmt *n = makeNode(CreateUserStmt);
n->user = $3;
n->sysid = -1;
n->sysid = -1;
n->password = NULL;
n->createdb = $4 == +1 ? true : false;
n->createuser = $5 == +1 ? true : false;
n->createtable = $6 == +1 ? true : false;
n->locktable = $7 == +1 ? true : false;
n->groupElts = $8;
n->validUntil = $9;
n->groupElts = $6;
n->validUntil = $7;
$$ = (Node *)n;
}
| CREATE USER UserId WITH sysid_clause user_passwd_clause
user_createdb_clause user_createuser_clause
user_createtable_clause user_locktable_clause user_group_clause
user_createdb_clause user_createuser_clause user_group_clause
user_valid_clause
{
CreateUserStmt *n = makeNode(CreateUserStmt);
n->user = $3;
n->sysid = $5;
n->sysid = $5;
n->password = $6;
n->createdb = $7 == +1 ? true : false;
n->createuser = $8 == +1 ? true : false;
n->createtable = $9 == +1 ? true : false;
n->locktable = $10 == +1 ? true : false;
n->groupElts = $11;
n->validUntil = $12;
n->groupElts = $9;
n->validUntil = $10;
$$ = (Node *)n;
}
;
...
...
@@ -516,32 +510,27 @@ CreateUserStmt: CREATE USER UserId user_createdb_clause user_createuser_clause
*
*****************************************************************************/
AlterUserStmt: ALTER USER UserId user_createdb_clause
user_createuser_clause
user_createtable_clause user_locktable
_clause user_valid_clause
AlterUserStmt: ALTER USER UserId user_createdb_clause
user_createuser
_clause user_valid_clause
{
AlterUserStmt *n = makeNode(AlterUserStmt);
n->user = $3;
n->password = NULL;
n->createdb = $4;
n->createuser = $5;
n->createtable = $6;
n->locktable = $7;
n->validUntil = $8;
n->validUntil = $6;
$$ = (Node *)n;
}
| ALTER USER UserId WITH PASSWORD Sconst
user_createdb_clause user_createuser_clause
user_createtable_clause user_locktable_clause
user_valid_clause
user_createdb_clause
user_createuser_clause user_valid_clause
{
AlterUserStmt *n = makeNode(AlterUserStmt);
n->user = $3;
n->password = $6;
n->createdb = $7;
n->createuser = $8;
n->createtable = $9;
n->locktable = $10;
n->validUntil = $11;
n->validUntil = $9;
$$ = (Node *)n;
}
;
...
...
@@ -584,22 +573,6 @@ user_createuser_clause: CREATEUSER { $$ = +1; }
| /*EMPTY*/ { $$ = 0; }
;
user_createtable_clause: CREATETABLE { $$ = +1; }
| NOCREATETABLE { $$ = -1; }
| /*EMPTY*/ {
/* EMPTY is default = CREATETABLE */
$$ = +1;
}
;
user_locktable_clause: LOCKTABLE { $$ = +1; }
| NOLOCKTABLE { $$ = -1; }
| /*EMPTY*/ {
/* EMPTY is default = LOCKTABLE */
$$ = +1;
}
;
user_list: user_list ',' UserId
{
$$ = lcons((void*)makeString($3), $1);
...
...
src/backend/parser/keywords.c
浏览文件 @
3357e1d2
...
...
@@ -9,9 +9,9 @@
*
* IDENTIFICATION
<<<<<<< keywords.c
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.7
5 2000/06/09 15:50:45
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.7
6 2000/06/12 03:40:30
momjian Exp $
=======
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.7
5 2000/06/09 15:50:45
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.7
6 2000/06/12 03:40:30
momjian Exp $
>>>>>>> 1.73
*
*-------------------------------------------------------------------------
...
...
@@ -75,7 +75,6 @@ static ScanKeyword ScanKeywords[] = {
{
"copy"
,
COPY
},
{
"create"
,
CREATE
},
{
"createdb"
,
CREATEDB
},
{
"createtable"
,
CREATETABLE
},
{
"createuser"
,
CREATEUSER
},
{
"cross"
,
CROSS
},
{
"current_date"
,
CURRENT_DATE
},
...
...
@@ -156,7 +155,6 @@ static ScanKeyword ScanKeywords[] = {
{
"local"
,
LOCAL
},
{
"location"
,
LOCATION
},
{
"lock"
,
LOCK_P
},
{
"locktable"
,
LOCKTABLE
},
{
"match"
,
MATCH
},
{
"maxvalue"
,
MAXVALUE
},
{
"minute"
,
MINUTE_P
},
...
...
@@ -172,9 +170,7 @@ static ScanKeyword ScanKeywords[] = {
{
"next"
,
NEXT
},
{
"no"
,
NO
},
{
"nocreatedb"
,
NOCREATEDB
},
{
"nocreatetable"
,
NOCREATETABLE
},
{
"nocreateuser"
,
NOCREATEUSER
},
{
"nolocktable"
,
NOLOCKTABLE
},
{
"none"
,
NONE
},
{
"not"
,
NOT
},
{
"nothing"
,
NOTHING
},
...
...
src/backend/tcop/pquery.c
浏览文件 @
3357e1d2
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.3
3 2000/06/09 15:50:46
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.3
4 2000/06/12 03:40:40
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -20,9 +20,6 @@
#include "executor/executor.h"
#include "tcop/pquery.h"
#include "utils/ps_status.h"
#include "catalog/pg_shadow.h"
#include "miscadmin.h"
#include "utils/syscache.h"
static
char
*
CreateOperationTag
(
int
operationType
);
static
void
ProcessQueryDesc
(
QueryDesc
*
queryDesc
,
Node
*
limoffset
,
...
...
@@ -253,23 +250,6 @@ ProcessQueryDesc(QueryDesc *queryDesc, Node *limoffset, Node *limcount)
else
if
(
parseTree
->
into
!=
NULL
)
{
/* select into table */
if
(
!
parseTree
->
isTemp
)
{
HeapTuple
tup
;
/* ----------
* Check pg_shadow for global createTable setting
* ----------
*/
tup
=
SearchSysCacheTuple
(
SHADOWNAME
,
PointerGetDatum
(
GetPgUserName
()),
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
tup
))
elog
(
ERROR
,
"ProcessQueryDesc: look at pg_shadow failed"
);
if
(
!
((
Form_pg_shadow
)
GETSTRUCT
(
tup
))
->
usecreatetable
)
elog
(
ERROR
,
"SELECT INTO TABLE: permission denied"
);
}
isRetrieveIntoRelation
=
true
;
}
...
...
src/bin/initdb/initdb.sh
浏览文件 @
3357e1d2
...
...
@@ -26,7 +26,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.9
5 2000/06/09 23:50:24
momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.9
6 2000/06/12 03:40:41
momjian Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -523,8 +523,6 @@ echo "CREATE VIEW pg_user AS \
usename,
\
usesysid,
\
usecreatedb,
\
usecreatetable,
\
uselocktable,
\
usetrace,
\
usesuper,
\
usecatupd,
\
...
...
src/bin/scripts/createuser
浏览文件 @
3357e1d2
...
...
@@ -8,7 +8,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.1
0 2000/06/09 15:50:53
momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.1
1 2000/06/12 03:40:49
momjian Exp $
#
# Note - this should NOT be setuid.
#
...
...
@@ -21,8 +21,6 @@ NewUser=
SysID
=
CanAddUser
=
CanCreateDb
=
CanCreateTab
=
CanLockTab
=
PwPrompt
=
Password
=
PSQLOPT
=
...
...
@@ -92,18 +90,6 @@ do
--no-createdb
|
-D
)
CanCreateDb
=
f
;;
--createtable
|
-t
)
CanCreateTab
=
t
;;
--no-createtable
|
-T
)
CanCreateTab
=
f
;;
--locktable
|
-l
)
CanLockTab
=
t
;;
--no-locktable
|
-L
)
CanLockTab
=
f
;;
--adduser
|
-a
)
CanAddUser
=
t
;;
...
...
@@ -143,10 +129,6 @@ if [ "$usage" ]; then
echo
"Options:"
echo
" -d, --createdb User can create new databases"
echo
" -D, --no-createdb User cannot create databases"
echo
" -t, --createtable User can create new tables"
echo
" -T, --no-createtable User cannot create tables"
echo
" -l, --locktable User can lock tables"
echo
" -L, --no-locktable User cannot lock tables"
echo
" -a, --adduser User can add new users"
echo
" -A, --no-adduser User cannot add new users"
echo
" -i, --sysid=SYSID Select sysid for new user"
...
...
@@ -222,27 +204,6 @@ if [ -z "$CanAddUser" ]; then
fi
fi
if
[
-z
"
$CanCreateTab
"
]
;
then
$ECHO_N
"Shall the new user be allowed to create tables? (y/n) "
$ECHO_C
read
REPLY
[
$?
-ne
0
]
&&
exit
1
if
[
$REPLY
=
"y"
-o
$REPLY
=
"Y"
]
;
then
CanCreateTab
=
t
else
CanCreateTab
=
f
fi
fi
if
[
-z
"
$CanLockTab
"
]
;
then
$ECHO_N
"Shall the new user be allowed to lock tables? (y/n) "
$ECHO_C
read
REPLY
[
$?
-ne
0
]
&&
exit
1
if
[
$REPLY
=
"y"
-o
$REPLY
=
"Y"
]
;
then
CanLockTab
=
t
else
CanLockTab
=
f
fi
fi
#
# build SQL command
...
...
@@ -261,11 +222,6 @@ SUBQUERY=
[
"
$CanCreateDb
"
=
f
]
&&
QUERY
=
"
$QUERY
NOCREATEDB"
[
"
$CanAddUser
"
=
t
]
&&
QUERY
=
"
$QUERY
CREATEUSER"
[
"
$CanAddUser
"
=
f
]
&&
QUERY
=
"
$QUERY
NOCREATEUSER"
[
"
$CanCreateTab
"
=
t
]
&&
QUERY
=
"
$QUERY
CREATETABLE"
[
"
$CanCreateTab
"
=
f
]
&&
QUERY
=
"
$QUERY
NOCREATETABLE"
[
"
$CanLockTab
"
=
t
]
&&
QUERY
=
"
$QUERY
LOCKTABLE"
[
"
$CanLockTab
"
=
f
]
&&
QUERY
=
"
$QUERY
NOLOCKTABLE"
${
PATHNAME
}
psql
-c
"
$QUERY
"
-d
template1
$PSQLOPT
if
[
$?
-ne
0
]
;
then
...
...
src/include/catalog/catversion.h
浏览文件 @
3357e1d2
...
...
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: catversion.h,v 1.2
8 2000/06/09 15:50:59
momjian Exp $
* $Id: catversion.h,v 1.2
9 2000/06/12 03:40:51
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 2000060
92
#define CATALOG_VERSION_NO 2000060
81
#endif
src/include/catalog/pg_attribute.h
浏览文件 @
3357e1d2
...
...
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_attribute.h,v 1.5
8 2000/06/09 15:51:00
momjian Exp $
* $Id: pg_attribute.h,v 1.5
9 2000/06/12 03:40:52
momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
...
...
@@ -336,14 +336,12 @@ DATA(insert OID = 0 ( 1255 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
*/
DATA
(
insert
OID
=
0
(
1260
usename
19
0
NAMEDATALEN
1
0
-
1
-
1
f
p
f
i
f
f
));
DATA
(
insert
OID
=
0
(
1260
usesysid
23
0
4
2
0
-
1
-
1
t
p
f
i
f
f
));
DATA
(
insert
OID
=
0
(
1260
usecreatedb
16
0
1
3
0
-
1
-
1
t
p
f
c
f
f
));
DATA
(
insert
OID
=
0
(
1260
usecreatetable
16
0
1
4
0
-
1
-
1
t
p
f
c
f
f
));
DATA
(
insert
OID
=
0
(
1260
uselocktable
16
0
1
5
0
-
1
-
1
t
p
f
c
f
f
));
DATA
(
insert
OID
=
0
(
1260
usetrace
16
0
1
6
0
-
1
-
1
t
p
f
c
f
f
));
DATA
(
insert
OID
=
0
(
1260
usesuper
16
0
1
7
0
-
1
-
1
t
p
f
c
f
f
));
DATA
(
insert
OID
=
0
(
1260
usecatupd
16
0
1
8
0
-
1
-
1
t
p
f
c
f
f
));
DATA
(
insert
OID
=
0
(
1260
passwd
25
0
-
1
9
0
-
1
-
1
f
p
f
i
f
f
));
DATA
(
insert
OID
=
0
(
1260
valuntil
702
0
4
10
0
-
1
-
1
t
p
f
i
f
f
));
DATA
(
insert
OID
=
0
(
1260
usecreatedb
16
0
1
3
0
-
1
-
1
t
p
f
c
f
f
));
DATA
(
insert
OID
=
0
(
1260
usetrace
16
0
1
4
0
-
1
-
1
t
p
f
c
f
f
));
DATA
(
insert
OID
=
0
(
1260
usesuper
16
0
1
5
0
-
1
-
1
t
p
f
c
f
f
));
DATA
(
insert
OID
=
0
(
1260
usecatupd
16
0
1
6
0
-
1
-
1
t
p
f
c
f
f
));
DATA
(
insert
OID
=
0
(
1260
passwd
25
0
-
1
7
0
-
1
-
1
f
p
f
i
f
f
));
DATA
(
insert
OID
=
0
(
1260
valuntil
702
0
4
8
0
-
1
-
1
t
p
f
i
f
f
));
DATA
(
insert
OID
=
0
(
1260
ctid
27
0
6
-
1
0
-
1
-
1
f
p
f
i
f
f
));
DATA
(
insert
OID
=
0
(
1260
oid
26
0
4
-
2
0
-
1
-
1
t
p
f
i
f
f
));
DATA
(
insert
OID
=
0
(
1260
xmin
28
0
4
-
3
0
-
1
-
1
t
p
f
i
f
f
));
...
...
src/include/catalog/pg_class.h
浏览文件 @
3357e1d2
...
...
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_class.h,v 1.3
6 2000/06/09 15:51:00
momjian Exp $
* $Id: pg_class.h,v 1.3
7 2000/06/12 03:40:53
momjian Exp $
*
* NOTES
* ``pg_relation'' is being replaced by ``pg_class''. currently
...
...
@@ -139,7 +139,7 @@ DATA(insert OID = 1255 ( pg_proc 81 PGUID 0 0 0 0 f f r 17 0 0 0 0 0 f f f _
DESCR
(
""
);
DATA
(
insert
OID
=
1259
(
pg_class
83
PGUID
0
0
0
0
f
f
r
20
0
0
0
0
0
f
f
f
_null_
));
DESCR
(
""
);
DATA
(
insert
OID
=
1260
(
pg_shadow
86
PGUID
0
0
0
0
f
t
r
10
0
0
0
0
0
f
f
f
_null_
));
DATA
(
insert
OID
=
1260
(
pg_shadow
86
PGUID
0
0
0
0
f
t
r
8
0
0
0
0
0
f
f
f
_null_
));
DESCR
(
""
);
DATA
(
insert
OID
=
1261
(
pg_group
87
PGUID
0
0
0
0
f
t
r
3
0
0
0
0
0
f
f
f
_null_
));
DESCR
(
""
);
...
...
src/include/catalog/pg_shadow.h
浏览文件 @
3357e1d2
...
...
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_shadow.h,v 1.
8 2000/06/09 15:51:00
momjian Exp $
* $Id: pg_shadow.h,v 1.
9 2000/06/12 03:40:54
momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
...
...
@@ -38,8 +38,6 @@ CATALOG(pg_shadow) BOOTSTRAP
NameData
usename
;
int4
usesysid
;
bool
usecreatedb
;
bool
usecreatetable
;
bool
uselocktable
;
bool
usetrace
;
bool
usesuper
;
bool
usecatupd
;
...
...
@@ -58,17 +56,15 @@ typedef FormData_pg_shadow *Form_pg_shadow;
* compiler constants for pg_shadow
* ----------------
*/
#define Natts_pg_shadow
10
#define Natts_pg_shadow
8
#define Anum_pg_shadow_usename 1
#define Anum_pg_shadow_usesysid 2
#define Anum_pg_shadow_usecreatedb 3
#define Anum_pg_shadow_usecreatetable 4
#define Anum_pg_shadow_uselocktable 5
#define Anum_pg_shadow_usetrace 6
#define Anum_pg_shadow_usesuper 7
#define Anum_pg_shadow_usecatupd 8
#define Anum_pg_shadow_passwd 9
#define Anum_pg_shadow_valuntil 10
#define Anum_pg_shadow_usetrace 4
#define Anum_pg_shadow_usesuper 5
#define Anum_pg_shadow_usecatupd 6
#define Anum_pg_shadow_passwd 7
#define Anum_pg_shadow_valuntil 8
/* ----------------
* initial contents of pg_shadow
...
...
@@ -77,6 +73,6 @@ typedef FormData_pg_shadow *Form_pg_shadow;
* user choices.
* ----------------
*/
DATA
(
insert
OID
=
0
(
POSTGRES
PGUID
t
t
t
t
t
t
_null_
_null_
));
DATA
(
insert
OID
=
0
(
POSTGRES
PGUID
t
t
t
t
_null_
_null_
));
#endif
/* PG_SHADOW_H */
src/include/nodes/parsenodes.h
浏览文件 @
3357e1d2
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parsenodes.h,v 1.10
7 2000/06/09 15:51:02
momjian Exp $
* $Id: parsenodes.h,v 1.10
8 2000/06/12 03:41:03
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -290,7 +290,7 @@ typedef struct DropPLangStmt
/* ----------------------
* Create/Alter/Drop User Statements
*
Create/Alter/Drop User Statements
* ----------------------
*/
typedef
struct
CreateUserStmt
...
...
@@ -301,8 +301,6 @@ typedef struct CreateUserStmt
int
sysid
;
/* PgSQL system id (-1 if don't care) */
bool
createdb
;
/* Can the user create databases? */
bool
createuser
;
/* Can this user create users? */
bool
createtable
;
/* Can this user create tables? */
bool
locktable
;
/* Can this user lock tables? */
List
*
groupElts
;
/* The groups the user is a member of */
char
*
validUntil
;
/* The time the login is valid until */
}
CreateUserStmt
;
...
...
@@ -314,8 +312,6 @@ typedef struct AlterUserStmt
char
*
password
;
/* PostgreSQL user password */
int
createdb
;
/* Can the user create databases? */
int
createuser
;
/* Can this user create users? */
bool
createtable
;
/* Can this user create tables? */
bool
locktable
;
/* Can this user lock tables? */
char
*
validUntil
;
/* The time the login is valid until */
}
AlterUserStmt
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录