Tom Lane wrote:
> Bruce Momjian <[EMAIL PROTECTED]> writes:
> > Tom Lane wrote:
> >> And tested? I didn't say that I thought elog would work in main.c.
> >> In fact I'm pretty certain it won't.
>
> > Compiles/regression tests pass.
>
> You need to test the cases that will produce elog output.
>
> > This is why I removed elog in the first place, because I thought it
> > wouldn't work up higher before the guc load, but you said it would use
> > the default. Are you saying it only works after guc is loaded?
>
> No, I specifically said it didn't need guc. But it does need palloc,
> which means MemoryContextInit() has to run first. I could see running
> find_my_exec immediately before InitializeGUCOptions() in PostmasterMain.
OK, I moved the find_my_exec calls to the locations you mentioned in
both postgres.c and postmaster.c and remove it from main.c. I tested
the elog and it worked.
--
Bruce Momjian | http://candle.pha.pa.us
[EMAIL PROTECTED] | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
? log
? config.log
? GNUmakefile
? config.status
? src/Makefile.global
? src/Makefile.custom
? src/log
? src/backend/postgres
? src/backend/catalog/postgres.bki
? src/backend/catalog/postgres.description
? src/backend/utils/mb/conversion_procs/conversion_create.sql
? src/backend/utils/mb/conversion_procs/ascii_and_mic/libascii_and_mic.so.0.0
? src/backend/utils/mb/conversion_procs/cyrillic_and_mic/libcyrillic_and_mic.so.0.0
? src/backend/utils/mb/conversion_procs/euc_cn_and_mic/libeuc_cn_and_mic.so.0.0
? src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/libeuc_jp_and_sjis.so.0.0
? src/backend/utils/mb/conversion_procs/euc_kr_and_mic/libeuc_kr_and_mic.so.0.0
? src/backend/utils/mb/conversion_procs/euc_tw_and_big5/libeuc_tw_and_big5.so.0.0
? src/backend/utils/mb/conversion_procs/latin2_and_win1250/liblatin2_and_win1250.so.0.0
? src/backend/utils/mb/conversion_procs/latin_and_mic/liblatin_and_mic.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_ascii/libutf8_and_ascii.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_big5/libutf8_and_big5.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/libutf8_and_cyrillic.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/libutf8_and_euc_cn.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/libutf8_and_euc_jp.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/libutf8_and_euc_kr.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/libutf8_and_euc_tw.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_gb18030/libutf8_and_gb18030.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_gbk/libutf8_and_gbk.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_iso8859/libutf8_and_iso8859.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/libutf8_and_iso8859_1.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_johab/libutf8_and_johab.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_sjis/libutf8_and_sjis.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_tcvn/libutf8_and_tcvn.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_uhc/libutf8_and_uhc.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_win1250/libutf8_and_win1250.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_win1256/libutf8_and_win1256.so.0.0
? src/backend/utils/mb/conversion_procs/utf8_and_win874/libutf8_and_win874.so.0.0
? src/bin/initdb/initdb
? src/bin/initlocation/initlocation
? src/bin/ipcclean/ipcclean
? src/bin/pg_config/pg_config
? src/bin/pg_controldata/pg_controldata
? src/bin/pg_ctl/pg_ctl
? src/bin/pg_dump/pg_dump
? src/bin/pg_dump/pg_restore
? src/bin/pg_dump/pg_dumpall
? src/bin/pg_resetxlog/pg_resetxlog
? src/bin/psql/psql
? src/bin/scripts/createdb
? src/bin/scripts/createlang
? src/bin/scripts/createuser
? src/bin/scripts/dropdb
? src/bin/scripts/droplang
? src/bin/scripts/dropuser
? src/bin/scripts/clusterdb
? src/bin/scripts/vacuumdb
? src/include/pg_config.h
? src/include/stamp-h
? src/interfaces/ecpg/compatlib/libecpg_compat.so.1.1
? src/interfaces/ecpg/ecpglib/libecpg.so.4.2
? src/interfaces/ecpg/pgtypeslib/libpgtypes.so.1.2
? src/interfaces/ecpg/preproc/ecpg
? src/interfaces/libpq/libpq.so.3.2
? src/pl/plperl/SPI.c
? src/pl/plperl/libplperl.so.0.0
? src/pl/plpgsql/src/libplpgsql.so.1.0
? src/pl/tcl/libpltcl.so.2.0
? src/pl/tcl/modules/pltcl_loadmod
? src/pl/tcl/modules/pltcl_delmod
? src/pl/tcl/modules/pltcl_listmod
? src/test/regress/pg_regress
? src/test/regress/log
? src/test/regress/results
? src/test/regress/expected/copy.out
? src/test/regress/expected/create_function_1.out
? src/test/regress/expected/create_function_2.out
? src/test/regress/expected/misc.out
? src/test/regress/expected/constraints.out
? src/test/regress/sql/copy.sql
? src/test/regress/sql/create_function_1.sql
? src/test/regress/sql/create_function_2.sql
? src/test/regress/sql/misc.sql
? src/test/regress/sql/constraints.sql
Index: src/backend/main/main.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/main/main.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -c -c -r1.79 -r1.80
*** src/backend/main/main.c 18 May 2004 20:27:24 -0000 1.79
--- src/backend/main/main.c 19 May 2004 18:58:44 -0000 1.80
***************
*** 13,19 ****
*
*
* IDENTIFICATION
! * $PostgreSQL: pgsql-server/src/backend/main/main.c,v 1.79 2004/05/18 20:27:24
momjian Exp $
*
*-------------------------------------------------------------------------
*/
--- 13,19 ----
*
*
* IDENTIFICATION
! * $PostgreSQL: pgsql-server/src/backend/main/main.c,v 1.80 2004/05/19 18:58:44
momjian Exp $
*
*-------------------------------------------------------------------------
*/
***************
*** 240,255 ****
}
#endif /* !WIN32 */
}
-
- if (find_my_exec(argv[0], my_exec_path) < 0)
- {
- fprintf(stderr,
- gettext("%s: could not locate my own executable path"),
- argv[0]);
- exit(1);
- }
-
- get_pkglib_path(my_exec_path, pkglib_path);
/*
* Now dispatch to one of PostmasterMain, PostgresMain, GucInfoMain,
--- 240,245 ----
Index: src/backend/postmaster/postmaster.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/postmaster/postmaster.c,v
retrieving revision 1.390
retrieving revision 1.391
diff -c -c -r1.390 -r1.391
*** src/backend/postmaster/postmaster.c 18 May 2004 20:27:25 -0000 1.390
--- src/backend/postmaster/postmaster.c 19 May 2004 18:58:44 -0000 1.391
***************
*** 37,43 ****
*
*
* IDENTIFICATION
! * $PostgreSQL: pgsql-server/src/backend/postmaster/postmaster.c,v 1.390
2004/05/18 20:27:25 momjian Exp $
*
* NOTES
*
--- 37,43 ----
*
*
* IDENTIFICATION
! * $PostgreSQL: pgsql-server/src/backend/postmaster/postmaster.c,v 1.391
2004/05/19 18:58:44 momjian Exp $
*
* NOTES
*
***************
*** 461,466 ****
--- 461,471 ----
IgnoreSystemIndexes(false);
+ if (find_my_exec(argv[0], my_exec_path) < 0)
+ elog(FATAL,
+ gettext("%s: could not locate my own executable path"),
+ argv[0]);
+
/*
* Options setup
*/
Index: src/backend/tcop/postgres.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/tcop/postgres.c,v
retrieving revision 1.409
retrieving revision 1.410
diff -c -c -r1.409 -r1.410
*** src/backend/tcop/postgres.c 18 May 2004 20:27:25 -0000 1.409
--- src/backend/tcop/postgres.c 19 May 2004 18:58:44 -0000 1.410
***************
*** 8,14 ****
*
*
* IDENTIFICATION
! * $PostgreSQL: pgsql-server/src/backend/tcop/postgres.c,v 1.409 2004/05/18
20:27:25 momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
--- 8,14 ----
*
*
* IDENTIFICATION
! * $PostgreSQL: pgsql-server/src/backend/tcop/postgres.c,v 1.410 2004/05/19
18:58:44 momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
***************
*** 2184,2189 ****
--- 2184,2196 ----
/* Set up reference point for stack depth checking */
stack_base_ptr = &stack_base;
+
+ if (find_my_exec(argv[0], my_exec_path) < 0)
+ elog(FATAL,
+ gettext("%s: could not locate my own executable path"),
+ argv[0]);
+
+ get_pkglib_path(my_exec_path, pkglib_path);
/*
* Set default values for command-line options.
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org