|
|
@ -367,154 +367,12 @@ Postgres |
|
|
|
|
|
|
|
|
|
|
|
Postgres commands. |
|
|
|
Postgres commands. |
|
|
|
|
|
|
|
|
|
|
|
pg.client |
|
|
|
pgsql.create |
|
|
|
--------- |
|
|
|
------------ |
|
|
|
|
|
|
|
|
|
|
|
Execute a psql command. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- sql (str): The SQL to be executed. |
|
|
|
|
|
|
|
- database (str): The database name. |
|
|
|
|
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- host (str): The database host name or IP address. |
|
|
|
|
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[run pg.client command] |
|
|
|
|
|
|
|
pg.client: sql |
|
|
|
|
|
|
|
database: template1 |
|
|
|
|
|
|
|
host: localhost |
|
|
|
|
|
|
|
password: None |
|
|
|
|
|
|
|
port: 5432 |
|
|
|
|
|
|
|
user: postgres |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pg.createdatabase |
|
|
|
|
|
|
|
----------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Create a PostgreSQL database. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name (str): The database name. |
|
|
|
|
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- host (str): The database host name or IP address. |
|
|
|
|
|
|
|
- owner (str): The owner (user/role name) of the new database. |
|
|
|
|
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
|
|
|
|
- template (str): The database template name to use, if any. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[run pg.createdatabase command] |
|
|
|
|
|
|
|
pg.createdatabase: name |
|
|
|
|
|
|
|
admin_pass: None |
|
|
|
|
|
|
|
admin_user: postgres |
|
|
|
|
|
|
|
host: localhost |
|
|
|
|
|
|
|
owner: None |
|
|
|
|
|
|
|
port: 5432 |
|
|
|
|
|
|
|
template: None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pg.createdb |
|
|
|
|
|
|
|
----------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Create a PostgreSQL database. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name (str): The database name. |
|
|
|
|
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- host (str): The database host name or IP address. |
|
|
|
|
|
|
|
- owner (str): The owner (user/role name) of the new database. |
|
|
|
|
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
|
|
|
|
- template (str): The database template name to use, if any. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[run pg.createdb command] |
|
|
|
|
|
|
|
pg.createdb: name |
|
|
|
|
|
|
|
admin_pass: None |
|
|
|
|
|
|
|
admin_user: postgres |
|
|
|
|
|
|
|
host: localhost |
|
|
|
|
|
|
|
owner: None |
|
|
|
|
|
|
|
port: 5432 |
|
|
|
|
|
|
|
template: None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pg.createuser |
|
|
|
|
|
|
|
------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Create a PostgreSQL user. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name (str): The user name. |
|
|
|
|
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- host (str): The database host name or IP address. |
|
|
|
|
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[run pg.createuser command] |
|
|
|
|
|
|
|
pg.createuser: name |
|
|
|
|
|
|
|
admin_pass: None |
|
|
|
|
|
|
|
admin_user: postgres |
|
|
|
|
|
|
|
host: localhost |
|
|
|
|
|
|
|
password: None |
|
|
|
|
|
|
|
port: 5432 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pg.database |
|
|
|
|
|
|
|
----------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Create a PostgreSQL database. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name (str): The database name. |
|
|
|
|
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- host (str): The database host name or IP address. |
|
|
|
|
|
|
|
- owner (str): The owner (user/role name) of the new database. |
|
|
|
|
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
|
|
|
|
- template (str): The database template name to use, if any. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[run pg.database command] |
|
|
|
|
|
|
|
pg.database: name |
|
|
|
|
|
|
|
admin_pass: None |
|
|
|
|
|
|
|
admin_user: postgres |
|
|
|
|
|
|
|
host: localhost |
|
|
|
|
|
|
|
owner: None |
|
|
|
|
|
|
|
port: 5432 |
|
|
|
|
|
|
|
template: None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pg.database_exists |
|
|
|
|
|
|
|
------------------ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Determine if a Postgres database exists. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name (str): The database name. |
|
|
|
|
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- host (str): The database host name or IP address. |
|
|
|
|
|
|
|
- owner (str): The owner (user/role name) of the new database. |
|
|
|
|
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[run pg.database_exists command] |
|
|
|
|
|
|
|
pg.database_exists: name |
|
|
|
|
|
|
|
admin_pass: None |
|
|
|
|
|
|
|
admin_user: postgres |
|
|
|
|
|
|
|
host: localhost |
|
|
|
|
|
|
|
port: 5432 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pg.db |
|
|
|
|
|
|
|
----- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Create a PostgreSQL database. |
|
|
|
Create a PostgreSQL database. |
|
|
|
|
|
|
|
|
|
|
|
- name (str): The database name. |
|
|
|
- database (str): The database name. |
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
- host (str): The database host name or IP address. |
|
|
|
- host (str): The database host name or IP address. |
|
|
@ -525,8 +383,8 @@ Create a PostgreSQL database. |
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
[run pg.db command] |
|
|
|
[run pgsql.create command] |
|
|
|
pg.db: name |
|
|
|
pgsql.create: database |
|
|
|
admin_pass: None |
|
|
|
admin_pass: None |
|
|
|
admin_user: postgres |
|
|
|
admin_user: postgres |
|
|
|
host: localhost |
|
|
|
host: localhost |
|
|
@ -534,54 +392,12 @@ Create a PostgreSQL database. |
|
|
|
port: 5432 |
|
|
|
port: 5432 |
|
|
|
template: None |
|
|
|
template: None |
|
|
|
|
|
|
|
|
|
|
|
pg.dropdatabase |
|
|
|
pgsql.drop |
|
|
|
--------------- |
|
|
|
---------- |
|
|
|
|
|
|
|
|
|
|
|
Remove a PostgreSQL database. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name (str): The database name. |
|
|
|
|
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- host (str): The database host name or IP address. |
|
|
|
|
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[run pg.dropdatabase command] |
|
|
|
|
|
|
|
pg.dropdatabase: name |
|
|
|
|
|
|
|
admin_pass: None |
|
|
|
|
|
|
|
admin_user: postgres |
|
|
|
|
|
|
|
host: localhost |
|
|
|
|
|
|
|
port: 5432 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pg.dropdb |
|
|
|
|
|
|
|
--------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove a PostgreSQL database. |
|
|
|
Remove a PostgreSQL database. |
|
|
|
|
|
|
|
|
|
|
|
- name (str): The database name. |
|
|
|
- database (str): The database name. |
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- host (str): The database host name or IP address. |
|
|
|
|
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[run pg.dropdb command] |
|
|
|
|
|
|
|
pg.dropdb: name |
|
|
|
|
|
|
|
admin_pass: None |
|
|
|
|
|
|
|
admin_user: postgres |
|
|
|
|
|
|
|
host: localhost |
|
|
|
|
|
|
|
port: 5432 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pg.dropuser |
|
|
|
|
|
|
|
----------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove a Postgres user. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name (str): The user name. |
|
|
|
|
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
- host (str): The database host name or IP address. |
|
|
|
- host (str): The database host name or IP address. |
|
|
@ -590,19 +406,19 @@ Remove a Postgres user. |
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
[run pg.dropuser command] |
|
|
|
[run pgsql.drop command] |
|
|
|
pg.dropuser: name |
|
|
|
pgsql.drop: database |
|
|
|
admin_pass: None |
|
|
|
admin_pass: None |
|
|
|
admin_user: postgres |
|
|
|
admin_user: postgres |
|
|
|
host: localhost |
|
|
|
host: localhost |
|
|
|
port: 5432 |
|
|
|
port: 5432 |
|
|
|
|
|
|
|
|
|
|
|
pg.dump |
|
|
|
pgsql.dump |
|
|
|
------- |
|
|
|
---------- |
|
|
|
|
|
|
|
|
|
|
|
Export a Postgres database. |
|
|
|
Export a Postgres database. |
|
|
|
|
|
|
|
|
|
|
|
- name (str): The database name. |
|
|
|
- database (str): The database name. |
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
- file_name (str): The name/path of the export file. Defaults the database name plus ``.sql``. |
|
|
|
- file_name (str): The name/path of the export file. Defaults the database name plus ``.sql``. |
|
|
@ -612,104 +428,84 @@ Export a Postgres database. |
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
[run pg.dump command] |
|
|
|
[run pgsql.dump command] |
|
|
|
pg.dump: name |
|
|
|
pgsql.dump: database |
|
|
|
admin_pass: None |
|
|
|
admin_pass: None |
|
|
|
admin_user: postgres |
|
|
|
admin_user: postgres |
|
|
|
file_name: None |
|
|
|
file_name: None |
|
|
|
host: localhost |
|
|
|
host: localhost |
|
|
|
port: 5432 |
|
|
|
port: 5432 |
|
|
|
|
|
|
|
|
|
|
|
pg.dumpdb |
|
|
|
pgsql.exists |
|
|
|
--------- |
|
|
|
------------ |
|
|
|
|
|
|
|
|
|
|
|
Export a Postgres database. |
|
|
|
Determine if a Postgres database exists. |
|
|
|
|
|
|
|
|
|
|
|
- name (str): The database name. |
|
|
|
- database (str): The database name. |
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
- file_name (str): The name/path of the export file. Defaults the database name plus ``.sql``. |
|
|
|
|
|
|
|
- host (str): The database host name or IP address. |
|
|
|
- host (str): The database host name or IP address. |
|
|
|
|
|
|
|
- owner (str): The owner (user/role name) of the new database. |
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
[run pg.dumpdb command] |
|
|
|
[run pgsql.exists command] |
|
|
|
pg.dumpdb: name |
|
|
|
pgsql.exists: database |
|
|
|
admin_pass: None |
|
|
|
admin_pass: None |
|
|
|
admin_user: postgres |
|
|
|
admin_user: postgres |
|
|
|
file_name: None |
|
|
|
|
|
|
|
host: localhost |
|
|
|
host: localhost |
|
|
|
port: 5432 |
|
|
|
port: 5432 |
|
|
|
|
|
|
|
|
|
|
|
pg.exists |
|
|
|
pgsql.sql |
|
|
|
--------- |
|
|
|
--------- |
|
|
|
|
|
|
|
|
|
|
|
Determine if a Postgres database exists. |
|
|
|
Execute a psql command. |
|
|
|
|
|
|
|
|
|
|
|
- name (str): The database name. |
|
|
|
- sql (str): The SQL to be executed. |
|
|
|
|
|
|
|
- database (str): The database name. |
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
- host (str): The database host name or IP address. |
|
|
|
- host (str): The database host name or IP address. |
|
|
|
- owner (str): The owner (user/role name) of the new database. |
|
|
|
|
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
[run pg.exists command] |
|
|
|
[run pgsql.sql command] |
|
|
|
pg.exists: name |
|
|
|
pgsql.sql: sql |
|
|
|
admin_pass: None |
|
|
|
database: template1 |
|
|
|
admin_user: postgres |
|
|
|
|
|
|
|
host: localhost |
|
|
|
host: localhost |
|
|
|
|
|
|
|
password: None |
|
|
|
port: 5432 |
|
|
|
port: 5432 |
|
|
|
|
|
|
|
user: postgres |
|
|
|
|
|
|
|
|
|
|
|
pg.user |
|
|
|
pgsql.user |
|
|
|
------- |
|
|
|
---------- |
|
|
|
|
|
|
|
|
|
|
|
Create a PostgreSQL user. |
|
|
|
Work with a PostgreSQL user. |
|
|
|
|
|
|
|
|
|
|
|
- name (str): The user name. |
|
|
|
- name (str): The user name. |
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
- host (str): The host name. |
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
- op (str): The operation to perform: ``create``, ``drop``, ``exists``. |
|
|
|
- host (str): The database host name or IP address. |
|
|
|
- passwd (str): The password for a new user. |
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
- password (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- port (int): The TCP port number. |
|
|
|
|
|
|
|
- user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
[run pg.user command] |
|
|
|
[run pgsql.user command] |
|
|
|
pg.user: name |
|
|
|
pgsql.user: name |
|
|
|
admin_pass: None |
|
|
|
admin_pass: None |
|
|
|
admin_user: postgres |
|
|
|
admin_user: postgres |
|
|
|
host: localhost |
|
|
|
host: localhost |
|
|
|
|
|
|
|
op: create |
|
|
|
password: None |
|
|
|
password: None |
|
|
|
port: 5432 |
|
|
|
port: 5432 |
|
|
|
|
|
|
|
|
|
|
|
psql |
|
|
|
|
|
|
|
---- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Execute a psql command. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- sql (str): The SQL to be executed. |
|
|
|
|
|
|
|
- database (str): The database name. |
|
|
|
|
|
|
|
- admin_pass (str): The password for the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- admin_user (str): The name of the user with sufficient access privileges to execute the command. |
|
|
|
|
|
|
|
- host (str): The database host name or IP address. |
|
|
|
|
|
|
|
- port (int): The port number of the Postgres service running on the host. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: ini |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[run psql command] |
|
|
|
|
|
|
|
psql: sql |
|
|
|
|
|
|
|
database: template1 |
|
|
|
|
|
|
|
host: localhost |
|
|
|
|
|
|
|
password: None |
|
|
|
|
|
|
|
port: 5432 |
|
|
|
|
|
|
|
user: postgres |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
POSIX |
|
|
|
POSIX |
|
|
|
===== |
|
|
|
===== |
|
|
|
|
|
|
|
|
|
|
|