Skip to main content

What is the best way to extract meta-data from Vertica in standard SQL format?

  • December 22, 2013
  • 3 replies
  • 20 views

JohnApps

Given a large database with lots of tables etc., what is the best way to extract the meta-data for those objects in order to use said meta-data to define objects in another Vertica database or a different DB altogether?

Using the formatting options of vsql does not seem to do quite what I want without some extensive editing afterwards.


Thank you, John

3 replies

eli_revach
Forum|alt.badge.img+2
  • Participating Frequently
  • December 23, 2013
Hi you can use select export_tables('','your table name') ; You can generate this statmet from tables table for all your tables in the database

JohnApps
  • Author
  • Participating Frequently
  • December 23, 2013

Thank you!

Prasanta_Pal
Forum|alt.badge.img
  • Participating Frequently
  • January 3, 2014

The following example exports all the non-virtual objects to which the user has access to standard output. The example uses false for the last parameter, indicating that the file will not include the MARK_DESIGN_KSAFE statement at the end.

=> SELECT EXPORT_OBJECTS(' ',' ',false);

see the link for more details:
https://my.vertica.com/docs/6.1.x/HTML/index.htm#12721.htm