From: Chris Travers <chris@travelamericas.com>
To: Ashok Chauhan <ashok@kalculate.com>
To: pgsql-admin@postgresql.org
Subject: Re: data type
Date: Wed, 31 Dec 2003 19:31:29 +0700
Message-ID: <00c201c3cf9a$0acf8030$3f285e3d@winxp> (raw)
References: <1072889593.14188.19.camel@delta.greatindianproducts.com>
Hi Ashok;
Check the documentation on the system catalogs. You can look up types
there, etc. using joins from the system catalogs.
Something like
SELECT typname FROM pg_types WHERE oid IN (SELECT atttypid FROM pg_attribute
WHERE attname = 'column_name' AND attrelid = (SELECT oid FROM pg_class WHERE
relname = 'table_name'));
Of course that is just off the top of my head, so don't count on it working.
Check the developers' docs for the system catalog documentation.
Best Wishes,
Chris Traver
----- Original Message -----
From: "Ashok Chauhan" <ashok@kalculate.com>
To: <pgsql-admin@postgresql.org>
Sent: Wednesday, December 31, 2003 11:53 PM
Subject: [ADMIN] data type
> hello
>
> how i recognize the data type of any field
> except \d table_name;
>
> there is a function of libpq library for recognize field type
> but it returns a number not a name of the data type so how i know the
> name with the help of this number.
>
> recv_interger_number = PQftype(resultant_pointer,field_number);
>
> And this number is same in all versions of postgresql.
> suppose:-
> in version 7.2 1043 for character & 1083 for varchar so
> in version 7.3 is same or not.
>
> Because my requirement is the data type name in string form not in
> number's form.
>
> plz. help me
> thanks
> Ashok
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: chris@travelamericas.com, ashok@kalculate.com
Subject: Re: data type
In-Reply-To: <00c201c3cf9a$0acf8030$3f285e3d@winxp>
References: <1072889593.14188.19.camel@delta.greatindianproducts.com> <00c201c3cf9a$0acf8030$3f285e3d@winxp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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