Re: question about relation_open - Mailing list pgsql-hackers

From Tom Lane
Subject Re: question about relation_open
Date
Msg-id 682102.1736865599@sss.pgh.pa.us
Whole thread Raw
In response to question about relation_open  (Giampaolo Capelli <giampow@gmail.com>)
Responses Re: question about relation_open
List pgsql-hackers
Giampaolo Capelli <giampow@gmail.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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Support --include-analyze in pg_dump, pg_dumpall, pg_restore
Next
From: "Zhou, Zhiguo"
Date:
Subject: Re: [RFC] Lock-free XLog Reservation from WAL