pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: knut.suebert@web.de
To: pgsql-php@postgresql.org
Subject: how to get the field types of a(n empty) table?
Date: Sat, 20 Oct 2001 19:59:03 +0200
Message-ID: <20011020195903.A8147@cascal.vtb> (raw)

Hello,

is there a possibility to get the field types of an empty table?

I made a class for editing tables in a html form. The data is inserted
or updated by something like

  "update $table set $row='$DATA'::$ftype[$row] where oid=$oid"

The type of the fields is gotten by a "select $rows from $table limit
1" -- but this is only possible, if there is at least one row inside a
table (for an "insert", "update" is no problem, of course).

It should be possible by reading something out of the postgres' system
tables, but I didn't found it.

Thank in advance,
Knut Sübert



view thread (3+ messages)  latest in thread

Message-ID: <20011020195903.A8147@cascal.vtb>
Permalink:  ../20011020195903.A8147@cascal.vtb/
Also on:    postgresql.org/message-id/20011020195903.A8147@cascal.vtb

 · 

reply

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-php@postgresql.org
  Cc: knut.suebert@web.de
  Subject: Re: how to get the field types of a(n empty) table?
  In-Reply-To: <20011020195903.A8147@cascal.vtb>
  References: <20011020195903.A8147@cascal.vtb>

* 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