Re: Columns in views

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: chin <chinhw(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Columns in views
Date: 2002-09-04 01:05:25
Message-ID: 20020904110525.A22333@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I think if you check check the system tables you'll find there is a table
with the same name as the view which is empty. So you can get the
information the same way as you can for a normal table. This is how psql
shows the columns for a view.

On Thu, Aug 29, 2002 at 09:20:39PM -0700, chin wrote:
> Hi all,
> I am not able to find any system tables in postgresql that is holding
> the column defintion of a view. I found a workaround.
>
> Using ADO, I query that view. Example "select * from some_view limit
> 0". This effectively return a empty record set. Using the fields
> object in the returned recordset I would able to retrieve the name,
> datatype, size of field of the column.
>
> hope this would be useful to someone out there.
>
> regards,
> Chin
>
> chinhw(at)hotmail(dot)com (chin) wrote in message news:<f084530(dot)0208280338(dot)282b66b2(at)posting(dot)google(dot)com>...
> > Hi all,
> >
> > I understand it is possible to retrieved the column name defined in
> > a table. I need to retrieve the column returned by a view. Can it be
> > done? How can I do it?
> >
> > Thanks in advance.
> >
> > regards,
> > Chin
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2002-09-04 01:55:06 Re: Call closed: Almost happy ending (from "Data files became huge with no apparent reason" thread)
Previous Message John Gray 2002-09-03 23:31:55 Re: Where can I find more information of XML support in