Possible problem with pg_get_viewdef on Postgres V8.0.0 rc4

Поиск
Список
Период
Сортировка
От laurie.burrow@powerconv.alstom.com
Тема Possible problem with pg_get_viewdef on Postgres V8.0.0 rc4
Дата
Msg-id OF67B9489C.5ADE56FE-ON80256F88.0044AAB6-80256F88.0046807A@transport.alstom.com
обсуждение исходный текст
Ответы Re: Possible problem with pg_get_viewdef on Postgres V8.0.0 rc4  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
I have a view  definition  that creates a view on both Postgres 7 and
Postgres 8. The view definition works OK in that it does not return an
error and the resulting view seems to operate correctly on both versions of
Postgres.

However Pgadmin 1.2.0 works fine with the Postgres 7 database containing
the view but fails with the same database created on Postgres 8.0.0.rc4.

The cause of the pgadmin failure appears to be a call to
pg_get_viewdef(c.oid, true) used by pgadmin to populate its view display.
This function applied to my view works correctly on Postgres 7 but
generates the error Bogus Varno: 3
in Postgres 8.

The original query definition (as generated by Pgadmin 1.2.0 from Postgres
7.4.2) causing the problem was:

CREATE OR REPLACE VIEW full_product_view AS
 SELECT slimprdmgrrspperid AS _prd_slimprdmgrrspperid_,
( SELECT (rspper.lstnme::text || ' '::text) || rspper.frstnme::text
           FROM rspper
          WHERE rspper.rspperid = slimprdmgrrspperid) AS
_prd_slimprdmgrrspperid_d,
prdid AS _prd_prdid_, slimprdnmgnnmeid AS _prd_slimprdnmgnnmeid_,
actvle AS _slimprdnmgnnmeid_gennme_actvle_, catnmeclssid AS
_slimprdnmgnnmeid_gennme_catnmeclssid_
   FROM prd
   JOIN gennme ON gennme.gennmeid = prd.slimprdnmgnnmeid;


AFAICT the pg_get_viewdef function called by pgadmin objects to the scalar
subselect in the above view defintion. Rewriting my view query to include
the table qualification on the scalar sub select cures the problem with
pg_get_viewdef(c.oid, true).

The rewritten query definition is:

CREATE OR REPLACE VIEW full_product_view AS
 SELECT slimprdmgrrspperid AS _prd_slimprdmgrrspperid_,
( SELECT (rspper.lstnme::text || ' '::text) || rspper.frstnme::text
           FROM rspper
          WHERE rspper.rspperid = prd.slimprdmgrrspperid) AS
_prd_slimprdmgrrspperid_d,
prdid AS _prd_prdid_, slimprdnmgnnmeid AS _prd_slimprdnmgnnmeid_,
actvle AS _slimprdnmgnnmeid_gennme_actvle_, catnmeclssid AS
_slimprdnmgnnmeid_gennme_catnmeclssid_
   FROM prd
   JOIN gennme ON gennme.gennmeid = prd.slimprdnmgnnmeid;

   I don't know if this behaviour is expected.

   Regards
   Laurie



   :.________________
   CONFIDENTIALITY : This  e-mail  and  any attachments are confidential
   and may be privileged. If  you are not a named recipient, please notify
   the sender immediately and do not disclose the contents to another
   person, use it for any purpose or store or copy the information in any
   medium.

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

Предыдущее
От: "Magnus Hagander"
Дата:
Сообщение: Re: rc4, PostgreSQL-installer on WinXP: ignores selected install-directory
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: character varying as boolean !!! help