question about relation_open

Поиск
Список
Период
Сортировка
От Giampaolo Capelli
Тема question about relation_open
Дата
Msg-id CAJ=H7uyBuUTsc0xmkJhuNA+X8LDYzM__nkm+ZvRfsReNjsbF4Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: question about relation_open
Re: question about relation_open
Список pgsql-hackers
Hi there,
I'm trying to write an extension to study the internals of Postgresql, and I face a server crash after calling the function relation_open.

I want to call the function ReadBufferExtended
to get the raw data of a given buffer
and I've read in some examples that I need to call relation_open
first, in order to get a Relation variable and also lock the relation.

The function relation_open returns a non NULL pointer in my extension, but then the last line in the following snippet crashes postgres.

Relation rel;
rel = relation_open(relid, AccessShareLock);

Assert(rel != NULL);
Assert(rel->rd_rel != NULL);
Assert(rel->rd_id != NULL);
elog(INFO, "rel->rd_id not null");
Oid rd_id = rel->rd_id;


Could somebody please help me understand what I'm doing wrong?
(Sorry if this is not the correct mailing list)

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