Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: How to query information schema from shell script



     You can use "-c" option of psql client.
     Ex.: psql -p 5000 -d database -c "SELECT * FROM information_schema.tables WHERE table_schema = 'public'"

   

2006/10/27, Jon Horsman <horshaq(at)gmail(dot)com>:
Hey,

I'm trying to figure out how i can query the postgres information
schema from a bourne shell script on linux.  I need to know if a
user/table exists.  Does someone mind giving me a quick example of how
this works, is this possible?

Thanks,

Jon.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster



--
William Leite Araújo


Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group