djangoでUniqueViolationの例外エラーを取得する - Qiita

はじめにdjangoで開発を行っている際にUniqueViolationのエラーを取得して例外処理を行うような処理を書く機会がありました。しかし、SQLAlchemyでのエラー取得のものしか見つか…

Qiita
@veronica #sqlalchemy has been nothing but trouble in our team. Lazy loading makes you have more transactions that last longer and also leads to the n+1 query problem. And I hate the query constructor to me it’s harder to understand than plain old SQL. We’re stripping it off to get back down to the #psycopg2 layer.
@scy no it doesn’t help with migrations, so it probably doesn’t solve your problem. I knew that when I responded. I should have said more, especially that. The reason I answered, and the reason I answered with this is that we were on #sqlalchemy and it’s done nothing but get in the way. #psycopg2 was underneath and now we’re using that and life is much better. So that’s what I *prefer* though I’m sorry it’s not what you need.
Probably I need #psycopg2. #Python
不正アクセスしてきたホストの国コードを知ってセキュリティ対策に活用する - Qiita

現在 Ubuntu server (24.04) で自宅サーバーを稼働させていますが、日々悩まされているのがSSHで不正ログインしてくるホストの増加です。一般的なセキュリィティ対策は行っていますがサ…

Qiita

To connect to a database in Python, use a database-specific library such as Pyodbc for Microsoft Access and SQL Server, Psycopg2 for PostgreSQL, mysql-connector-python for MySQL, or sqlite3 for SQLite. You will need to execute a database query to retrieve the data after establishing the connection.

#python #Pyodbc #Psycopg2 #PostgreSQL #mysql-connector-python #MySQL #sqlite3 #SQLite #database #db #sql

🌗 Psycopg3 與 Psycopg2 的差異
➤ Psycopg3 與 Psycopg2 的差異及解決方案
https://www.psycopg.org/psycopg3/docs/basic/from_pg2.html
Psycopg3 與 Psycopg2 在使用上有幾個差異,例如伺服器端綁定、同一查詢中多個結果的返回、不同的類型轉換規則等。本文將介紹這些差異以及如何解決相關問題。
+ 很有用的文章,謝謝分享!
+ Psycopg3 真的很好用,但需要注意一些差異,這篇文章很詳細地介紹了這些差異及解決方案。
#Python #PostgreSQL #Psycopg3 #Psycopg2
Differences from psycopg2 - psycopg 3.2.0.dev1 documentation

Dear #Python community,

what is the recommended library to interact with #PostgreSQL?
I've heard of #psycopg2 and #SQLAlchemy in context of web applications but want to build a desktop app.
Tried #PonyORM with mixed results.

I'd prefer not to go raw #SQL if possible.

#python #psycopg2
psycopg2 インストールエラー - Qiita https://qiita.com/b2bmakers/items/d1b0db5966ac145b0e29

> sudo apt install libpq-dev

これでいけた

psycopg2 インストールエラー - Qiita

$ pip install psycopg2 でエラー。 エラー内容(抜粋): Error: pg_config executable not found. pg_config is required to build ...