-2

when i used PROJECTION_COLUMNS get column type it spent too much time. is there have another table or function to search column type?

Sanborn
  • 41
  • 8

2 Answers2

1

There's a few other column system tables (i.e. v_catalog.columns). You can alternatively use EXPORT_TABLES to generate a SQL script of the DDL for the table:

=> SELECT EXPORT_TABLES(' ','store.store_orders_fact');
Kermit
  • 33,827
  • 13
  • 85
  • 121
  • Thanks, EXPORT_TABLES(' ','store.store_orders_fact') can be right. But in system table I can't find PRIMARY KEY information. Anyway thanks very much. – Sanborn Aug 11 '15 at 02:04
  • @Sanborn Have you tried [searching the documentation](https://my.vertica.com/docs/7.1.x/HTML/index.htm#Authoring/SQLReferenceManual/SystemTables/CATALOG/PRIMARY_KEYS.htm)? – Kermit Aug 11 '15 at 02:37
1

If you wanna get a view of your keys just use the V_CATALOG.TABLE_CONSTRIANTS table. Link to the oficial doc

Here is query that might help you:

select * from table_constraints where table_name='bla bla';

Take a look over the table documentation so you can understand what the columns represent.

Up_One
  • 5,213
  • 3
  • 33
  • 65