pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Quick System Catalog Query Question
3+ messages / 2 participants
[nested] [flat]

* Quick System Catalog Query Question
@ 2004-03-29 21:51 Terry Hampton <thampton@limacorp.com>
  2004-03-29 22:12 ` Re: Quick System Catalog Query Question Manuel Sugawara <masm@fciencias.unam.mx>
  0 siblings, 1 reply; 3+ messages in thread

From: Terry Hampton @ 2004-03-29 21:51 UTC (permalink / raw)
  To: pgsql-admin



All,

select attname, atttypmod, atttypid  from pg_attribute where 
attrelid=3701787 and attnum > 0;

returns:

   attname   | atttypmod | atttypid
-------------+-----------+----------
  acct_name  |       132 |     1043
  grp               |        54 |     1043
  name           |       260 |     1043
  id                  |        54 |     1043
  proc_by        |        54 |     1043
  fldnames      |        -1 |       25
  flddata          |        -1 |       25

			
	I can't determine what SQL to which system catalog will associate
	"1043" to "varchar"   and  "25" to "text"


	many thanks for you help

		7.3.2  on Linux


			Terry





Terry L. Hampton
Project Manager
LimaCorp, LLC   www.limacorp.com
513.587.1874





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Quick System Catalog Query Question
  2004-03-29 21:51 Quick System Catalog Query Question Terry Hampton <thampton@limacorp.com>
@ 2004-03-29 22:12 ` Manuel Sugawara <masm@fciencias.unam.mx>
  2004-03-30 16:52   ` Re: Quick System Catalog Query Question Manuel Sugawara <masm@fciencias.unam.mx>
  0 siblings, 1 reply; 3+ messages in thread

From: Manuel Sugawara @ 2004-03-29 22:12 UTC (permalink / raw)
  To: Terry Hampton <thampton@limacorp.com>; +Cc: pgsql-admin

Terry Hampton <thampton@limacorp.com> writes:

> I can't determine what SQL to which system catalog will associate
> "1043" to "varchar" and "25" to "text"

pg_type where oid = 1043, ie:

SELECT * FROM pg_type WHERE oid = 1043;

Regards,
Manuel.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Quick System Catalog Query Question
  2004-03-29 21:51 Quick System Catalog Query Question Terry Hampton <thampton@limacorp.com>
  2004-03-29 22:12 ` Re: Quick System Catalog Query Question Manuel Sugawara <masm@fciencias.unam.mx>
@ 2004-03-30 16:52   ` Manuel Sugawara <masm@fciencias.unam.mx>
  0 siblings, 0 replies; 3+ messages in thread

From: Manuel Sugawara @ 2004-03-30 16:52 UTC (permalink / raw)
  To: Terry Hampton <thampton@limacorp.com>; +Cc: pgsql-admin

Terry Hampton <thampton@limacorp.com> writes:

> 	Manuel,
> 
> Many thanks for your quick reply.  When I
> enter:      SELECT * FROM pg_type where typname='varchar';
> 
>        I get:
> 
> typname | typowner | typlen | typprtlen | typbyval | typtype | typisdefined
> | typdelim | typrelid | typelem | typinput  | typoutput  | typreceive |
> typsend   | typalign | typstorage | typdefault
> 
> ---------+----------+--------+-----------+----------+---------+--------------+----------+----------+---------+-----------+------------+------------+------------+----------+------------+------------
>   varchar |        1 |     -1 |        -1 | f        | b       | t      | ,
> |        0 |       0 | varcharin | varcharout | varcharin  | varcharout | i
> | x          |
> 
> 
>   		
> I do not see "1043",  thus my original email.

OID, among others is a hidden column, you need to explicitly ask for
it in your query:

SELECT oid, * FROM pg_type WHERE typname='varchar'; 

> 
> I'm just now starting to work with OID's.    Does every row
> in the system catalogs have an OID?

Most of them.

> reference to another tablename.oid - to get the actual name, simply
> use the known OID from the first table as a lookup value into the
> second ( reference table ), to get the textual vlaue.  ?  Correct ?

Correct.

Regards,
Manuel.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-03-30 16:52 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-03-29 21:51 Quick System Catalog Query Question Terry Hampton <thampton@limacorp.com>
2004-03-29 22:12 ` Manuel Sugawara <masm@fciencias.unam.mx>
2004-03-30 16:52   ` Manuel Sugawara <masm@fciencias.unam.mx>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox