pg.ddx.io pgsql-admin@postgresql.org mailing list archivehelp / color / mirror / Atom feed
How do i get DDL of a Table from system catalog ? 3+ messages / 3 participants [nested] [flat]
* How do i get DDL of a Table from system catalog ? @ 2008-04-09 13:50 Potluri Srikanth <spotluri@ismartpanache.com> 0 siblings, 2 replies; 3+ messages in thread From: Potluri Srikanth @ 2008-04-09 13:50 UTC (permalink / raw) To: pgsql-admin <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 another table.<br> create table ext_table (like table_name); ------------------> this doesnot work for external tables.<br> 2) so i need to query catalog to get definition of the table.<br> on the basis of this definition i can create external table .<br> eg: i am looking for some thing like :<br> <br> 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> ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How do i get DDL of a Table from system catalog ? @ 2008-04-09 14:21 Vyacheslav Kalinin <vka@mgcp.com> parent: Potluri Srikanth <spotluri@ismartpanache.com> 1 sibling, 0 replies; 3+ messages in thread From: Vyacheslav Kalinin @ 2008-04-09 14:21 UTC (permalink / raw) To: spotluri@ismartpanache.com; +Cc: pgsql-admin try starting psql with -E (would show queries psql does) option and \d+ the table ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How do i get DDL of a Table from system catalog ? @ 2008-04-10 04:06 Vishal Arora <aroravishal22@hotmail.com> parent: Potluri Srikanth <spotluri@ismartpanache.com> 1 sibling, 0 replies; 3+ messages in thread From: Vishal Arora @ 2008-04-10 04:06 UTC (permalink / raw) To: spotluri@ismartpanache.com; pgsql-admin 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/= ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2008-04-10 04:06 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2008-04-09 13:50 How do i get DDL of a Table from system catalog ? Potluri Srikanth <spotluri@ismartpanache.com> 2008-04-09 14:21 ` Vyacheslav Kalinin <vka@mgcp.com> 2008-04-10 04:06 ` Vishal Arora <aroravishal22@hotmail.com>
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