about index_openr() function

Поиск
Список
Период
Сортировка
От Seung Hyun Jeong
Тема about index_openr() function
Дата
Msg-id 001701c17129$919a2240$15c65882@cs.man.ac.uk
обсуждение исходный текст
Список pgsql-hackers
Hi,

I am trying to access index structures outside PostgreSQL becuase I am
working with a home grown
query processor.
My stand-alone program will access index structures stored in PostgreSQL
database by using registered
user-defined functions to PostgreSQL server.
As the first step, I wrote a user-defined function for open a specified
index relation as follows:

Relation        open_gist(char *index_name)
{       /* .../src/backend/access/index/indexam.c */       return index_openr(index_name);
}

And register the function as follows:

CREATE FUNCTION open_gist(opaque)  RETURNS opaque  AS
'/usr/local/postgresql-7.1.3/src/backend/access/gist_ops/lib_gist.so.1.0'  LANGUAGE 'c';

Up to here, there has been no problem.
But, when I tried to open an index by using select statement, I got an error
message as follows:

test=# select open_gist("b3dix");
ERROR:  Attribute 'b3dix' not found
ERROR:  Attribute 'b3dix' not found

However, there is the index named "b3dix" in my database as follows:

test=# \di  List of relationsName  | Type  | Owner
-------+-------+--------b3dix | index | jeongs

Is there any one who knows what problem is?

One more question is about "opaque".
What is the usefulness of the data type in the PostgreSQL context?
And what do I need to specify for "void" return data type when I register a
user-defined function.
For example,

void close_gist(Relation index_relation);

CREATE FUNCTION close_gist(opaque)  RETURNS ?  AS
'/usr/local/postgresql-7.1.3/src/backend/access/gist_ops/lib_gist.so.1.0'  LANGUAGE 'c';

Thank you for reading this question.

Cheers.






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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: postgresql.conf
Следующее
От: Alex Avriette
Дата:
Сообщение: Re: Super Optimizing Postgres