Search Postgresql Archives

Re: Information about columns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/6/22 Dario Teixeira <darioteixeira@xxxxxxxxx>:
>
> Hi,
>
> Is there some way to find out meta-information about the columns generated
> by any SELECT query?  If the SELECT returns values from a regular table or
> a view, I can use pg_class and pg_attribute to get the info I need:
>
> CREATE TABLE foobar (quant int);
> SELECT quant FROM foobar;
> SELECT attname, attnum FROM pg_attribute, pg_class WHERE attrelid=pg_class.oid AND relname='foobar';
>
> But what if the columns belong to a "virtual" table instead, as per the
> (silly) example below?
>
> SELECT 1, 2*quant FROM foobar;
>


you can do it on low level - look on functions

PQdescribePrepared
PQdescribePortal

regards
Pavel Stehule

> Thanks in advance for any help you might give me!
> Best regards,
> Dario Teixeira
>
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux