Re: [GENERAL] Getting my Database name in a C Extension

2014-10-03 Thread Cedric Berger
On 03/10/14 10:23, Michael Paquier wrote: On Fri, Oct 3, 2014 at 4:57 PM, Albe Laurenz mailto:laurenz.a...@wien.gv.at>> wrote: > 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 th

Re: [GENERAL] Getting my Database name in a C Extension

2014-10-03 Thread Michael Paquier
On Fri, Oct 3, 2014 at 4:57 PM, Albe Laurenz wrote: > 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 GetForeignRelSi

Re: [GENERAL] Getting my Database name in a C Extension

2014-10-03 Thread Albe Laurenz
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 d

Re: [GENERAL] Getting my Database name in a C Extension

2014-10-03 Thread Cedric Berger
On 02/10/14 18:13, Tom Lane wrote: Cedric Berger writes: 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? http://www.

Re: [GENERAL] Getting my Database name in a C Extension

2014-10-02 Thread John R Pierce
On 10/2/2014 8:11 AM, Cedric Berger wrote: I'm writing an extention (FDW), and I need, in my C code, the name of my database ("contrib_regression_test" for example), and I've two questions: 1) What is the easiest way to get that directly in C? 2) Is there a way to get this information in the SQ

[GENERAL] Getting my Database name in a C Extension

2014-10-02 Thread Cedric Berger
Hi, I'm writing an extention (FDW), and I need, in my C code, the name of my database ("contrib_regression_test" for example), and I've two questions: 1) What is the easiest way to get that directly in C? 2) Is there a way to get this information in the SQL extension installation/update scripts

Re: [GENERAL] Getting my Database name in a C Extension

2014-10-02 Thread Tom Lane
Cedric Berger writes: > I'm writing an extention (FDW), and I need, in my C code, the name of > my database ("contrib_regression_test" for example), and I've two > questions: > 1) What is the easiest way to get that directly in C? The usual locution is "get_database_name(MyDatabaseId)". > 2) Is

[GENERAL] Getting my Database name in a C Extension

2014-10-02 Thread Cedric Berger
Hi, I'm writing an extention (FDW), and I need, in my C code, the name of my database ("contrib_regression_test" for example), and I've two questions: 1) What is the easiest way to get that directly in C? 2) Is there a way to get this information in the SQL extension installation/update scripts