Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6a68f42

Browse files
committed
The heralded `Grand Unified Configuration scheme' (GUC)
That means you can now set your options in either or all of $PGDATA/configuration,some postmaster option (--enable-fsync=off), or set a SET command. The list ofoptions is in backend/utils/misc/guc.c, documentation will be written post haste.pg_options is gone, so is that pq_geqo config file. Also removed were backend -K,-Q, and -T options (no longer applicable, although -d0 does the same as -Q).Added to configure an --enable-syslog option.changed all callers from TPRINTF to elog(DEBUG)
1 parent5e4d554 commit6a68f42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2583
-3289
lines changed

‎src/backend/Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#
3535
#
3636
# IDENTIFICATION
37-
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.51 2000/05/30 16:36:14 momjian Exp $
37+
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.52 2000/05/31 00:28:13 petere Exp $
3838
#
3939
#-------------------------------------------------------------------------
4040

@@ -205,9 +205,7 @@ endif
205205
install-templates:$(TEMPLATEDIR)\
206206
global1.bki.source local1_template1.bki.source \
207207
global1.description local1_template1.description \
208-
libpq/pg_hba.conf.sample libpq/pg_ident.conf.sample \
209-
optimizer/geqo/pg_geqo.sample \
210-
pg_options.sample
208+
libpq/pg_hba.conf.sample libpq/pg_ident.conf.sample
211209
$(INSTALL) $(INSTLOPTS) global1.bki.source \
212210
$(TEMPLATEDIR)/global1.bki.source
213211
$(INSTALL) $(INSTLOPTS) global1.description \
@@ -220,10 +218,6 @@ install-templates: $(TEMPLATEDIR) \
220218
$(TEMPLATEDIR)/pg_hba.conf.sample
221219
$(INSTALL) $(INSTLOPTS) libpq/pg_ident.conf.sample \
222220
$(TEMPLATEDIR)/pg_ident.conf.sample
223-
$(INSTALL) $(INSTLOPTS) optimizer/geqo/pg_geqo.sample \
224-
$(TEMPLATEDIR)/pg_geqo.sample
225-
$(INSTALL) $(INSTLOPTS) pg_options.sample \
226-
$(TEMPLATEDIR)/pg_options.sample
227221

228222
install-headers: prebuildheaders$(SRCDIR)/include/config.h
229223
-@if [!-d$(HEADERDIR) ];then mkdir$(HEADERDIR);fi

‎src/backend/access/nbtree/nbtree.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.54 2000/04/12 17:14:49 momjian Exp $
15+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.55 2000/05/31 00:28:14 petere Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -25,11 +25,8 @@
2525
#include"catalog/index.h"
2626
#include"executor/executor.h"
2727
#include"miscadmin.h"
28-
29-
#ifdefBTREE_BUILD_STATS
30-
#defineShowExecutorStats pg_options[TRACE_EXECUTORSTATS]
31-
#endif
32-
28+
#include"tcop/tcopprot.h"
29+
#include"utils/guc.h"
3330

3431
boolBuildingBtree= false;/* see comment in btbuild() */
3532
boolFastBuild= true;/* use sort/build instead of insertion
@@ -96,9 +93,9 @@ btbuild(Relation heap,
9693
usefast= (FastBuild&&IsNormalProcessingMode());
9794

9895
#ifdefBTREE_BUILD_STATS
99-
if (ShowExecutorStats)
96+
if (Show_btree_build_stats)
10097
ResetUsage();
101-
#endif
98+
#endif/* BTREE_BUILD_STATS */
10299

103100
/* see if index is unique */
104101
isunique=IndexIsUniqueNoCache(RelationGetRelid(index));
@@ -287,13 +284,13 @@ btbuild(Relation heap,
287284
}
288285

289286
#ifdefBTREE_BUILD_STATS
290-
if (ShowExecutorStats)
287+
if (Show_btree_build_stats)
291288
{
292-
fprintf(stderr,"! BtreeBuild Stats:\n");
289+
fprintf(stderr,"BTREE BUILD STATS\n");
293290
ShowUsage();
294291
ResetUsage();
295292
}
296-
#endif
293+
#endif/* BTREE_BUILD_STATS */
297294

298295
/*
299296
* Since we just counted the tuples in the heap, we update its stats

‎src/backend/access/nbtree/nbtsort.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,19 @@
2828
* Portions Copyright (c) 1994, Regents of the University of California
2929
*
3030
* IDENTIFICATION
31-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.52 2000/04/12 17:14:49 momjian Exp $
31+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.53 2000/05/31 00:28:14 petere Exp $
3232
*
3333
*-------------------------------------------------------------------------
3434
*/
3535

3636
#include"postgres.h"
3737

3838
#include"access/nbtree.h"
39+
#include"tcop/tcopprot.h"
40+
#include"utils/guc.h"
3941
#include"utils/tuplesort.h"
4042

4143

42-
#ifdefBTREE_BUILD_STATS
43-
#defineShowExecutorStats pg_options[TRACE_EXECUTORSTATS]
44-
#endif
45-
4644
/*
4745
* turn on debugging output.
4846
*
@@ -136,13 +134,13 @@ void
136134
_bt_leafbuild(BTSpool*btspool)
137135
{
138136
#ifdefBTREE_BUILD_STATS
139-
if (ShowExecutorStats)
137+
if (Show_btree_build_stats)
140138
{
141-
fprintf(stderr,"! BtreeBuild (Spool)Stats:\n");
139+
fprintf(StatFp,"BTREE BUILD (Spool)STATISTICS\n");
142140
ShowUsage();
143141
ResetUsage();
144142
}
145-
#endif
143+
#endif/* BTREE_BUILD_STATS */
146144
tuplesort_performsort(btspool->sortstate);
147145

148146
_bt_load(btspool->index,btspool);

‎src/backend/bootstrap/bootstrap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.83 2000/05/30 04:24:35 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.84 2000/05/31 00:28:14 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -267,7 +267,7 @@ BootstrapMain(int argc, char *argv[])
267267
Noversion= true;
268268
break;
269269
case'F':
270-
disableFsync=true;
270+
enableFsync=false;
271271
break;
272272
case'Q':
273273
Quiet= true;

‎src/backend/commands/async.c

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.61 2000/05/28 17:55:54 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.62 2000/05/31 00:28:15 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -90,7 +90,7 @@
9090
#include"utils/fmgroids.h"
9191
#include"utils/ps_status.h"
9292
#include"utils/syscache.h"
93-
#include"utils/trace.h"
93+
9494

9595
/* stuff that we really ought not be touching directly :-( */
9696
externTransactionStateCurrentTransactionState;
@@ -128,6 +128,8 @@ static void NotifyMyFrontEnd(char *relname, int32 listenerPID);
128128
staticintAsyncExistsPendingNotify(char*relname);
129129
staticvoidClearPendingNotifies(void);
130130

131+
boolTrace_notify= false;
132+
131133

132134
/*
133135
*--------------------------------------------------------------
@@ -149,7 +151,8 @@ Async_Notify(char *relname)
149151
{
150152
char*notifyName;
151153

152-
TPRINTF(TRACE_NOTIFY,"Async_Notify: %s",relname);
154+
if (Trace_notify)
155+
elog(DEBUG,"Async_Notify: %s",relname);
153156

154157
if (!pendingNotifies)
155158
pendingNotifies=DLNewList();
@@ -202,7 +205,8 @@ Async_Listen(char *relname, int pid)
202205
intalreadyListener=0;
203206
TupleDesctupDesc;
204207

205-
TPRINTF(TRACE_NOTIFY,"Async_Listen: %s",relname);
208+
if (Trace_notify)
209+
elog(DEBUG,"Async_Listen: %s",relname);
206210

207211
lRel=heap_openr(ListenerRelationName,AccessExclusiveLock);
208212
tdesc=RelationGetDescr(lRel);
@@ -304,7 +308,8 @@ Async_Unlisten(char *relname, int pid)
304308
return;
305309
}
306310

307-
TPRINTF(TRACE_NOTIFY,"Async_Unlisten %s",relname);
311+
if (Trace_notify)
312+
elog(DEBUG,"Async_Unlisten %s",relname);
308313

309314
lRel=heap_openr(ListenerRelationName,AccessExclusiveLock);
310315
/* Note we assume there can be only one matching tuple. */
@@ -346,7 +351,8 @@ Async_UnlistenAll()
346351
HeapTuplelTuple;
347352
ScanKeyDatakey[1];
348353

349-
TPRINTF(TRACE_NOTIFY,"Async_UnlistenAll");
354+
if (Trace_notify)
355+
elog(DEBUG,"Async_UnlistenAll");
350356

351357
lRel=heap_openr(ListenerRelationName,AccessExclusiveLock);
352358
tdesc=RelationGetDescr(lRel);
@@ -452,7 +458,8 @@ AtCommit_Notify()
452458
return;
453459
}
454460

455-
TPRINTF(TRACE_NOTIFY,"AtCommit_Notify");
461+
if (Trace_notify)
462+
elog(DEBUG,"AtCommit_Notify");
456463

457464
lRel=heap_openr(ListenerRelationName,AccessExclusiveLock);
458465
tdesc=RelationGetDescr(lRel);
@@ -485,13 +492,16 @@ AtCommit_Notify()
485492
* be bad for applications that ignore self-notify
486493
* messages.
487494
*/
488-
TPRINTF(TRACE_NOTIFY,"AtCommit_Notify: notifying self");
495+
496+
if (Trace_notify)
497+
elog(DEBUG,"AtCommit_Notify: notifying self");
498+
489499
NotifyMyFrontEnd(relname,listenerPID);
490500
}
491501
else
492502
{
493-
TPRINTF(TRACE_NOTIFY,"AtCommit_Notify: notifying pid %d",
494-
listenerPID);
503+
if (Trace_notify)
504+
elog(DEBUG,"AtCommit_Notify: notifying pid %d",listenerPID);
495505

496506
/*
497507
* If someone has already notified this listener, we don't
@@ -551,7 +561,8 @@ AtCommit_Notify()
551561

552562
ClearPendingNotifies();
553563

554-
TPRINTF(TRACE_NOTIFY,"AtCommit_Notify: done");
564+
if (Trace_notify)
565+
elog(DEBUG,"AtCommit_Notify: done");
555566
}
556567

557568
/*
@@ -624,10 +635,13 @@ Async_NotifyHandler(SIGNAL_ARGS)
624635
if (notifyInterruptOccurred)
625636
{
626637
/* Here, it is finally safe to do stuff. */
627-
TPRINTF(TRACE_NOTIFY,
628-
"Async_NotifyHandler: perform async notify");
638+
if (Trace_notify)
639+
elog(DEBUG,"Async_NotifyHandler: perform async notify");
640+
629641
ProcessIncomingNotify();
630-
TPRINTF(TRACE_NOTIFY,"Async_NotifyHandler: done");
642+
643+
if (Trace_notify)
644+
elog(DEBUG,"Async_NotifyHandler: done");
631645
}
632646
}
633647
}
@@ -693,10 +707,13 @@ EnableNotifyInterrupt(void)
693707
notifyInterruptEnabled=0;
694708
if (notifyInterruptOccurred)
695709
{
696-
TPRINTF(TRACE_NOTIFY,
697-
"EnableNotifyInterrupt: perform async notify");
710+
if (Trace_notify)
711+
elog(DEBUG,"EnableNotifyInterrupt: perform async notify");
712+
698713
ProcessIncomingNotify();
699-
TPRINTF(TRACE_NOTIFY,"EnableNotifyInterrupt: done");
714+
715+
if (Trace_notify)
716+
elog(DEBUG,"EnableNotifyInterrupt: done");
700717
}
701718
}
702719
}
@@ -751,7 +768,9 @@ ProcessIncomingNotify(void)
751768
char*relname;
752769
int32sourcePID;
753770

754-
TPRINTF(TRACE_NOTIFY,"ProcessIncomingNotify");
771+
if (Trace_notify)
772+
elog(DEBUG,"ProcessIncomingNotify");
773+
755774
PS_SET_STATUS("async_notify");
756775

757776
notifyInterruptOccurred=0;
@@ -784,8 +803,11 @@ ProcessIncomingNotify(void)
784803
d=heap_getattr(lTuple,Anum_pg_listener_relname,tdesc,&isnull);
785804
relname= (char*)DatumGetPointer(d);
786805
/* Notify the frontend */
787-
TPRINTF(TRACE_NOTIFY,"ProcessIncomingNotify: received %s from %d",
806+
807+
if (Trace_notify)
808+
elog(DEBUG,"ProcessIncomingNotify: received %s from %d",
788809
relname, (int)sourcePID);
810+
789811
NotifyMyFrontEnd(relname,sourcePID);
790812
/* Rewrite the tuple with 0 in notification column */
791813
rTuple=heap_modifytuple(lTuple,lRel,value,nulls,repl);
@@ -820,7 +842,9 @@ ProcessIncomingNotify(void)
820842
pq_flush();
821843

822844
PS_SET_STATUS("idle");
823-
TPRINTF(TRACE_NOTIFY,"ProcessIncomingNotify: done");
845+
846+
if (Trace_notify)
847+
elog(DEBUG,"ProcessIncomingNotify: done");
824848
}
825849

826850
/* Send NOTIFY message to my front end. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp