Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8cb041a

Browse files
committed
Set up the privileges on the default schemas in initdb with real GRANT
commands, to arrive at a valid and dumpable state.
1 parent 28efaf3 commit 8cb041a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/bin/initdb/initdb.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
2828
# Portions Copyright (c) 1994, Regents of the University of California
2929
#
30-
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.184 2003/02/19 23:41:15 momjian Exp $
30+
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.185 2003/03/19 16:08:59 petere Exp $
3131
#
3232
#-------------------------------------------------------------------------
3333

@@ -1035,6 +1035,8 @@ $ECHO_N "setting privileges on built-in objects... "$ECHO_C
10351035
WHERE proacl IS NULL;
10361036
UPDATE pg_language SET lanacl = '{"=U/$POSTGRES_SUPERUSERNAME"}' \
10371037
WHERE lanpltrusted;
1038+
GRANT USAGE ON SCHEMA pg_catalog TO PUBLIC;
1039+
GRANT CREATE, USAGE ON SCHEMA public TO PUBLIC;
10381040
EOF
10391041
) \
10401042
| "$PGPATH"/postgres $PGSQL_OPT template1 > /dev/null || exit_nicely

src/include/catalog/pg_namespace.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_namespace.h,v 1.8 2002/09/04 20:31:37 momjian Exp $
11+
* $Id: pg_namespace.h,v 1.9 2003/03/19 16:08:59 petere Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -66,14 +66,14 @@ typedef FormData_pg_namespace *Form_pg_namespace;
6666
* ---------------
6767
*/
6868

69-
DATA(insert OID = 11 ( "pg_catalog" PGUID "{=U}" ));
70-
DESCR("System catalog namespace");
69+
DATA(insert OID = 11 ( "pg_catalog" PGUID _null_ ));
70+
DESCR("System catalog schema");
7171
#define PG_CATALOG_NAMESPACE 11
72-
DATA(insert OID = 99 ( "pg_toast" PGUID "{=}" ));
73-
DESCR("Reserved namespace for TOAST tables");
72+
DATA(insert OID = 99 ( "pg_toast" PGUID _null_ ));
73+
DESCR("Reserved schema for TOAST tables");
7474
#define PG_TOAST_NAMESPACE 99
75-
DATA(insert OID = 2200 ( "public" PGUID "{=UC}" ));
76-
DESCR("Standard public namespace");
75+
DATA(insert OID = 2200 ( "public" PGUID _null_ ));
76+
DESCR("Standard public schema");
7777
#define PG_PUBLIC_NAMESPACE 2200
7878

7979

0 commit comments

Comments
 (0)