Re: Function structure in formatting.c - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: Function structure in formatting.c
Date
Msg-id 37ed240d0708081943w607a96e9y71f891de12f7c1e3@mail.gmail.com
Whole thread Raw
In response to Re: Function structure in formatting.c  ("Brendan Jurd" <direvus@gmail.com>)
Responses Re: Function structure in formatting.c  ("Jaime Casanova" <systemguards@gmail.com>)
List pgsql-hackers
Just quick update on this.  It turns out (as it always does) that I
want to refactor a bit more intensively than I first suggested.

The functions dch_global, dch_time and dch_date seem to be wholly
pointless, since dch_global is effectively a one-liner for the FX
flag, and the other two merely wrap around a giant switch statement.

My thought was to split DCH_processor into a to_char flavour and a
from_char flavour, and have those functions do all the work; loop
through each of the FormatNodes and run the giant switch statement.

This means there is no need to put pointers to "action functions" in
each of the KeyWords.  It makes the code simpler, more readable -- and
considerably shorter.

A patch will be on the way shortly.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Unexpected VACUUM FULL failure
Next
From: Tom Lane
Date:
Subject: Re: Unexpected VACUUM FULL failure