cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Connect to PostgreSQL to Databricks community edition error

db-avengers2rul
Contributor II

Dear Team,

I am trying to establish a connectivity to PostgreSQL to Databricks community edition using sql notebook

however I am encountering the below error

Error in SQL statement: IllegalArgumentException: requirement failed: Host name should not contain query strings or parameters.

# using the below SQL from the databricks sytax

https://docs.databricks.com/external-data/postgresql.html#using-the-postgresql-connector-in-databric...

DROP TABLE IF EXISTS postgresql_table;
CREATE TABLE postgresql_table
USING postgresql
OPTIONS (
 dbtable 'orders',
  host 'postgresql://itworld_sms_user:itworld@pg.itworld.com:5432/itworld_sms_db',
  port '5432',
  database 'itworld_sms_db',
  user 'world_sms_user',
  password 'xxxxxxx'
);
 
example
 
/*postgresql://itworld_sms_user:xxxxxxx@pg.itworld.com:5432/itworld_sms_db
postgresql://<username>:<password>@<hostname>:<port>/<database>
 
username = itworld_sms_user
password = xxxxxxx
hostname = pg.itworld.com
port = 5432
database = itworld_sms_db*/

my questions are the following

1) can we establish connectivity using a community edition notebook ?

2) if yes to question 1 then what is wrong with the above syntax?

1 REPLY 1

db-avengers2rul
Contributor II

@Team

any suggestions ?

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group