Re: psql: add \si, \sm, \st and \sr functions to show CREATE commands for indexes, matviews, triggers and tables

From: a(dot)pervushina(at)postgrespro(dot)ru
To: Anna Akenteva <a(dot)akenteva(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql: add \si, \sm, \st and \sr functions to show CREATE commands for indexes, matviews, triggers and tables
Date: 2020-08-17 23:54:00
Message-ID: 64ea914ae88f31e9b316ef2a05c3e62c@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Anna Akenteva wrote 2020-08-11 13:37:
> About the patch:
>
> 1) There is some code duplication for the exec_command_[sm|si|st|sr]
> functions. Plus, it seems weird to separate sm (show matview) from sv
> (show view). Perhaps it would be more convenient to combine some of
> the code? Maybe by editing the already-existing exec_command_sf_sv()
> function.

I've combined most of the functions into one, as the code was mostly
duplicated. Had to change the argument from is_func to object type,
because the number of values has increased. I've attached a patch with
those changes.

Attachment Content-Type Size
si_st_sm_sr_v2.patch text/x-diff 34.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-08-17 23:54:13 Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits
Previous Message Mark Wong 2020-08-17 23:30:07 Re: doc examples for pghandler