Newbie Questions (need your help) easy questions for you gurus.
Newbie Questions (need your help) easy questions for you gurus.
(OP)
Hello everyone.
I have couple of newbie questions, if you could kindly help.
here they are:
1. what is the command to get a list of the
database and tables in each database in postgres?
2. How do I get a list of all the primary keys on a table ?
3. How do I get a list of all the foriegn keys on a table ?
4. How do I get a list of all the indexes on a table ?
5. How do I get a description on a table in postgres (like field defenitions).
6. How do I find out the list of users with access to a specific table / database (get user privilages on each db)?
7. How do I get a list of all the valid table fileds TYPES in postgres?
thank you all very much.
I have couple of newbie questions, if you could kindly help.
here they are:
1. what is the command to get a list of the
database and tables in each database in postgres?
2. How do I get a list of all the primary keys on a table ?
3. How do I get a list of all the foriegn keys on a table ?
4. How do I get a list of all the indexes on a table ?
5. How do I get a description on a table in postgres (like field defenitions).
6. How do I find out the list of users with access to a specific table / database (get user privilages on each db)?
7. How do I get a list of all the valid table fileds TYPES in postgres?
thank you all very much.
RE: Newbie Questions (need your help) easy questions for you gurus.
If you have a windows box in the same network as your postgres database, the easy way is to download pgAdmin II. It is a GUI that will give you all the info you want and lots more with easy point and click functionality.
If you have a stand alone Linux System, give phpPgAdmin a try. It is a browser base tool that can be used with your Apache Web Server. It is written in php so you would need to download php and install it and configure you apache web server. PhpPgAdmin is a little more difficult to set up, but once done it can be used as easily from a remote location and locally. I'm sure there are folks here that can help you set up phpPgAdmin.
Both of these tools make database administration of a postgres server easy.
Also, you might take a look at the postgres html doc. as it has all the command needed to accomplish what you want. However, obtaining the info from an command prompt that is connected to a postgres server is the hard way to do it.
Leland F. Jackson, CPA
Software - Master (TM)
http://www.smvfp.com
Nothing Runs Like the Fox
RE: Newbie Questions (need your help) easy questions for you gurus.
http://www.postgresql.org/idocs/index.php?catalogs.html
RE: Newbie Questions (need your help) easy questions for you gurus.
>1. what is the command to get a list of the
database and tables in each database in postgres?
\l (or 'psql -l' from the terminal)
>2. How do I get a list of all the primary keys on a table ?
>3. How do I get a list of all the foriegn keys on a table ?
>4. How do I get a list of all the indexes on a table ?
>5. How do I get a description on a table in postgres (like field defenitions).
\d tablename will give you all table attribs
or, to be more specific:
\dt Show Tables
\dT list datatypes
\df list functions
\di list indexes
\dv list views
>6. How do I find out the list of users with access to a specific table / database (get user privilages on each db)?
\dp [object name]
>7. How do I get a list of all the valid table fileds TYPES in postgres?
See \dT above
Try \? from inside the psql command line for additional info, and also try psql --help for more commandline switches.
-------------------------------------------
"Now, this might cause some discomfort..."
(http://www.wired.com/news/politics/0,1283,51274,00.html)
RE: Newbie Questions (need your help) easy questions for you gurus.