|
37 | 37 | * |
38 | 38 | * |
39 | 39 | * IDENTIFICATION |
40 | | - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.321 2003/05/03 05:13:18 momjian Exp $ |
| 40 | + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.322 2003/05/06 23:34:55 momjian Exp $ |
41 | 41 | * |
42 | 42 | * NOTES |
43 | 43 | * |
|
97 | 97 | #include"nodes/nodes.h" |
98 | 98 | #include"storage/fd.h" |
99 | 99 | #include"storage/ipc.h" |
| 100 | +#include"storage/pg_shmem.h" |
100 | 101 | #include"storage/pmsignal.h" |
101 | 102 | #include"storage/proc.h" |
102 | 103 | #include"access/xlog.h" |
@@ -2214,6 +2215,9 @@ BackendFinalize(Port *port) |
2214 | 2215 | intac; |
2215 | 2216 | chardebugbuf[32]; |
2216 | 2217 | charprotobuf[32]; |
| 2218 | +#ifdefEXEC_BACKEND |
| 2219 | +charpbuf[NAMEDATALEN+256]; |
| 2220 | +#endif |
2217 | 2221 | inti; |
2218 | 2222 | intstatus; |
2219 | 2223 | structtimevalnow; |
@@ -2434,8 +2438,14 @@ BackendFinalize(Port *port) |
2434 | 2438 | * database to use. -p marks the end of secure switches. |
2435 | 2439 | */ |
2436 | 2440 | av[ac++]="-p"; |
| 2441 | +#ifdefEXEC_BACKEND |
| 2442 | +Assert(UsedShmemSegID!=0); |
| 2443 | +/* database name at the end because it might contain commas */ |
| 2444 | +snprintf(pbuf,NAMEDATALEN+256,"%d,%d,%s",port->sock,UsedShmemSegID,port->database_name); |
| 2445 | +av[ac++]=pbuf; |
| 2446 | +#else |
2437 | 2447 | av[ac++]=port->database_name; |
2438 | | - |
| 2448 | +#endif |
2439 | 2449 | /* |
2440 | 2450 | * Pass the (insecure) option switches from the connection request. |
2441 | 2451 | * (It's OK to mangle port->cmdline_options now.) |
@@ -2712,6 +2722,9 @@ SSDataBase(int xlop) |
2712 | 2722 | intac=0; |
2713 | 2723 | charnbbuf[32]; |
2714 | 2724 | charxlbuf[32]; |
| 2725 | +#ifdefEXEC_BACKEND |
| 2726 | +charpbuf[NAMEDATALEN+256]; |
| 2727 | +#endif |
2715 | 2728 |
|
2716 | 2729 | #ifdefLINUX_PROFILE |
2717 | 2730 | setitimer(ITIMER_PROF,&prof_itimer,NULL); |
@@ -2762,7 +2775,14 @@ SSDataBase(int xlop) |
2762 | 2775 | av[ac++]=xlbuf; |
2763 | 2776 |
|
2764 | 2777 | av[ac++]="-p"; |
| 2778 | +#ifdefEXEC_BACKEND |
| 2779 | +Assert(UsedShmemSegID!=0); |
| 2780 | +/* database name at the end because it might contain commas */ |
| 2781 | +snprintf(pbuf,NAMEDATALEN+256,"%d,%s",UsedShmemSegID,"template1"); |
| 2782 | +av[ac++]=pbuf; |
| 2783 | +#else |
2765 | 2784 | av[ac++]="template1"; |
| 2785 | +#endif |
2766 | 2786 |
|
2767 | 2787 | av[ac]= (char*)NULL; |
2768 | 2788 |
|
|