GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Connection to Postgres fails when password contains special characters · Issue #4393 · feast-dev/feast

Connection to Postgres fails when password contains special characters #4393

New issue
Copy link
New issue
Copy link
Closed
#4394
Closed
Connection to Postgres fails when password contains special characters#4393
#4394
Copy link
Labels
kind/bugpriority/p2

Description

@job-almekinders
job-almekinders
opened on Aug 8, 2024
Issue body actions

With the release of this PR, this method was added to construct the connection string for the connection to Postgres with psycopg3.

However, when a password contains special characters, they are not properly escaped, which leads to connection errors.

Expected Behavior

The special characters are escaped properly.

Current Behavior

The special characters are not escaped properly, leading to connection errors.

Steps to reproduce

In the setup file for the postgres integration tests, update all occurrences of the password test to something like test% or test!#$%&()*+,-./:;<=>?@[\]^_{|}~±`.

Then run all postgres online store integration tests by running:

make test-python-universal-postgres-online

Specifications

Version: 0.36.0
Platform: MacOS - M1
Subsystem: Sonoma 14.1.1

Possible Solution

The potential solution is to use update these lines of code to the following:

from psycopg.conninfo import make_conninfo

def _get_conninfo(config: PostgreSQLConfig) -> str:
    """Get the `conninfo` argument required for connection objects."""
    psycopg_config = {
        "user": config.user,
        "password": config.password,
        "host": config.host,
        "port": int(config.port),
        "dbname": config.database,
    }
    return make_conninfo(**psycopg_config)

Instead of using a connection string, this passes the config in key-value pairs. When passing it as key-value pairs the special characters are escaped properly.

More info here.

Activity

  1. job-almekinders
    added
    kind/bug
    priority/p2
    on Aug 8, 2024
  2. job-almekinders commented on Aug 8, 2024

    @job-almekinders
    job-almekinders
    on Aug 8, 2024
    ContributorAuthor
    More actions

    I'll probably be able to create a PR today or tomorrow for this

  3. franciscojavierarceo
    closed this as completedin #4394on Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugpriority/p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.