Tom Lane wrote:
Ron Mayer <[EMAIL PROTECTED]> writes:
Once this settles I suppose I should post a ECPG patch that's based
off of these Decode/Encode interval functions too?

Yeah, if you want.  I think you'll find that the datetime code has
drifted far enough since ecpg forked it that you'll be looking at a
pretty huge diff :-(

Merging of the interval style into ecpg attached.

I blindly copy&pasted code from src/backend/utils/adt/datetime.c
into src/interfaces/ecpg/pgtypeslib/interval.c and made the minimal
changes (pg_tm -> tm; adding constants; etc) to make the regression
tests pass; and mentioned that in the comments.

I know little enough about ecpg that I can't really tell if these changes
are for the better or worse.

One thing in the patch that's probably a bug is that the
constants in src/include/utils/dt.h and src/include/utils/datetime.h
under the section "Fields for time decoding" seem not to match, so
when I copied some constants from datetime.h to dt.h to make it compile
the values I copied are probably wrong.   Unfortunately I know little
about ecpg or the history of dt.h to know what the right values should
be.


Attachment: ecpg_interval-c.patch.gz
Description: GNU Zip compressed data

-- 
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