Skip to main content
Level 2
Apr 7, 2026 5:50 PM UTC
Solved

Query Service with Jupyter/Databricks

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.
 

    This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
    JohnYa5Accepted solution
    Level 2
    Apr 8, 2026 4:53 AM UTC

    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.
     

     

    3 replies

    Level 5
    Apr 8, 2026 4:30 AM UTC

    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

    Translate
    Level 5
    Apr 8, 2026 4:49 AM UTC

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

    Translate
    JohnYa5AuthorAccepted solution
    Level 2
    Apr 8, 2026 4:53 AM UTC

    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.
     

     

    Translate