Re: PostgreSQL DB in prod, test, debug

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: PostgreSQL DB in prod, test, debug
Дата
Msg-id 7304F877-D043-4395-867E-014F48EB71ED@yesql.se
обсуждение исходный текст
Ответ на PostgreSQL DB in prod, test, debug  (Simon Connah <simon.n.connah@protonmail.com>)
Ответы Re: PostgreSQL DB in prod, test, debug
Re: PostgreSQL DB in prod, test, debug
Список pgsql-general
> On 14 Feb 2024, at 10:59, Simon Connah <simon.n.connah@protonmail.com> wrote:

> This is probably a stupid question so I apologies in advance.

There is no such thing.

> What I think is the best way to do this is to do a pg_dump of the database (using the --schema-only flag) and then
loadit into a test only database that gets created at the start of the unit tests and destroyed at the end. The
automatedtests will insert, update, delete and select data to test if it all still works. 

If the source of truth for your schema is the database, then sure.  If the
source of truth is a .sql file in your source code repository then you should
use that.  In essence, create the test database identically to how you create
the production database to ensure that you are testing what you will run in
production.

--
Daniel Gustafsson




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

Предыдущее
От: Simon Connah
Дата:
Сообщение: PostgreSQL DB in prod, test, debug
Следующее
От: arun chirappurath
Дата:
Сообщение: Postgres pg_cron extension