Я пытаюсь создать пул db, но все время получаю ошибку подключения (я думаю). Приветствуется любая помощь, а также ссылки на документацию, которую я могу прочитать, поскольку я новичок в postgresql. Заранее спасибо. Код:
async def create_db_pool():
bot.pg_con = await asyncpg.create_pool(user="postgres", password="placeholder", database="testDB")
Отслеживание:
Traceback (most recent call last):
File "C:\Users\USER\Documents\1discord\!!Discord Actual Bots\Waifu Weapons Online\Main Code.py", line 246, in <module>
bot.loop.run_until_complete(create_db_pool())
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 468, in run_until_complete
return future.result()
File "C:\Users\USER\Documents\1discord\!!Discord Actual Bots\Waifu Weapons Online\Main Code.py", line 15, in create_db_pool
bot.pg_con = await asyncpg.create_pool(host="127.0.0.1",user="postgres", password="placeholder", database="testDB")
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\site-packages\asyncpg\pool.py", line 398, in _async__init__
await self._initialize()
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\site-packages\asyncpg\pool.py", line 426, in _initialize
await first_ch.connect()
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\site-packages\asyncpg\pool.py", line 125, in connect
self._con = await self._pool._get_new_connection()
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\site-packages\asyncpg\pool.py", line 472, in _get_new_connection
**self._connect_kwargs)
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\site-packages\asyncpg\connection.py", line 1677, in connect
max_cacheable_statement_size=max_cacheable_statement_size)
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\site-packages\asyncpg\connect_utils.py", line 663, in _connect
raise last_error
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\site-packages\asyncpg\connect_utils.py", line 655, in _connect
connection_class=connection_class)
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\site-packages\asyncpg\connect_utils.py", line 622, in _connect_addr
connector, timeout=timeout)
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\asyncio\tasks.py", line 358, in wait_for
return fut.result()
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 778, in create_connection
raise exceptions[0]
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 765, in create_connection
yield from self.sock_connect(sock, address)
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\asyncio\selector_events.py", line 450, in sock_connect
return (yield from fut)
File "C:\Users\USER\AppData\Local\Programs\Python\Python36-32\lib\asyncio\selector_events.py", line 480, in _sock_connect_cb
raise OSError(err, 'Connect call failed %s' % (address,))
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 5432)