Dynamically discovering field names in PLPGSQL queries

From: "Oberpriller, Wade D(dot)" <oberpwd(at)nsc-msg01(dot)network(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Dynamically discovering field names in PLPGSQL queries
Date: 2001-08-20 21:44:13
Message-ID: A7E1C26945C8D211ADBF0008C709661A01D4126A@nsc-msg02.network.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is there a way to discover the names of the fields in a record from a SELECT
statement in PLPGSQL?

For example:

SELECT INTO REC * FROM mytable;

Is there a mechanism to determine what the "*" expanded to? or does a
programmer always have to know the layout of the table apriori?

Wade Oberpriller http://www.storagetek.com
Software Development Phone: (763) 424-1538
StorageTek: MRDC (800) 328-9108 ext. 1538
wade_oberpriller(at)storagetek(dot)com Fax: (763) 391-1095

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Randall Jonasz 2001-08-20 22:00:54 Re: A libpq++ question.
Previous Message Andrew Gould 2001-08-20 21:40:40 System tables showing in result from '\d'