Re: Getting my Database name in a C Extension - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Getting my Database name in a C Extension
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17D55514@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to Re: Getting my Database name in a C Extension  (Cedric Berger <cedric@precidata.com>)
Responses Re: Getting my Database name in a C Extension  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-general
Cedric Berger wrote:
>>> 1) What is the easiest way to get that directly in C?
>>
>> The usual locution is "get_database_name(MyDatabaseId)".
> 
> Ok, but then how do I find "MyDatabaseId" in, say,
> a BeginForeignScan() or GetForeignRelSize() FDW callback?

It is a global, all you should have to do is
#include "miscadmin.h"

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: PostgreSQL Inheritance and column mapping
Next
From: Michael Paquier
Date:
Subject: Re: Getting my Database name in a C Extension