#NEWLINE# def tablespace_list( user = None , host = None , port = None , maintenance_db = None , password = None , runas = None ) : #NEWLINE# #INDENT# "\n    Return dictionary with information about tablespaces of a Postgres server.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' postgres.tablespace_list\n\n    .. versionadded:: 2015.8.0\n    " #NEWLINE# ret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# query = 'SELECT spcname as "Name", pga.rolname as "Owner", spcacl as "ACL", spcoptions as "Opts", pg_tablespace_location(pgts.oid) as "Location" FROM pg_tablespace pgts, pg_roles pga WHERE pga.oid = pgts.spcowner' #NEWLINE# rows = __salt__ [ 'postgres.psql_query' ] ( query , runas = runas , host = host , user = user , port = port , maintenance_db = maintenance_db , password = password ) #NEWLINE# for row in rows : #NEWLINE# #INDENT# ret [ row [ 'Name' ] ] = row #NEWLINE# ret [ row [ 'Name' ] ] . pop ( 'Name' ) #NEWLINE# #UNINDENT# return ret