[PostgreSQL]View定義の確認方法

pg_viewsを参照する。

select definition from pg_views where viewname = 'city_countries';
                                   definition
-----------------------------------------------------------------------
  SELECT cities.city_id,                                              +
     cities.city,                                                     +
     countries.country_id,                                            +
     countries.country                                                +
    FROM (cities                                                      +
      JOIN countries ON ((cities.country_id = countries.country_id)));
(1 row)

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です