Re: [HACKERS] about EncodeDateTime() arguments

2012-03-13 Thread Tom Lane
Peter Eisentraut writes: > On lör, 2012-03-10 at 18:47 -0500, Tom Lane wrote: >> It appears to me that null-ness of tzp and tzn are used as a 3-way flag >> to identify the style of timezone output wanted (none, numeric, or alpha). > It's not quite a three-way flag, because it also depends on the

Re: [HACKERS] about EncodeDateTime() arguments

2012-03-13 Thread Peter Eisentraut
On lör, 2012-03-10 at 18:47 -0500, Tom Lane wrote: > > void EncodeDateTime(struct pg_tm * tm, fsec_t fsec, const int *tzp, const > > char *tzn, int style, char *str) > > It appears to me that null-ness of tzp and tzn are used as a 3-way flag > to identify the style of timezone output wanted (none

Re: [HACKERS] about EncodeDateTime() arguments

2012-03-10 Thread Tom Lane
Peter Eisentraut writes: > We currently have > void EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int > style, char *str) > but tzn isn't used anywhere, only *tzn is used everywhere. Wouldn't it > be clearer to remove that one level of indirection and instead have the > s

[HACKERS] about EncodeDateTime() arguments

2012-03-10 Thread Peter Eisentraut
We currently have void EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style, char *str) but tzn isn't used anywhere, only *tzn is used everywhere. Wouldn't it be clearer to remove that one level of indirection and instead have the signature be void EncodeDateTime(stru