Исходный код вики Взаимодействие с Postgresql
Редактировал(а) Alexandr Fokin 2024/07/20 14:19
Последние авторы
author | version | line-number | content |
---|---|---|---|
1 | |(% style="width:117px" %) |(% style="width:1347px" %)[[PostgreSQL>>doc:Разработка.Базы данных.SQL.PostgreSQL.WebHome]] | ||
2 | |(% style="width:117px" %) |(% style="width:1347px" %)((( | ||
3 | | |How do I set up a postgresql database in Windows Powershell? | ||
4 | [[https:~~/~~/superuser.com/questions/1800694/how-do-i-set-up-a-postgresql-database-in-windows-powershell>>https://superuser.com/questions/1800694/how-do-i-set-up-a-postgresql-database-in-windows-powershell]] | ||
5 | | | | ||
6 | | | | ||
7 | |||
8 | |||
9 | ))) | ||
10 | |(% style="width:117px" %) |(% style="width:1347px" %)((( | ||
11 | |(% style="width:111px" %)Пароль|(% style="width:629px" %)Переменная окружения сессии. Указать пароль, чтобы не вводить вручную.|(% style="width:616px" %){{code language="ps"}}$env:PGPASSWORD = "value"{{/code}} | ||
12 | |(% style="width:111px" %) |(% style="width:629px" %) |(% style="width:616px" %) | ||
13 | |(% style="width:111px" %)Выполнить запрос|(% style="width:629px" %)Выполнить sql запрос, используя pgsql. | ||
14 | Указание пользователя (пароль из контекста). | ||
15 | Указание БД.|(% style="width:616px" %){{code language="зы"}}$psqlPath = ".\psql.exe" | ||
16 | & $psqlPath '-U', 'postgres', '-c', 'CREATE DATABASE db1;' | ||
17 | & $pgsqlPath '-U', 'postgres', '-c', 'CREATE SCHEMA schema1;', 'db1'{{/code}} | ||
18 | |||
19 | |||
20 | ))) | ||
21 | |||
22 |