Received: from hapcibeno.freestart.hu (hapcibeno.freestart.hu [213.197.64.8]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9MH3mP38431 for ; Mon, 22 Oct 2001 13:03:49 -0400 (EDT) (envelope-from pgerzson@freestart.hu) Received: from erinyes.freestart.hu ([213.197.64.251] helo=jaguar) by freestart.hu with smtp (Freestart relay 2 (FS-Lin)) id 15vhib-00045g-00; Mon, 22 Oct 2001 18:14:26 +0200 Message-ID: <007f01c15b12$7ea3fda0$01fdfea9@jaguar> From: "Papp Gyozo" To: , References: <20011020195903.A8147@cascal.vtb> Subject: Re: how to get the field types of a(n empty) table? Date: Mon, 22 Oct 2001 17:59:03 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Scanner: exiscan by Freestart X-Scanner: exiscan by Freestart X-Archive-Number: 200110/80 X-Sequence-Number: 633 If you runs psql with -E option, then psql reveals the SQL equivalent of its magical metacommands starting with a backslash ie.: \dv \d and so on. Use those queries to get the columns' types! -E, --echo-hidden Echoes the actual queries generated by \d and other backslash commands. You can use this if you wish to include similar functionality into your own programs. This is equivalent to setting the variable ECHO_HIDDEN from within psql. ----- Original Message ----- From: To: Sent: Saturday, October 20, 2001 7:59 PM Subject: [PHP] how to get the field types of a(n empty) table? 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 ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org