Search Postgresql Archives

Re: Getting my Database name in a C Extension

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Cedric Berger <cedric@xxxxxxxxxxxxx> 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 there a way to get this information in the SQL extension
> installation/update scripts (like the @/extschema/@ substitution)?

Nope.  Doesn't seem to me like a remarkably good idea to refer to it
in that sort of way anyway.  What would happen if someone renamed
the database after the extension is installed?

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux