pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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 13:34:31 +0800
Message-ID: <tencent_267DD44937C39E114ACE5620@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>

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

view thread (6+ messages)  latest in thread

Message-ID: <tencent_267DD44937C39E114ACE5620@qq.com>
Permalink:  ../tencent_267DD44937C39E114ACE5620@qq.com/
Also on:    postgresql.org/message-id/tencent_267DD44937C39E114ACE5620@qq.com

 · 

reply

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_267DD44937C39E114ACE5620@qq.com>
  References: <tencent_4885304D0B7E99C9368F7703@qq.com> <6403e6bc-f943-021b-71ec-401f4b1761f4@aklaver.com> <tencent_267DD44937C39E114ACE5620@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