> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
>
> "Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> > PGPORT environment variable is ignored again.
> > PostPortName seems to be reset in ResetAllOptions().
>
> Think you want to complain to Peter, not me. I haven't been touching
> any options-handling code...
>
Seems you have changed the position of ResetAllOptions() as follows.
@@ -378,15 +378,38 @@
*/
umask((mode_t) 0077);
- ResetAllOptions();
-
MyProcPid = getpid();
+
+ /*
+ * Fire up essential subsystems: error and memory management
+ */
+ EnableExceptionHandling(true);
+ MemoryContextInit();
+
+ /*
+ * By default, palloc() requests in the postmaster will be allocated
+ * in the PostmasterContext, which is space that can be recycled by
+ * backends. Allocated data that needs to be available to backends
+ * should be allocated in TopMemoryContext.
+ */
+ PostmasterContext = AllocSetContextCreate(TopMemoryContext,
+ "Postmaster",
+ ALLOCSET_DEFAULT_MINSIZE,
+ ALLOCSET_DEFAULT_INITSIZE,
+ ALLOCSET_DEFAULT_MAXSIZE);
+ MemoryContextSwitchTo(PostmasterContext);
+
+ /*
+ * Options setup
+ */
if (getenv("PGDATA"))
DataDir = strdup(getenv("PGDATA")); /* default value */
if (getenv("PGPORT"))
PostPortName = atoi(getenv("PGPORT"));
+ ResetAllOptions();
+