回答編集履歴
1
追記
answer
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
-
portは整数で指定します。
|
1
|
+
portは整数か**整数に解釈できる文字列**で指定します。
|
2
2
|
```python
|
3
3
|
conn = psycopg2.connect(host='ちゃんとホスト名', dbname='しっかりデータベース名', user='間違いないユーザ名', password='正しいパスワード', port=5432)
|
4
|
+
|
5
|
+
# または
|
6
|
+
|
7
|
+
conn = psycopg2.connect(host='ちゃんとホスト名', dbname='しっかりデータベース名', user='間違いないユーザ名', password='正しいパスワード', port='5432')
|
4
8
|
```
|
5
9
|
|
6
10
|
[https://www.psycopg.org/docs/module.html#psycopg2.connect](https://www.psycopg.org/docs/module.html#psycopg2.connect)
|