Re: PostgreSQL 9.0.3 cannot choose the best candidate function with type casts
От | Tom Lane |
---|---|
Тема | Re: PostgreSQL 9.0.3 cannot choose the best candidate function with type casts |
Дата | |
Msg-id | 29912.1301929998@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | PostgreSQL 9.0.3 cannot choose the best candidate function with type casts (<slapo@centrum.sk>) |
Ответы |
Re: PostgreSQL 9.0.3 cannot choose the best candidate function with type casts
|
Список | pgsql-novice |
<slapo@centrum.sk> writes: > I have a query in which I'm using a function called fx_get_parcel() like this: > SELECT fx_get_parcel(cast('cash' AS varchar), cast(rs_i.d_depot AS varchar)) FROM... > Without the type casts, Postgres complains that I have to add them. Complains how exactly? > When I add them, the query fails and I get this hint: > HINT: Could not choose a best candidate function. You might need to add explicit type casts. > The function has two versions: > fx_get_parcel(character varying, character varying) > and > fx_get_parcel(character varying, character varying, integer) I'll bet a good lunch that there are additional functions named fx_get_parcel that you've forgotten are present. Either that, or the three-argument form has a default value specified for the integer parameter, which makes the call simply ambiguous. I wouldn't expect the literal-constant argument to need explicit casting in any case. If rs_i.d_depot is of a non-string datatype (integer for instance), you probably would need an explicit cast here to make it into a string. However, you wouldn't get the above error message from that. regards, tom lane
В списке pgsql-novice по дате отправления: