On 21.09.2012 17:58, md@rpzdesign.com wrote:
> During the execution of ProcessUtility() function in
> /src/backend/xxx/utility.c,
>
> the CreateStmt node type is processed to create a table.
>
> Is there a global function in the context of the backend process that
> will deliver what the current database and schema names?
There's a global variable MyDatabaseId for the database the backend is
connected to. It doesn't change after login.
There's no such thing as a "current schema", but I think you'll want to
take a look at src/backend/catalog/namespace.c, which handles the
search_path. There's a variable activeCreationNamespace there; look at
the functions in namespace.c to see how it works.
- Heikki