mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 01:30:25 +00:00
support 'owner' argument to tablespace_create
This commit is contained in:
parent
9b5526a680
commit
278c2e4ce8
1 changed files with 4 additions and 1 deletions
|
@ -174,7 +174,7 @@ def tablespace_exists(name, user=None, host=None, port=None, maintenance_db=None
|
||||||
return name in tablespaces
|
return name in tablespaces
|
||||||
|
|
||||||
|
|
||||||
def tablespace_create(name, location, user=None, host=None, port=None,
|
def tablespace_create(name, location, owner=None, user=None, host=None, port=None,
|
||||||
maintenance_db=None, password=None, runas=None):
|
maintenance_db=None, password=None, runas=None):
|
||||||
'''
|
'''
|
||||||
Adds a tablespace to the Postgres server.
|
Adds a tablespace to the Postgres server.
|
||||||
|
@ -186,6 +186,8 @@ def tablespace_create(name, location, user=None, host=None, port=None,
|
||||||
salt '*' postgres_ext.tablespace_create tablespacename '/path/datadir'
|
salt '*' postgres_ext.tablespace_create tablespacename '/path/datadir'
|
||||||
'''
|
'''
|
||||||
query = 'CREATE TABLESPACE {0} LOCATION \'{1}\''.format(name, location)
|
query = 'CREATE TABLESPACE {0} LOCATION \'{1}\''.format(name, location)
|
||||||
|
if owner is not None:
|
||||||
|
query += ' OWNER \'{1}\''.format(owner)
|
||||||
|
|
||||||
# Execute the command
|
# Execute the command
|
||||||
ret = _psql_prepare_and_run(['-c', query],
|
ret = _psql_prepare_and_run(['-c', query],
|
||||||
|
@ -252,3 +254,4 @@ def tablespace_remove(name, user=None, host=None, port=None,
|
||||||
maintenance_db=maintenance_db,
|
maintenance_db=maintenance_db,
|
||||||
password=password)
|
password=password)
|
||||||
return ret['retcode'] == 0
|
return ret['retcode'] == 0
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue