Magnus Hagander <mag...@hagander.net> writes:
> Here goes.

Looks much saner.  One minor stylistic gripe:

+Datum
+pg_stat_reset_single_table(PG_FUNCTION_ARGS)
+{
+       pgstat_reset_single_counter(PG_GETARG_OID(0), RESET_TABLE);
+
+       PG_RETURN_VOID();
+}

I don't like sticking PG_GETARG calls inline in the body of a V1-protocol
function, even in trivial cases like this.  I think better style is

        Oid     taboid = PG_GETARG_OID(0);

        pgstat_reset_single_counter(taboid, RESET_TABLE);

This approach associates a clear name and type with each argument,
thereby helping to buy back some of the readability we lose by not
being able to use regular C function declarations.  When we designed
the V1 call protocol, I had hoped we might someday have scripts that
would crosscheck such declarations against the pg_proc contents, and
I still haven't entirely given up that idea ...

                        regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to