From: a <372660931@qq.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: How to reference a composite type in schemas not "public"?
Date: Thu, 14 Jun 2018 12:55:44 +0800
Message-ID: <tencent_2DAEB0E168EE3B6B75C3F9DD@qq.com> (raw)
In-Reply-To: <6403e6bc-f943-021b-71ec-401f4b1761f4@aklaver.com>
References: <tencent_4885304D0B7E99C9368F7703@qq.com>
<6403e6bc-f943-021b-71ec-401f4b1761f4@aklaver.com>
Hey thank you~
postgres=# \dn
架构模式列表
名称 | 拥有者
---------+----------
pgagent | postgres
public | postgres
(2 行记录)
------------------ Original ------------------
From: "Adrian Klaver";
Date: Thursday, Jun 14, 2018 12:06 PM
To: "a"<372660931@qq.com>; "pgsql-general";
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: 372660931@qq.com, adrian.klaver@aklaver.com
Subject: Re: How to reference a composite type in schemas not "public"?
In-Reply-To: <tencent_2DAEB0E168EE3B6B75C3F9DD@qq.com>
References: <tencent_4885304D0B7E99C9368F7703@qq.com> <6403e6bc-f943-021b-71ec-401f4b1761f4@aklaver.com> <tencent_2DAEB0E168EE3B6B75C3F9DD@qq.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox