Re: PSQL Should \sv & \ev work with materialized views?

Поиск
Список
Период
Сортировка
От Erik Wienhold
Тема Re: PSQL Should \sv & \ev work with materialized views?
Дата
Msg-id ac4eoj5gcqxocgz66xlwfpqol7a5ln72kw7nk3yg544mig6ti4@emu5rtiomnz6
обсуждение исходный текст
Ответ на PSQL Should \sv & \ev work with materialized views?  (Kirk Wolak <wolakk@gmail.com>)
Ответы Re: PSQL Should \sv & \ev work with materialized views?  (Erik Wienhold <ewie@ewie.name>)
Список pgsql-hackers
On 2023-05-15 06:32 +0200, Kirk Wolak wrote:
> Personally I would appreciate it if \sv actually showed you the DDL.
> Oftentimes I will \ev something to review it, with syntax highlighting.

+1.  I was just reviewing some matviews and was surprised that psql
lacks commands to show their definitions.

But I think that it should be separate commands \sm and \em because we
already have commands \dm and \dv that distinguish between matviews and
views.

> This should not be that difficult.  Just looking for feedback.
> Admittedly \e is questionable, because you cannot really apply the changes.
> ALTHOUGH, I would consider that I could
> BEGIN;
> DROP MATERIALIZED VIEW ...;
> CREATE MATERIALIZED VIEW ...;
> 
> Which I had to do to change the WITH DATA so it creates with data when we
> reload our object.s

I think this could even be handled by optional modifiers, e.g. \em emits
CREATE MATERIALIZED VIEW ... WITH NO DATA and \emD emits WITH DATA.
Although I wouldn't mind manually changing WITH NO DATA to WITH DATA.

-- 
Erik



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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: [PoC] Federated Authn/z with OAUTHBEARER
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: [HACKERS] make async slave to wait for lsn to be replayed