Passing current_database to BackgroundWorkerInitializeConnection

Поиск
Список
Период
Сортировка
От Jeremy Finzel
Тема Passing current_database to BackgroundWorkerInitializeConnection
Дата
Msg-id CAMa1XUi-c1rkCu2jv26txF31KaRU39ypUPvPe_LNEBBpsC3CEg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Passing current_database to BackgroundWorkerInitializeConnection  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
I am having trouble figuring out the right way to do this, clearly missing something obvious.  I am simply trying to pass the current database to BackgroundWorkerInitializeConnection, but MyDatabaseId is showing as 0, and I am getting this error in the running of function get_database_name here at the top:

ERROR:  invalid cache ID: 21

char       *database_name = get_database_name(MyDatabaseId);

/*
...
*/

    /* Connect to our database */
    BackgroundWorkerInitializeConnection(database_name, NULL);


Any direction would be much appreciated.  I have tried to look at example uses of MyDatabaseId and not sure what I'm missing here.

Thanks,
Jeremy

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Parallel safety of binary_upgrade_create_empty_extension
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Passing current_database to BackgroundWorkerInitializeConnection