Re: [PATCHES] initdb cleanup

2006-03-19 Thread Alvaro Herrera
Neil Conway wrote:
> On Sun, 2006-03-19 at 23:11 -0400, Alvaro Herrera wrote:
> > Here's a little cosmetic patch merging the loading of regular
> > descriptions with shared descriptions (just like the process of loading
> > regular dependencies was merged with shared dependencies).
> 
> Where's the patch?

Here:

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
Index: initdb.c
===
RCS file: /home/alvherre/cvs/pgsql/src/bin/initdb/initdb.c,v
retrieving revision 1.113
diff -c -r1.113 initdb.c
*** initdb.c5 Mar 2006 15:58:50 -   1.113
--- initdb.c20 Mar 2006 02:58:59 -
***
*** 178,184 
  static void setup_depend(void);
  static void setup_sysviews(void);
  static void setup_description(void);
- static void setup_shared_description(void);
  static void setup_conversion(void);
  static void setup_privileges(void);
  static void set_info_version(void);
--- 178,183 
***
*** 1725,1731 
  {
PG_CMD_DECL;
  
!   fputs(_("loading pg_description ... "), stdout);
fflush(stdout);
  
snprintf(cmd, sizeof(cmd),
--- 1724,1730 
  {
PG_CMD_DECL;
  
!   fputs(_("loading system objects' descriptions ... "), stdout);
fflush(stdout);
  
snprintf(cmd, sizeof(cmd),
***
*** 1749,1789 
"  FROM tmp_pg_description t, pg_class c "
"WHERE c.relname = t.classname;\n");
  
-   PG_CMD_CLOSE;
- 
-   check_ok();
- }
- 
- /*
-  * load shared description data
-  */
- static void
- setup_shared_description(void)
- {
-   PG_CMD_DECL;
- 
-   fputs(_("loading pg_shdescription ... "), stdout);
-   fflush(stdout);
- 
-   snprintf(cmd, sizeof(cmd),
-   "\"%s\" %s template1 >%s",
-   backend_exec, backend_options,
-   DEVNULL);
- 
-   PG_CMD_OPEN;
- 
PG_CMD_PUTS("CREATE TEMP TABLE tmp_pg_shdescription ( "
!   " objoid oid, "
!   " classname name, "
!   " description text) WITHOUT OIDS;\n");
  
PG_CMD_PRINTF1("COPY tmp_pg_shdescription FROM '%s';\n",
!   shdesc_file);
  
PG_CMD_PUTS("INSERT INTO pg_shdescription "
!   " SELECT t.objoid, c.oid, t.description "
!   "  FROM tmp_pg_shdescription t, pg_class c "
!   "   WHERE c.relname = t.classname;\n");
  
PG_CMD_CLOSE;
  
--- 1748,1765 
"  FROM tmp_pg_description t, pg_class c "
"WHERE c.relname = t.classname;\n");
  
PG_CMD_PUTS("CREATE TEMP TABLE tmp_pg_shdescription ( "
!   " objoid oid, "
!   " classname name, "
!   " description text) WITHOUT OIDS;\n");
  
PG_CMD_PRINTF1("COPY tmp_pg_shdescription FROM '%s';\n",
!  shdesc_file);
  
PG_CMD_PUTS("INSERT INTO pg_shdescription "
!   " SELECT t.objoid, c.oid, t.description "
!   "  FROM tmp_pg_shdescription t, pg_class c "
!   "   WHERE c.relname = t.classname;\n");
  
PG_CMD_CLOSE;
  
***
*** 2960,2967 
  
setup_description();
  
-   setup_shared_description();
- 
setup_conversion();
  
setup_privileges();
--- 2936,2941 

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [PATCHES] initdb cleanup

2006-03-19 Thread Neil Conway
On Sun, 2006-03-19 at 23:11 -0400, Alvaro Herrera wrote:
> Here's a little cosmetic patch merging the loading of regular
> descriptions with shared descriptions (just like the process of loading
> regular dependencies was merged with shared dependencies).

Where's the patch?

-Neil



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


[PATCHES] initdb cleanup

2006-03-19 Thread Alvaro Herrera
Here's a little cosmetic patch merging the loading of regular
descriptions with shared descriptions (just like the process of loading
regular dependencies was merged with shared dependencies).  This merges
both the code and the message emitted to the user.

Sample output:

[some stuff ...]
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok


I intend to apply it tomorrow.

-- 
Alvaro Herrerahttp://www.PlanetPostgreSQL.org
One man's impedance mismatch is another man's layer of abstraction.
(Lincoln Yeoh)

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly