Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any equivalent of sp_help in postgres

In SQL server, if i write command like this -

EXEC SP_HELP EmployeeMaster

it'll return my table fields and all the default constraint defined on it. Now i just wants to know that is there any kind of command in postgres like above ?

Although i know to get just table fields in postgres, you can use below query.

select column_name from information_schema.columns where table_name = 'EmployeeMaster'
like image 890
Krishnraj Rana Avatar asked Jan 24 '14 07:01

Krishnraj Rana


1 Answers

No, there's nothing like that server-side. Most of PostgreSQL's descriptive and utility commands are implemented in the psql client, meaning they are not available to other client applications.

You will need to query the information_schema to collect the information you require yourself if you need to do this in a client app.

If you're using PgAdmin-III, well, psql is a useful and powerful tool, well worth learning.

like image 138
Craig Ringer Avatar answered Sep 22 '22 14:09

Craig Ringer