Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9061227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:25:53+00:00 2026-06-16T15:25:53+00:00

in python I can connect a PostgreSQL database with the following code: db =

  • 0

in python I can connect a PostgreSQL database with the following code:

db = postgresql.open(“pq://$user:$pass@$host:$port/$dbname”)

But in the above line I have to enter the plaintext password and then py-postgresql will hash it to compare with the hash value stored in PostgreSQL database. If I want to use the password hashed by MD5 by myself, which means I don’t want py-postgresql to do the hashing for me. How can I do it? I tried to modify the source code of py-postgresql, but I couldn’t find where is the hashing happens. Then I find the in the settings of py-postgresql I can enable SSL-mode. Can someone give me a simple example about how to set it?

Kind regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T15:25:55+00:00Added an answer on June 16, 2026 at 3:25 pm

    The way DB-API works is by supplying the plaintext password. Furthermore, py-postgresql does not do the password hashing/verification, the server does it as part of the connection handshake (see pg_hba.conf as to how/why it does it).

    If you are looking at securing the transmission of the password, use the SSL connection protocol instead of the plaintext one. The SSL mode will also encrypt all data transmitted between the server and the client.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm planning to use very big numbers in Python, but wonder if Python can
I have a weird problem. I can connect to a remote host using psql
Greetings, by using the psycopg2 library of python, I can currently connect to a
I have built a Python server to which various clients can connect, and I
I need to connect to an old PostGreSQL database (version 7.3), and I am
In (say) Python, I can issue: psycopg2.connect(...).cursor().execute(select * from account where id='00100000006ONCrAAO') which on
The question: How do I create a python application that can connect and send
Is there any way to connect to an MS SQL Server database with python
I am using Python 2.7 on OSX Lion and can't connect to a remote
Using Robotframework 2.6.3 and the python database library, I want to connect to MySql

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.