Dean Taler
Dean Taler

Reputation: 763

How to connect Vertica schema with vertica_python?

I try to connect to vertica DB with 2 schema: 'public' and 'my_schema' I can only connect to 'public' schema and not to 'my_schema'

import vertica_python

conn_info = {'host': '****',
             'port': 5433,
             'user': '****',
             'password': '****',
             'database': 'my_schema',
             # 10 minutes timeout on queries
             'read_timeout': 600,
             # default throw error on invalid UTF-8 results
             'unicode_error': 'strict',
             # SSL is disabled by default
             'ssl': False}
conn = vertica_python.connect(**conn_info)
cur = conn.cursor()

and this is what I get:

vertica_python.errors.ConnectionError: Severity: FATAL, Message: Database "my_schema" does not exist

how can I connect the 'my_schema' with python?

Upvotes: 0

Views: 1107

Answers (1)

Dean Taler
Dean Taler

Reputation: 763

I found the solution, database should be "public" and the query should be with the schema name:

select * from my_schema.{table name}

Upvotes: 1

Related Questions