Clarification needed

Started by Indira Muthuswamyover 19 years ago7 messages
#1Indira Muthuswamy
indumuthu@gmail.com

Hai,

Can anyone of you help me in finding the datatype of a particular column in
a table in Postgres?

Thanks and Regards,
M.Indira

#2David Fetter
david@fetter.org
In reply to: Indira Muthuswamy (#1)
Re: [HACKERS] Clarification needed

On Wed, Oct 11, 2006 at 12:26:19PM +0530, Indira Muthuswamy wrote:

Hai,

Can anyone of you help me in finding the datatype of a particular
column in a table in Postgres?

Indira,

You'll want to look at the columns view in the information_schema.

http://www.postgresql.org/docs/current/static/information-schema.html

Cheers,
Dave.
--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

#3Zdenek Kotala
Zdenek.Kotala@Sun.COM
In reply to: Indira Muthuswamy (#1)
Re: Clarification needed

Look at http://www.postgresql.org/docs/8.1/interactive/catalogs.html

Specially on pg_attribute, pg_class and pg_type table. Or you can use
some features in the psql.

Zdenek

Indira Muthuswamy napsal(a):

Show quoted text

Hai,

Can anyone of you help me in finding the datatype of a particular column
in a table in Postgres?

Thanks and Regards,
M.Indira

#4Andrew Hammond
andrew.george.hammond@gmail.com
In reply to: Indira Muthuswamy (#1)
Re: Clarification needed

"Indira Muthuswamy" wrote:

Can anyone of you help me in finding the datatype of a particular column in
a table in Postgres?

Thanks and Regards,
M.Indira

You're almost in the right place, but you'd be better off asking this
question in the pgsql-general or perhaps pgsql-novice. This mailing
list is for talking about modifications to the actual database engine.

Drew

#5Dhanaraj M
Dhanaraj.M@Sun.COM
In reply to: Zdenek Kotala (#3)
Re: Clarification needed

In psql,
psql>\d tableName

Query is

SELECT pg_catalog.format_type(a.atttypid, a.atttypmod) from
pg_attribute a, pg_class c where a.attrelid =c.oid and
c.relname='TableName' and a.attname='ColName';

Zdenek Kotala wrote:

Show quoted text

Look at http://www.postgresql.org/docs/8.1/interactive/catalogs.html

Specially on pg_attribute, pg_class and pg_type table. Or you can use
some features in the psql.

Zdenek

Indira Muthuswamy napsal(a):

Hai,

Can anyone of you help me in finding the datatype of a particular
column in a table in Postgres?

Thanks and Regards,
M.Indira

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

#6Sreejesh O S
sreejeshos@gmail.com
In reply to: Dhanaraj M (#5)
Re: Clarification needed

you should use schemaname.tablename syntax if you are using schema

**

Show quoted text

On 10/11/06, Dhanaraj M <Dhanaraj.M@sun.com> wrote:

In psql,
psql>\d tableName

Query is

SELECT pg_catalog.format_type(a.atttypid, a.atttypmod) from
pg_attribute a, pg_class c where a.attrelid =c.oid and
c.relname='TableName' and a.attname='ColName';

Zdenek Kotala wrote:

Look at http://www.postgresql.org/docs/8.1/interactive/catalogs.html

Specially on pg_attribute, pg_class and pg_type table. Or you can use
some features in the psql.

Zdenek

Indira Muthuswamy napsal(a):

Hai,

Can anyone of you help me in finding the datatype of a particular
column in a table in Postgres?

Thanks and Regards,
M.Indira

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

#7Jim C. Nasby
jim@nasby.net
In reply to: Zdenek Kotala (#3)
Re: Clarification needed

See also information_schema and newsysviews on pgFoundry.
On Wed, Oct 11, 2006 at 10:15:22AM +0200, Zdenek Kotala wrote:

Look at http://www.postgresql.org/docs/8.1/interactive/catalogs.html

Specially on pg_attribute, pg_class and pg_type table. Or you can use
some features in the psql.

Zdenek

Indira Muthuswamy napsal(a):

Hai,

Can anyone of you help me in finding the datatype of a particular column
in a table in Postgres?

Thanks and Regards,
M.Indira

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

--
Jim Nasby jim@nasby.net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)