Is there an equivalent to sp_help in postgres

In SQL server, if I write a command like this -

EXEC SP_HELP EmployeeMaster

it will return the fields of my table and all the default restrictions set by default. Now I just want to know that in postgres, like above, is there some kind of command?

Although I know that I only get table fields in postgres, you can use the query below.

select column_name from information_schema.columns where table_name = 'EmployeeMaster'
+4
source share
3 answers

No, there is nothing like the server side. Most of the PostgreSQL descriptive and utility commands are implemented in the client psql, that is, they are not available for other client applications.

information_schema, , .

PgAdmin-III, , psql - , .

+3

, Describe Table Postgres, ,

0

You can use pg_constraint, pg_class, pg_attribute to get the result. See here for more details.

0
source

Source: https://habr.com/ru/post/1523472/


All Articles