def tablespace_create(name, location, options=None, owner=None, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None):
 owner_query = ''
 options_query = ''
 if owner:
  owner_query = 'OWNER "{0}"'.format(owner)
 if options:
  optionstext = ['{0} = {1}'.format(k, v) for (k, v) in six.iteritems(options)]
  options_query = 'WITH ( {0} )'.format(', '.join(optionstext))
 query = 'CREATE TABLESPACE "{0}" {1} LOCATION \'{2}\' {3}'.format(name, owner_query, location, options_query)
 ret = _psql_prepare_and_run(['-c', query], user=user, host=host, port=port, maintenance_db=maintenance_db, password=password, runas=runas)
 return (ret['retcode'] == 0)

def tablespace_create ( name , location , options = None , owner = None , user = None , host = None , port = None , maintenance_db = None , password = None , runas = None ) : owner_query = '' options_query = '' if owner : owner_query = 'OWNER "{0}"' . format ( owner ) if options : optionstext = [ '{0} = {1}' . format ( k , v ) for ( k , v ) in six . iteritems ( options ) ] options_query = 'WITH ( {0} )' . format ( ', ' . join ( optionstext ) ) query = 'CREATE TABLESPACE "{0}" {1} LOCATION \'{2}\' {3}' . format ( name , owner_query , location , options_query ) ret = _psql_prepare_and_run ( [ '-c' , query ] , user = user , host = host , port = port , maintenance_db = maintenance_db , password = password , runas = runas ) return ( ret [ 'retcode' ] == 0 )
adds a tablespace to the postgres server .