Re: [HACKERS] Issue on C function that reads int2[] (using "int2vector")

2015-12-01 Thread Rodrigo Hjort
2015-11-30 0:39 GMT-02:00 Tom Lane: > Rodrigo Hjort writes: > > I created a custom C function with this signature: > > > CREATE FUNCTION calculate_hash(numbers int2[]) > > RETURNS int8 > > AS 'MODULE_PATHNAME', 'pg_calculate_hash' > > LANGUAGE C > > IMMUTABLE STRICT; > > > And here is the function

Re: [HACKERS] Issue on C function that reads int2[] (using "int2vector")

2015-11-29 Thread Tom Lane
Rodrigo Hjort writes: > I created a custom C function with this signature: > CREATE FUNCTION calculate_hash(numbers int2[]) > RETURNS int8 > AS 'MODULE_PATHNAME', 'pg_calculate_hash' > LANGUAGE C > IMMUTABLE STRICT; > And here is the function source code (inspired in codes I found in > src/backe

[HACKERS] Issue on C function that reads int2[] (using "int2vector")

2015-11-29 Thread Rodrigo Hjort
Hello PG Hackers, I created a custom C function with this signature: CREATE FUNCTION calculate_hash(numbers int2[]) RETURNS int8 AS 'MODULE_PATHNAME', 'pg_calculate_hash' LANGUAGE C IMMUTABLE STRICT; And here is the function source code (inspired in codes I found in src/backend/utils/adt/int.c