Re: how to use schema with data type

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: johnf(at)jfcomputer(dot)com
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: how to use schema with data type
Date: 2012-06-13 02:39:33
Message-ID: 4FD7FD65.70909@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 06/13/2012 08:46 AM, John Fabiani wrote:
> I have tried to use a user defined data type I created within a schema.
> But I could not figure it out.
>
> CREATE OR REPLACE FUNCTION xchromasun._chromasun_totals(date)
> RETURNS SETOF xchromasun.weekly_mpr AS
>
> CREATE OR REPLACE FUNCTION xchromasun._chromasun_totals(date)
> RETURNS SETOF "xchromasun.weekly_mpr" AS
>
> I had to move the user defined data type to "public".
>
> Could someone explain how I might get that done - that is use a schema
> data type from a function.

What exactly couldn't you work out?

How was it going wrong, and when? What error messges did you get?

The first form looks reasonable to me, though I haven't tested. If you
need to quote the schema for caps reasons, you'd use:

"xchromasun"."weekly_mpr"

--
Craig Ringer

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleas Mantzios 2012-06-14 08:39:35 Insane behaviour in 8.3.3
Previous Message Craig Ringer 2012-06-13 02:37:49 Re: Partitioned Tables