Re: [GENERAL] Stats Collector
От | Christopher Kings-Lynne |
---|---|
Тема | Re: [GENERAL] Stats Collector |
Дата | |
Msg-id | GNELIHDDFBOCMGBFGEFOGEGCCDAA.chriskl@familyhealth.com.au обсуждение исходный текст |
Ответы |
Re: [GENERAL] Stats Collector
|
Список | pgsql-hackers |
> Looks to me, someone forgot something. That would be me and now I > remember that I originally wanted to add some utility command for that. > > What you need in the meantime is a little C function that calls > > void pgstat_reset_counters(void); > > I might find the time tomorrow to write one for you if you don't know > how. Is this the kind of thing you mean? #include "postgres.h" #include "fmgr.h" extern Datum pg_reset_stats(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(pg_reset_stats); Datum pg_reset_stats(PG_FUNCTION_ARGS) { void pgstat_reset_counters(void); PG_RETURN_VOID(); } With this code I get this: test=# select pg_reset_stats(); ERROR: Unable to look up type id 0 I'm creating it like this: create or replace function pg_reset_stats() returns opaque as '/home/chriskl/local/lib/postgresql/pg_reset_stats.so' language 'C'; Is it something to do with the return type being declared wrongly? Hmm...the manual indicates that opaque functions cannot be called directly - so what the heck do I do? Also, where would I put this function in the main postgres source and how would I modify initdb? Chris
В списке pgsql-hackers по дате отправления: