describe working as intended?

Поиск
Список
Период
Сортировка
От Melanie Plageman
Тема describe working as intended?
Дата
Msg-id CAAKRu_Yo=ahEZ8sAaO3vEph0WrifjvG48Bp+6S0dtjCCxHJ5DQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: describe working as intended?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: describe working as intended?  (Sergei Kornilov <sk@zsrv.org>)
Список pgsql-hackers
So, I noticed that if I make a table in one schema and then a table with the
same name in another schema that describe only shows me one of them.
Demonstrating with temp table and regular table just for simplicity:
If I make a temp table t1 and a normal table t1 (it doesn't
matter which one I create first), describe only shows the temp table.

test=# create table t1();
CREATE TABLE
test=# \d
         List of relations
 Schema | Name | Type  |   Owner
--------+------+-------+-----------
 public | t1   | table | mplageman
(1 row)

test=# create temp table t1();
CREATE TABLE
test=# \d
          List of relations
  Schema   | Name | Type  |   Owner
-----------+------+-------+-----------
 pg_temp_4 | t1   | table | mplageman
(1 row)

I'm not sure if this is the intended behavior or if it is a bug.

I looked briefly at the describe code and ran the query in describeTableDetails
which it constructs at the beginning and this, of course, returns the results I
would expect.

test=# select c.oid, n.nspname, c.relname from pg_catalog.pg_class c left join
pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relname = 't1';
  oid  |  nspname  | relname
-------+-----------+---------
 23609 | public    | t1
 23612 | pg_temp_4 | t1
(2 rows)

So, without much more digging, is the current behavior of describe intended?
I couldn't find an email thread discussing this with the search terms I tried.

(I noticed it on master and checked 11 as well and got the same behavior.)

--
Melanie Plageman

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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Calling PrepareTempTablespaces in BufFileCreateTemp
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Is it safe to ignore the return value of SPI_finish and SPI_execute?