From: | Giampaolo Capelli <giampow(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | question about relation_open |
Date: | 2025-01-13 21:47:35 |
Message-ID: | CAJ=H7uyBuUTsc0xmkJhuNA+X8LDYzM__nkm+ZvRfsReNjsbF4Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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)
From | Date | Subject | |
---|---|---|---|
Next Message | Dean Rasheed | 2025-01-13 21:53:22 | Re: [PATCH] Add get_bytes() and set_bytes() functions |
Previous Message | Melanie Plageman | 2025-01-13 21:46:47 | Re: Eagerly scan all-visible pages to amortize aggressive vacuum |