Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

How do i get DDL of a Table from system catalog ?



Hi,

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.
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)


Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group