c-function returns multiple rows

Поиск
Список
Период
Сортировка
От Kirill Krasnosselov
Тема c-function returns multiple rows
Дата
Msg-id 3F45FF04.80700@digicol.de
обсуждение исходный текст
Ответы Re: c-function returns multiple rows  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: c-function returns multiple rows  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Hello, I have the following problem ( at PostgreSQL 7.3.3 on Red Hat Linux 7.1) with c-functions returning multiple
rows.

Here is a transcript of the test example:

//////////////////////////////////////////

#include <stdlib.h>
#include "postgres.h"
#include "fmgr.h"
#include "nodes/execnodes.h"


PG_FUNCTION_INFO_V1(dc_ftx);
Datum
dc_ftx(PG_FUNCTION_ARGS)
  { ReturnSetInfo* rsi = (ReturnSetInfo *)fcinfo->resultinfo;
    rsi->isDone = ExprEndResult;
    PG_RETURN_NULL();
  }


cd /dot/users/kirill/test_pg_functions
gcc -I/dot/dc4/postgres/postgresql-7.3.3/src/include/ -fpic -c dc_ftx.c
gcc -shared -o dc_ftx.so dc_ftx.o


psql mydb
mydb=# create function dc_ftx(int4) RETURNS SETOF INT4 as     '/dot/users/kirill/test_pg_functions/dc_ftx.so' language
'C';
CREATE

mydb=# select dc_ftx(10);

///////////////////////////////////////////

In my opinion this function call shall returns a empty table,
but this call does not end.
I suppose that (rsi->isDone = ExprEndResult) has no effect.

Please help me.

Kirill Krasnosselov




В списке pgsql-novice по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: one-to-one
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: c-function returns multiple rows