Post Test 3 (Working with PosgreSQL in Python)

Reference page

https://qiita.com/kumazo/items/483f47360f8b61a9fbb9

How to use JSONB Reference page

https://blog.serverworks.co.jp/postgres_jsonb_search

In the middle of sample code

import psycopg2


# connect postgreSQL
users = 'postgres'
dbnames = 'postgres'
passwords = '123qwe!'
conn = psycopg2.connect(" user=" + users +" dbname=" + dbnames +" password=" + passwords)
conn.autocommit = True

cur = conn.cursor()

cur.execute('SELECT * FROM hoge')

results = cur.fetchall()
for r in results:
    print(r)

Recommended Posts

Post Test 3 (Working with PosgreSQL in Python)
Working with LibreOffice in Python
Working with sounds in Python
Working with LibreOffice in Python: import
Working with DICOM images in Python
Stress Test with Locust written in Python
Try working with binary data in Python
Primality test with Python
Primality test with python
Try working with Mongo in Python on Mac
[Introduction for beginners] Working with MySQL in Python
Scraping with selenium in Python
POST json with Python3 script
Algorithm in Python (primality test)
Specific sample code for working with SQLite3 in Python
Debugging with pdb in Python
Post to slack with Python 3
Python: Working with Firefox with selenium
Scraping with Selenium in Python
Scraping with Tor in Python
Tweet with image in Python
Combined with permutations in Python
Post to Slack in Python
Set python test in jenkins
Design and test Verilog in Python only with Veriloggen and cocotb.
Number recognition in images with Python
Testing with random numbers in Python
GOTO in Python with Sublime Text 3
Scraping with Selenium in Python (Basic)
CSS parsing with cssutils in Python
[Python] POST wav files with requests [POST]
Numer0n with items made in Python
Quine Post with Qiita API (Python)
Use rospy with virtualenv in Python3
Post multiple Twitter images with python
Unit test log output with python
Write selenium test code in python
Get, post communication memo in Python
Use Python in pyenv with NeoVim
Heatmap with Dendrogram in Python + matplotlib
Read files in parallel with Python
Statistical test (multiple test) in Python: scikit_posthocs
Password generation in texto with python
Use OpenCV with Python 3 in Window
Easily post to twitter with Python 3
Until dealing with python in Atom
Get started with Python in Blender
Post test
Write documentation in Sphinx with Python Livereload
Get additional data in LDAP with python
Spiral book in Python! Python with a spiral book! (Chapter 14 ~)
Try logging in to qiita with Python
[Python] Super easy test with assert statement
Test Python non-functional programs with GitLab CI
Python3> in keyword> True with partial match?
Exclusive control with lock file in Python
Device monitoring with On-box Python in IOS-XE
WebUI test with Python2.6 + Selenium 2.44.0 --profile setting
Write the test in a python docstring
Generate Japanese test data with Python faker
Draw Nozomi Sasaki in Excel with python