Query Service with Jupyter/Databricks | Community
Skip to main content
Level 2
April 7, 2026
Solved

Query Service with Jupyter/Databricks

  • April 7, 2026
  • 1 reply
  • 24 views

My connection to the PostgreSQL database  for the Query Service has been giving me this error

ErrorCode: 08P01 queryId: 07326d38-0746-48c6-8332-17b75c01dac2 Unknown error encountered. Reason: [Embedded Postgres: Error while populating metadata tables in embedded Postgres]

This was not happening before until 2weeks ago.

My solution uses psycopg2 library to connect to query services.
 

 conn = psycopg2.connect(

                f"sslmode=require host={hostname} port=5432 dbname={database}?FLATTEN user={user} password={password}"

I’m completely not sure what the issue as this setup has being running for almost a year.
 

    Best answer by JohnYa5

    Interesting I get this error

    Database error: ErrorCode: 08P01 queryId: 9dccfe6f-4ae3-432a-886a-bb4c7493a229 Unknown error encountered. Reason: [Embedded Postgres: Error while populating metadata tables in embedded Postgres

    Its suppose to fetch the metadata columns, and that is what is causing it to fail on my end.
     

     

    1 reply

    Level 5
    April 8, 2026

    Hello ​@JohnYa5 ,

    I would request you to please try without the “Flatten” keyword.

    Try something like:

    config = {
    'prod': f{
    "connection_string": "sslmode=require host={host_name} port=80 dbname={db_name} user={user} password={password}"
    }
    }
    conn = psycopg2.connect(config['prod']['connection_string'])

    Thank you!

    Supratim

    Level 5
    April 8, 2026

    I tried to “Flatten” as well, it is still working for me!

    JohnYa5AuthorAccepted solution
    Level 2
    April 8, 2026

    Interesting I get this error

    Database error: ErrorCode: 08P01 queryId: 9dccfe6f-4ae3-432a-886a-bb4c7493a229 Unknown error encountered. Reason: [Embedded Postgres: Error while populating metadata tables in embedded Postgres

    Its suppose to fetch the metadata columns, and that is what is causing it to fail on my end.