Type Name / Internal name returned by pg_catalog.format_type with/without prepended schema name?

From: Glyn Astill <glynastill(at)yahoo(dot)co(dot)uk>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Type Name / Internal name returned by pg_catalog.format_type with/without prepended schema name?
Date: 2012-06-27 09:47:48
Message-ID: 1340790468.11679.YahooMailNeo@web171401.mail.ir2.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Guys,

I was wondering if anyone could shed some light with type names returned by pg_catalog.format_type sometimes having the schema name prepended, and sometimes not? I'm calling it like format_type(pg_type.oid, NULL) .

I'm using pg9.0, but I remember seeing this years ago on older versions too - I just can't remember what I did about it.

I've got two types that appear to have been created in the same way, except that pg_catalog.format_type returns the schema name for one, but not the other.  I can't reproduce this just by running the sql used to create the types now though.

CREATE TYPE website.block_selection AS
   (block character varying,
    description character varying,
    amount numeric,
    "left" integer,
    best integer,
    type integer,
    singles_only boolean);

CREATE TYPE website.buy_with_detail AS
   (price numeric,
    must_buy_with integer[],
    limit_type text,
    multiplier integer);

SEE=# \dT+ website.block_selection
                              List of data types
 Schema  |      Name       |  Internal name  | Size  | Elements | Description
---------+-----------------+-----------------+-------+----------+-------------
 website | block_selection | block_selection | tuple |          |

SEE=# \dT+ website.buy_with_detail
                                  List of data types
 Schema  |          Name           |  Internal name  | Size  | Elements | Description
---------+-------------------------+-----------------+-------+----------+-------------
 website | website.buy_with_detail | buy_with_detail | tuple |          |

Any ideas how this could have come about? All the types were created on 9.0, and I've tried with and without the website schema in the search path etc, but I'm sure I'm just missing something simple?

Thanks
Glyn

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-06-27 13:31:21 Re: Type Name / Internal name returned by pg_catalog.format_type with/without prepended schema name?
Previous Message Cody Cutrer 2012-06-27 04:41:49 Re: Initing a new replica