pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Potluri Srikanth <spotluri@ismartpanache.com>
To: pgsql-admin@postgresql.org
Subject: How do i get DDL of a Table from system catalog ?
Date: Wed, 9 Apr 2008 08:50:44 -0500
Message-ID: <41734.1207749044@ismartpanache.com> (raw)

<HTML>
Hi,<br>
<br>
How do i get DDL of a Table from system catalog ?<br>
<br>
Purpose :<br>
1) i need to create an external table on the basis of&nbsp; another table.<br>
&nbsp;&nbsp;&nbsp;&nbsp; create table ext_table (like table_name); ------------------> this doesnot work for external tables.<br>
2)&nbsp; so i need to query catalog to get&nbsp; definition of the table.<br>
&nbsp; &nbsp;&nbsp; on the basis of this definition i can create external table .<br>
eg: i am looking for some thing like :<br>
<br>
&nbsp;&nbsp; select * from pg_catalog where table_name=' srikanth_ext_parallel_crt_sms_logs_child_depth_1_d_2008_03_30_daily ' ;<br>
<br>
3) once i get the definition of the table , i need to use that definition for creation of external table in a script which will run in cron job daily for data loading.<br>
<br>
Can anyone guide/help me in this ?<br>
<br>
<br>
<br>
Regards,
<br>
Srikanth k Potluri
<br>
+63 9177444783(philippines) <BR></HTML>




view thread (3+ messages)  latest in thread

Message-ID: <41734.1207749044@ismartpanache.com>
Permalink:  ../41734.1207749044@ismartpanache.com/
Also on:    postgresql.org/message-id/41734.1207749044@ismartpanache.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: spotluri@ismartpanache.com
  Subject: Re: How do i get DDL of a Table from system catalog ?
  In-Reply-To: <41734.1207749044@ismartpanache.com>

* 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