Re: How can I get metadate of a table in PHP3?

From: knut(dot)suebert(at)web(dot)de
To: "pgsql-php(at)postgresql(dot)org" <pgsql-php(at)postgresql(dot)org>
Subject: Re: How can I get metadate of a table in PHP3?
Date: 2002-09-02 19:44:13
Message-ID: 20020902194412.GA657@fraxinus.reticulum
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Zhidian Du schrieb:

> How can I get metadate of a table in PHP3?

If you think about things like the output of "\d tablename", turn on
the logging of queries, do a "\d tablename" and watch the
logfiles.

Somewhere I need the fieldtypes of a table named $this->table, the
query is

$q = "SELECT a.attname, format_type(a.atttypid, a.atttypmod)
FROM pg_class c, pg_attribute a
WHERE c.relname = '".$this->table."'
AND a.attnum > 0 AND a.attrelid = c.oid
ORDER BY a.attnum";

which is stolen from the logs - I'll never understand it ;)

Greetings,
Knut Sübert

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message scott.marlowe 2002-09-03 17:04:29 Re: How can I get metadate of a table in PHP3?
Previous Message Christopher Kings-Lynne 2002-09-02 05:03:16 Re: How to start PgSQL on FreeBSd to the port 5432