c function return not recognized?

Поиск
Список
Период
Сортировка
От Frank Miles
Тема c function return not recognized?
Дата
Msg-id Pine.OSF.4.10.9912112108340.20779-100000@saul7.u.washington.edu
обсуждение исходный текст
Ответы Re: [GENERAL] c function return not recognized?
Large objects + JDBC
Список pgsql-general
I've got an external  C function that I call from a SELECT, for example:

select * from <table> where <cond1> and CFunction(columnName) > 1.0;

The 'CFunction' has been installed into Postgreql using CREATE FUNCTION,
with a single 'text' argument, and returning a float8 (i.e. double).
I can tell that the 'CFunction' is getting called with the correct
argument, because it can be compiled to echo its activities to a file.
Also, if I rewrite the second condition (for example, leaving out the
'>' sign), psql complains that the function returns a float8, not a
boolean value.

The problem is that Postgresql seems to treat the latter condition
as an "fail always".  I can compile the function to return a constant,
say for example, 1.0.  Without the second condition, I always get the
expected set of results.  With the second condition, no results are
returned regardless of the sense of the comparison: >, <, =, <> all
return nothing.

I would appreciate it if someone could help me be able to use an
externally compiled function that returns a result.

TIA!

    -frank




В списке pgsql-general по дате отправления:

Предыдущее
От: David Sauer
Дата:
Сообщение: Re: [GENERAL] Czech Win1250 sorting q
Следующее
От: "Gene Selkov Jr."
Дата:
Сообщение: Re: [GENERAL] c function return not recognized?