How to pull up an object definition
Moderator: NorbertKrupa
How to pull up an object definition
How can i pull up an object definition? For example, a table definition. I know export_objects can be used, but I think it exports to a file. I want to export it to my query tool/linux command prompt.
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: How to pull up an object definition
Do you mean something like this?
Code: Select all
[dbadmin@vertica01 ~]$ vsql -c "create table test (c1 int, c2 int);"
CREATE TABLE
[dbadmin@vertica01 ~]$ vsql -Atc "select export_objects('', 'test');"
CREATE TABLE snowfall.test
(
c1 int,
c2 int
);
SELECT MARK_DESIGN_KSAFE(1);
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
-
- GURU
- Posts: 527
- Joined: Tue Oct 22, 2013 9:36 pm
- Location: Chicago, IL
- Contact:
Re: How to pull up an object definition
If you read the documentation, you'll see that it does not export to file if you leave the destination parameter empty:
Code: Select all
SELECT EXPORT_OBJECTS('', schema.object);
Checkout vertica.tips for more Vertica resources.
Re: How to pull up an objection definition
Thanks you.
Which system table holds the objects definitions?
Which system table holds the objects definitions?
-
- GURU
- Posts: 527
- Joined: Tue Oct 22, 2013 9:36 pm
- Location: Chicago, IL
- Contact:
Re: How to pull up an object definition
I would strongly urge you to take a few minutes to familiarize yourself with the documentation. Many of your questions can be answered there.
The system table v_catalog.columns contains information about table columns.
The system table v_catalog.columns contains information about table columns.
Checkout vertica.tips for more Vertica resources.
Re: How to pull up an object definition
Thanks for the response.
I read documentation before posting it.
I am from Teradata background and there are some nice features and commands. I posted the questions to see if there are any simple ways of doing it.
For example, in Teradata, if I want to see an objection definition, I use "SHOW TABLE <TABLE NAME>". The command returns the table structure and other components associated with it.
I read documentation before posting it.
I am from Teradata background and there are some nice features and commands. I posted the questions to see if there are any simple ways of doing it.
For example, in Teradata, if I want to see an objection definition, I use "SHOW TABLE <TABLE NAME>". The command returns the table structure and other components associated with it.
Re: How to pull up an object definition
Hi,
If you are looking for something as "SHOW TABLE" in Vertica, then the best would be using meta commands in Vertica.
Hope this helps.
If you are looking for something as "SHOW TABLE" in Vertica, then the best would be using meta commands in Vertica.
Code: Select all
-- For all Table names
\dt
--For structure of a particular table
\d table_name