Thread: type of a field
Hello I want to know the type of a field in a table how can I khow it ? __________________________________________________ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com
on 5/2/02 3:48 AM, ameen78101@yahoo.com purportedly said: > Hello > I want to know the type of a field in a table > how can I khow it ? There are different ways. You can use pg_field_type(), or a Postgres function. It's all in the docs. RTFM. Keary Suska Esoteritech, Inc. "Leveraging Open Source for a better Internet"
Ameen, > I want to know the type of a field in a table > how can I khow it ? Way #1: 1. Log into to your database using the command line utility PSQL. 2. Type "\d <name of table>" Way #2: 1. Install phpPgAdmin database administration tool. 2. Examine the table using phpPgAdmin. -Josh
ameen eetemadi schrieb: > I want to know the type of a field in a table how can I khow it ? pg_fieldtype() or something like SELECT a.attname, format_type(a.atttypid, a.atttypmod) FROM pg_class c, pg_attribute a WHERE c.relname = '$tablename' AND a.attnum > 0 AND a.attrelid = c.oid ORDER BY a.attnum; ? Bye, Knut Sübert
Would pg_fieldname() and pg_fieldtype() also be an option? -----Original Message----- From: Josh Berkus [mailto:josh@agliodbs.com] Sent: Thursday, May 02, 2002 6:49 PM To: ameen eetemadi; pgsql-php@postgresql.org Subject: Re: [PHP] type of a field Ameen, > I want to know the type of a field in a table > how can I khow it ? Way #1: 1. Log into to your database using the command line utility PSQL. 2. Type "\d <name of table>" Way #2: 1. Install phpPgAdmin database administration tool. 2. Examine the table using phpPgAdmin. -Josh ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org