I have a couple of more PostgreSQL C questions, about the following two
compiler warnings:
____________________________________________________
warning: ISO C90 forbids mixed declarations and code
This appears to be caused by the following statement:
text* rand_dev = PG_GETARG_TEXT_P(0);
in the following context
PG_FUNCTION_INFO_V1( y_somefunc );
Datum
y_somefunc ( PG_FUNCTION_ARGS )
{
if( PG_ARGISNULL(0) ||
PG_ARGISNULL(1) ||
PG_ARGISNULL(2) )
{
PG_RETURN_NULL();
}
text* rand_dev = PG_GETARG_TEXT_P(0);
...
Should I be concerned by this? What's the proper way to code this?
_________________________________________________________________________________
warning: passing argument 3 of 'GetAttributeByNum' from incompatible pointer type
...caused by the following:
bool isNull;
...
n = GetAttributeByNum( tup, 0, &isNull );
executor.h has:
/*
* prototypes from functions in execQual.c
*/
extern Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno,
bool *isNull);
I'm just not seeing what's wrong here...
--
Ron Peterson
https://www.yellowbank.com/