# Method Sql.pgsql()->list_fields()

Method list_fields

  ``final` `array`(`mapping`(`string`:`mixed`)) list_fields(`void`|`string` `table`, `void`|`string` `glob`)`

Returns

  A mapping, indexed on the column name, of mappings describing the attributes of a table of the current database. The currently defined fields are:

  ``"schema"` : `string`` | Schema the table belongs to
  ``"table"` : `string`` | Name of the table
  ``"kind"` : `string`` | Type of table
  ``"owner"` : `string`` | Tableowner
  ``"rowcount"` : `int`` | Estimated rowcount of the table
  ``"datasize"` : `int`` | Estimated total datasize of the table in bytes
  ``"indexsize"` : `int`` | Estimated total indexsize of the table in bytes
  ``"name"` : `string`` | Name of the column
  ``"type"` : `string`` | A textual description of the internal (to the server) column type-name
  ``"typeoid"` : `int`` | The OID of the internal (to the server) column type
  ``"length"` : `string`` | Size of the columndatatype
  ``"default"` : `mixed`` | Default value for the column
  ``"is_shared"` : `int`` | If the table has any indices
  ``"has_index"` : `int``
  ``"has_primarykey"` : `int`` | If the table has a primary key

Parameter `glob`

  If specified, list only the tables with matching names. Setting it to `*` will include system columns in the list.