Re: How to Examine a view - Mailing list pgsql-general

From Ray Stell
Subject Re: How to Examine a view
Date
Msg-id 20060927202725.GA13313@cns.vt.edu
Whole thread Raw
In response to How to Examine a view  (info@axier.se)
List pgsql-general
is this what you mean?

testdb=# \d foo_view
           View "public.foo_view"
 Column |         Type          | Modifiers
--------+-----------------------+-----------
 x      | character varying(20) |
 stuff  | text                  |
 y      | character varying(20) |
View definition:
 SELECT a.x, (a.x::text || ' :'::text) || substr(b.y::text, 1, 10) AS stuff, b.y   FROM foo1 a, foo2 b;









On Mon, Sep 25, 2006 at 08:44:33AM -0700, info@axier.se wrote:
> I have setup a view consisting of two tables and some compound fields.
> Now I would like from the client perspective see what those compound
> fields actually are originally.
>
> Let's (for simplicity I have inlcuded only one table) say we have:
> CREATE OR REPLACE VIEW clientview AS
>  SELECT c.clientid, (c.orderer_name::text || ' :'::text) ||
> substr(c.occasion::text, 1, 10) AS "Order occasion", c.customerid
>    FROM client c
>
> Is it possible to query postgres to tell me what field names and field
> types "Order occasion" really consists of?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match

--

pgsql-general by date:

Previous
From: Casey Duncan
Date:
Subject: Re: postgress 8.1.4 deadlocking??
Next
From: Tom Lane
Date:
Subject: Re: Cumulative aggregate