Ran into a problem with the function manager when using a
function from a shared lib that returns a float. Sometimes
it would come back ok, other (most) times, it was trashed.

While looking thru fmgr.c, I noticed something that seems to
be the culprit, but would like a second opinion from someone else
that knows the fmgr code better.

In fmgr_c, the returnValue is a char* which is 4 bytes, but this
is very flaky when the return value is a float8 which is _8_ bytes.

My tests tell my this conversion/cast isn't right. Somethings I
lose the backend, other times I'll get gibberish back and once in a
while, it will actually work. Now, if I return a _pointer_ to a
float8, it works every time. This is a workaround, but I'd like to
find a way to have a function return a float8 without having to
palloc memory in that function.

Is this possible? Has anyone else ever successfully loaded in and
used a function that returns a float8?

Any help from a fmgr guru would be greatly appreciated...


Darren darrenk@insightdist.com

------------------------------

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedApr 10, '97 at 6:27p
activeApr 13, '97 at 5:40p
posts2
users2
websitepostgresql.org...
irc#postgresql

2 users in discussion

Darren King: 1 post Thomas Lockhart: 1 post

People

Translate

site design / logo © 2021 Grokbase