Re: [GENERAL] Returning a char from a C-language function

2010-04-21 Thread Tom Lane
"I. B." writes: > I have a small problem when trying to make a C-language function to return > one character. The code is very simple and that's what's making it so strange. > CREATE FUNCTION val(ibool) > RETURNS char You need to write "char", with the quotes. Without the quotes the type

[GENERAL] Returning a char from a C-language function

2010-04-21 Thread I. B.
I have a small problem when trying to make a C-language function to return one character. The code is very simple and that's what's making it so strange. Datum val_ibool(PG_FUNCTION_ARGS) { iBool *input = (iBool *) PG_GETARG_POINTER(0); PG_RETURN_CHAR(input->value); } input is a struct