Look at the table schema.

Moderator: NorbertKrupa

Post Reply
Benjamin_e
Newbie
Newbie
Posts: 15
Joined: Tue Aug 26, 2014 1:43 pm

Look at the table schema.

Post by Benjamin_e » Tue Sep 02, 2014 11:11 am

Hey I am looking for command to watch already made tables for example i got table called 'foo'
I want command to show me foo fields like:

CREATE table foo(
id int,
name varchar(10)
partition, group by.... etc.

shanky
Newbie
Newbie
Posts: 1
Joined: Tue Aug 12, 2014 4:57 pm

Re: Look at the table schema.

Post by shanky » Tue Sep 02, 2014 1:18 pm

To view the table fields you can use
-> \d tablename

This will give you the columns of the table.

To see the list of table use

-> \dt

This will give you all the tables under a user

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: Look at the table schema.

Post by NorbertKrupa » Tue Sep 02, 2014 3:00 pm

If you're looking for the actual DDL of the table, then you can use the EXPORT_TABLES() function:

Code: Select all

SELECT EXPORT_TABLES(' ','store.store_orders_fact');
Checkout vertica.tips for more Vertica resources.

Benjamin_e
Newbie
Newbie
Posts: 15
Joined: Tue Aug 26, 2014 1:43 pm

Re: Look at the table schema.

Post by Benjamin_e » Wed Sep 03, 2014 2:20 pm

Thanks all. :D

Post Reply

Return to “New to Vertica SQL”