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

Skip to content

Commit c4826cf

Browse files
committed
Merge the loading of shared object descriptions with regular descriptions,
both in code and in the messages emitted to the user.
1 parent af00c04 commit c4826cf

File tree

1 file changed

+9
-35
lines changed

1 file changed

+9
-35
lines changed

src/bin/initdb/initdb.c

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1994, Regents of the University of California
4343
* Portions taken from FreeBSD.
4444
*
45-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.113 2006/03/05 15:58:50 momjian Exp $
45+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.114 2006/03/21 17:54:28 alvherre Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -178,7 +178,6 @@ static void unlimit_systables(void);
178178
static void setup_depend(void);
179179
static void setup_sysviews(void);
180180
static void setup_description(void);
181-
static void setup_shared_description(void);
182181
static void setup_conversion(void);
183182
static void setup_privileges(void);
184183
static void set_info_version(void);
@@ -1725,7 +1724,7 @@ setup_description(void)
17251724
{
17261725
PG_CMD_DECL;
17271726

1728-
fputs(_("loading pg_description ... "), stdout);
1727+
fputs(_("loading system objects' descriptions ... "), stdout);
17291728
fflush(stdout);
17301729

17311730
snprintf(cmd, sizeof(cmd),
@@ -1749,41 +1748,18 @@ setup_description(void)
17491748
" FROM tmp_pg_description t, pg_class c "
17501749
" WHERE c.relname = t.classname;\n");
17511750

1752-
PG_CMD_CLOSE;
1753-
1754-
check_ok();
1755-
}
1756-
1757-
/*
1758-
* load shared description data
1759-
*/
1760-
static void
1761-
setup_shared_description(void)
1762-
{
1763-
PG_CMD_DECL;
1764-
1765-
fputs(_("loading pg_shdescription ... "), stdout);
1766-
fflush(stdout);
1767-
1768-
snprintf(cmd, sizeof(cmd),
1769-
"\"%s\" %s template1 >%s",
1770-
backend_exec, backend_options,
1771-
DEVNULL);
1772-
1773-
PG_CMD_OPEN;
1774-
17751751
PG_CMD_PUTS("CREATE TEMP TABLE tmp_pg_shdescription ( "
1776-
" objoid oid, "
1777-
" classname name, "
1778-
" description text) WITHOUT OIDS;\n");
1752+
" objoid oid, "
1753+
" classname name, "
1754+
" description text) WITHOUT OIDS;\n");
17791755

17801756
PG_CMD_PRINTF1("COPY tmp_pg_shdescription FROM '%s';\n",
1781-
shdesc_file);
1757+
shdesc_file);
17821758

17831759
PG_CMD_PUTS("INSERT INTO pg_shdescription "
1784-
" SELECT t.objoid, c.oid, t.description "
1785-
" FROM tmp_pg_shdescription t, pg_class c "
1786-
" WHERE c.relname = t.classname;\n");
1760+
" SELECT t.objoid, c.oid, t.description "
1761+
" FROM tmp_pg_shdescription t, pg_class c "
1762+
" WHERE c.relname = t.classname;\n");
17871763

17881764
PG_CMD_CLOSE;
17891765

@@ -2960,8 +2936,6 @@ main(int argc, char *argv[])
29602936

29612937
setup_description();
29622938

2963-
setup_shared_description();
2964-
29652939
setup_conversion();
29662940

29672941
setup_privileges();

0 commit comments

Comments
 (0)