Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdffab0c

Browse files
committed
Remove unnecessary UPDATE commands to assign explicit ACLs to functions
and PL languages during initdb. The default permissions for these objectsare the same as what we were assigning anyway, so there is no need toexpend space in the catalogs on them. The space cost is particularlysignificant in pg_proc's indexes, which are bloated by about a factor of 2by the full-table update, and can never really recover the space.initdb not forced, since the change has no actual impact on behavior.
1 parentc580d94 commitdffab0c

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Portions Copyright (c) 1994, Regents of the University of California
4040
* Portions taken from FreeBSD.
4141
*
42-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.80 2005/04/1214:19:43 petere Exp $
42+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.81 2005/04/12 19:29:24 tgl Exp $
4343
*
4444
*-------------------------------------------------------------------------
4545
*/
@@ -1672,7 +1672,10 @@ setup_conversion(void)
16721672
/*
16731673
* Set up privileges
16741674
*
1675-
* We set most system catalogs and built-in functions as world-accessible.
1675+
* We mark most system catalogs as world-readable. We don't currently have
1676+
* to touch functions, languages, or databases, because their default
1677+
* permissions are OK.
1678+
*
16761679
* Some objects may require different permissions by default, so we
16771680
* make sure we don't overwrite privilege sets that have already been
16781681
* set (NOT NULL).
@@ -1687,12 +1690,6 @@ setup_privileges(void)
16871690
"UPDATE pg_class "
16881691
" SET relacl = '{\"=r/\\\\\"$POSTGRES_SUPERUSERNAME\\\\\"\"}' "
16891692
" WHERE relkind IN ('r', 'v', 'S') AND relacl IS NULL;\n",
1690-
"UPDATE pg_proc "
1691-
" SET proacl = '{\"=X/\\\\\"$POSTGRES_SUPERUSERNAME\\\\\"\"}' "
1692-
" WHERE proacl IS NULL;\n",
1693-
"UPDATE pg_language "
1694-
" SET lanacl = '{\"=U/\\\\\"$POSTGRES_SUPERUSERNAME\\\\\"\"}' "
1695-
" WHERE lanpltrusted;\n",
16961693
"GRANT USAGE ON SCHEMA pg_catalog TO PUBLIC;\n",
16971694
"GRANT CREATE, USAGE ON SCHEMA public TO PUBLIC;\n",
16981695
NULL

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp