From: | Thomas Hallgren <thhal(at)mailblocks(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Runtime accepting build discrepancies |
Date: | 2005-03-09 23:03:13 |
Message-ID: | 422F80B1.8080108@mailblocks.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane wrote:
>Why is PL/Java dependent on the internal representation of any
>particular datatype? Seems like this is a symptom of bad PL design
>more than anything else.
>
>
I didn't see any other way of doing it short of using string
conversions. That doesn't seem very optimal. Java's internal
representation of time is millisecs so I have code in place that looks
like this (t in this case is a TimeADT):
#ifdef HAVE_INT64_Time
mSecs = t / 1000; /* Convert to millisecs */
if(tzAdjust)
mSecs += Timestamp_getCurrentTimeZone() * 1000;/* Adjust from
local time to UTC */
#else
if(tzAdjust)
t += Timestamp_getCurrentTimeZone();/* Adjust from local time to
UTC */
t *= 1000.0; /* Convert to millisecs */
mSecs = (jlong)floor(t);
#endif
I'm of course interested in improving it. Especially if you consider
this bad PL design. What do you suggest I do instead?
>>The dynamic loader doesn't detect this and I bet there's a ton of
>>combinations that will link just fine but perhaps crash (badly) in
>>runtime. I would like to detect discrepancies like this during runtime
>>somehow. I feel that it's either that or stop providing pre-built
>>binaries altogether. I realize that I can't be the only one with this
>>problem. How is this normally handled?
>>
>>
>
>If you want you can look into pg_control to see how the database is
>set up.
>
>
That would cover this. Thanks (I'd still appreciate an alternative
suggestion on the above though).
Regards,
Thomas Hallgren
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2005-03-09 23:40:47 | Re: BUG #1528: Rows returned that should be excluded by WHERE clause |
Previous Message | Tom Lane | 2005-03-09 22:34:01 | Re: Functions and transactions |