Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id DD035B5DD1D for ; Tue, 12 Jul 2011 05:39:50 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 88249-03 for ; Tue, 12 Jul 2011 08:39:44 +0000 (UTC) X-Greylist: delayed 00:06:39.849275 by SQLgrey-1.7.6 Received: from lilly.ping.de (lilly.ping.de [83.97.42.2]) by mail.postgresql.org (Postfix) with SMTP id 9870FB5DCC9 for ; Tue, 12 Jul 2011 05:39:43 -0300 (ADT) Received: (qmail 3068 invoked from network); 12 Jul 2011 08:33:02 -0000 Received: (ofmipd 178.201.52.128); 12 Jul 2011 08:32:40 -0000 Date: 12 Jul 2011 10:33:01 +0200 Message-ID: <4E1C06BD.5080606@ping.de> From: "B.Rathmann" To: pgsql-sql@postgresql.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.9.2.17) Gecko/20110506 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 Subject: Looking for a "show create table " equivalent Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201107/64 X-Sequence-Number: 35634 Hello, I've been trying to find out how to find out which sql was run to create a certain table. As I need this in a program which may access the database remotely, using pg_dump --schema-only or psql is not an option (the system my program runs on may not even have those tools installed). Looking at the source of pgadmin3 it seems as if the program collects all info about the given table (columns, indeces etc) and creates the needed SQL by itself, is there no easier way? E.g. MySQL offers a simple "show create table ". I am using Postgresql 9.0.4 on Gentoo. Thanks for your help (if there is any documentation which I haven't found yet, just point me to it). Sincerely Bettina