From: Vishal Arora <aroravishal22@hotmail.com>
To: spotluri@ismartpanache.com
To: pgsql-admin@postgresql.org
Subject: Re: How do i get DDL of a Table from system catalog ?
Date: Thu, 10 Apr 2008 09:36:25 +0530
Message-ID: <BLU110-W39F1C1FA761B5F451D4707A9EC0@phx.gbl> (raw)
In-Reply-To: <41734.1207749044@ismartpanache.com>
References: <41734.1207749044@ismartpanache.com>
To: pgsql-admin@postgresql.orgDate: Wed, 9 Apr 2008 08:50:44 -0500Subject: [ADMIN] How do i get DDL of a Table from system catalog ?From: spotluri@ismartpanache.comHi,How do i get DDL of a Table from system catalog ?Purpose :1) i need to create an external table on the basis of another table. create table ext_table (like table_name); ------------------> this doesnot work for external tables.
try - create table ext_table (like pg_catalog.table_name); - it worked for me.
2) so i need to query catalog to get definition of the table. on the basis of this definition i can create external table .eg: i am looking for some thing like : select * from pg_catalog where table_name=' srikanth_ext_parallel_crt_sms_logs_child_depth_1_d_2008_03_30_daily ' ;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.Can anyone guide/help me in this ?Regards, Srikanth k Potluri +63 9177444783(philippines)
_________________________________________________________________
Technology : Catch up on updates on the latest Gadgets, Reviews, Gaming and Tips to use technology etc.
http://computing.in.msn.com/=
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-admin@postgresql.org
Cc: aroravishal22@hotmail.com, spotluri@ismartpanache.com
Subject: Re: How do i get DDL of a Table from system catalog ?
In-Reply-To: <BLU110-W39F1C1FA761B5F451D4707A9EC0@phx.gbl>
References: <41734.1207749044@ismartpanache.com> <BLU110-W39F1C1FA761B5F451D4707A9EC0@phx.gbl>
* 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