Re: Database Oid from SPI - Mailing list pgsql-general

From Markus Schiltknecht
Subject Re: Database Oid from SPI
Date
Msg-id eaaapr$1bcf$2@news.hub.org
Whole thread Raw
In response to Database Oid from SPI  (Markus Schiltknecht <markus@bluegap.ch>)
Responses Re: Database Oid from SPI  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: Database Oid from SPI  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Whoops, sorry, there was another reason for the segfault. Using
MyProc->databaseId works. Is it the right way to do it, though?

Markus Schiltknecht wrote:
> Hi,
>
> how can I get the database name or OID of the current backend in a SPI
> function (in plain C)? I tried including storage/proc.h and accessing
> MyProc->databaseId, but that leads to a segfault :-(  (and seems like
> the wrong way to do it.)
>
> The SPI documentation didn't help.
>
> Thank you
>
> Markus

pgsql-general by date:

Previous
From: Markus Schiltknecht
Date:
Subject: Database Oid from SPI
Next
From: Alvaro Herrera
Date:
Subject: Re: Database Oid from SPI