Re: How to reference a composite type in schemas not "public"?

Поиск
Список
Период
Сортировка
От a
Тема Re: How to reference a composite type in schemas not "public"?
Дата
Msg-id tencent_267DD44937C39E114ACE5620@qq.com
обсуждение исходный текст
Ответ на Re: How to reference a composite type in schemas not "public"?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: How to reference a composite type in schemas not "public"?
Список pgsql-general
Sorry I was in the wrong db last time

TESTDB=# \dn
    架构模式列表
  名称   |  拥有者
---------+----------
 MjorTbl | postgres
 Rate    | postgres
 public  | postgres


------------------ Original ------------------
From:  "Adrian Klaver";<adrian.klaver@aklaver.com>;
Date:  Jun 14, 2018
To:  "a"<372660931@qq.com>; "pgsql-general"<pgsql-general@postgresql.org>;
Subject:  Re: How to reference a composite type in schemas not "public"?

On 06/13/2018 08:34 PM, a wrote:
> Hi I have created some composite type:
>
> create type "MjorTbl".mort as(
> adjfac    float8,
> tablename text,
> subtype   text,
> improv  float8,
> selfac    slfc
> );
>
> The schema is different from public, while I would like to create table
> using the composite type, it reports a error:
>
> create type "MjorTbl".decrmt as(
> nodecrmt  int4,
> mortality "MjorTbl"."mort"
> );
>
> ERROR:  type "MjorTbl.mort" does not exist
> SQL state: 42704

In psql what does \dn show?

>
> create type "MjorTbl".decrmt as(
> nodecrmt  int4,
> mortality mort
> );
>
> ERROR:  type "mort" does not exist
> SQL state: 42704
>
> How can I reference the created composite type correctly??
>
> Thanks
>
> Shore
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com

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

Предыдущее
От: Atul Kumar
Дата:
Сообщение: question on streaming replication
Следующее
От: Baji Shaik
Дата:
Сообщение: Question regarding pglogical decoding