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