8

I would like to know how I can get the metadata of an object in a Vertica database; like metadata of a table. Is there any table that stores the metadata of objects (functions, views, tables) in Vertica Database.
For example in Oracle, I could type the following and get a detailed description of tables or see the code of a procedure.
oracle :> desc table_name;
or
oracle :> edit proc_name;

I know that I can see the tables from my schemas with \dt command, but is there any way I can see the DDL statements that created the objects?

Mark Schultheiss
  • 32,614
  • 12
  • 69
  • 100
Up_One
  • 5,213
  • 3
  • 33
  • 65

3 Answers3

13

Thanks, but this is not what I want. I was looking for is the export_objects() function:

select export_objects('','object_name') 

This way you will get the creation script for the object.

Jason Sundram
  • 12,225
  • 19
  • 71
  • 86
Up_One
  • 5,213
  • 3
  • 33
  • 65
3

\d table-name should get you what you need.

bluish
  • 26,356
  • 27
  • 122
  • 180
Joe
  • 200
  • 1
  • 5
  • Ok thx , but this is not the answer !!
    or at least this is not what i want .
    What i was looking for is the export_objects() function
    select export_objects('','object_name') this way you will get the creation script for the object.
    – Up_One Jul 16 '12 at 18:20
  • Glad you got to what you needed! – Joe Jul 27 '12 at 15:44
0

Extra tip: If you specify only the schema, you will get all of the objects inside that schema. Sure beats having to enter a loop where you run export_objects() for every object.