Re: question about relation_open

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: giampow(at)gmail(dot)com
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: question about relation_open
Date: 2025-01-14 14:39:59
Message-ID: 682102.1736865599@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Giampaolo Capelli <giampow(at)gmail(dot)com> writes:
> 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;

Hmm, I'm a little bit doubting your statement that relation_open
succeeded. I wonder if maybe you built your extension without asserts
enabled ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhou, Zhiguo 2025-01-14 14:49:47 Re: [RFC] Lock-free XLog Reservation from WAL
Previous Message Tom Lane 2025-01-14 14:32:19 Re: Support --include-analyze in pg_dump, pg_dumpall, pg_restore