Re: Template for schema? (as opposed to databases)

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Template for schema? (as opposed to databases)
Дата
Msg-id CAKFQuwZi4LnmC4XzABS7GiWkx-dVrNf=YzZiPwZq3gb_B1YGGQ@mail.gmail.com
обсуждение исходный текст
Ответ на Template for schema? (as opposed to databases)  (Dominique Devienne <ddevienne@gmail.com>)
Ответы Re: Template for schema? (as opposed to databases)
Список pgsql-general
On Tuesday, January 11, 2022, Dominique Devienne <ddevienne@gmail.com> wrote:
This means the template-schema name is part of the DDL for the schema, and a clone would need to use its own search-path, not the original.

This is your major limitation.  You are required to create new objects from code and cannot leverage any kind of copy of existing objects.  Unless the test database need only be three schemas always - then the schema can be identical because you can place them into different databases.
 
Please do note this needs to be done from a libpq client, which has no direct access to the server (i.e. cannot use dump/restore solutions).

PQexec and put the entire script into a single string.  That seems like the fastest possible way to create new objects (see the first point).

Beyond that there is too little detail to provide suggestions.  I would observe that for testing the meaningful values of N are 1 and 2.  Having a setup where N = 5 is not materially different than the N = 2 case (usually).

David J.

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

Предыдущее
От: Dominique Devienne
Дата:
Сообщение: Template for schema? (as opposed to databases)
Следующее
От: Francisco Olarte
Дата:
Сообщение: Re: Template for schema? (as opposed to databases)