Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

quotes around text

Status
Not open for further replies.

MrTom

Programmer
Mar 13, 2001
383
GB
i have a function which takes type text as input.

when i try to call the function with

select myfunc('test');

it says

Function 'myfunc(unknown)' does not exist

why does is not know that 'test' is a string? am i using the wrong quotes or what?

as a sanity check, doing

select myfunc(4);

tells me

Function 'myfunc(int4)' does not exist

which is what i'd expect.
 
hmmm.... my function had upper case characters in it's name, like "myFunc".

doing a \df showed that it was called "myfunc" (without the upper case) and trying to call the function as "myfunc('text')" or "myFunc('text')" failed.

i guess maybe pg wanted some "'s around the function name " "myFunc"('text') " but it was giving me the wrong error mesg.

i didn't test this as i just put the whole function name in lower case and that worked.
 
If case sensitivity is your problem, then you need to do this:

"myFunc"('test')

not

"myFunc('test')"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top