Unix Technical Forum

field names

This is a discussion on field names within the pgsql Admins forums, part of the PostgreSQL category; --> I'd like to check field names for various tables in our code. Is there a system table that lists ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 01:44 AM
Jodi Kanter
 
Posts: n/a
Default field names

I'd like to check field names for various tables in our code. Is there a
system table that lists the field names of each table? ...some way to
query this information to run an error check?
Thanks
Jodi Kanter
--

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu <mailto:jkanter@virginia.edu100>




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 01:45 AM
Alvaro Herrera
 
Posts: n/a
Default Re: field names

On Thu, Apr 21, 2005 at 02:37:53PM -0400, Jodi Kanter wrote:
> I'd like to check field names for various tables in our code. Is there a
> system table that lists the field names of each table? ...some way to
> query this information to run an error check?


Yes, pg_attribute. Or you could check the information_schema. See the
docs on "system catalogs" in the Internals chapter.

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Escucha y olvidarás; ve y recordarás; haz y entenderás" (Confucio)

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 01:45 AM
Michael Fuhr
 
Posts: n/a
Default Re: field names

On Thu, Apr 21, 2005 at 02:37:53PM -0400, Jodi Kanter wrote:
>
> I'd like to check field names for various tables in our code. Is there a
> system table that lists the field names of each table? ...some way to
> query this information to run an error check?


See the "System Catalogs" and "The Information Schema" chapters in
the documentation (the latter in 7.4 and later).

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:21 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com