Re: How to query information schema from shell script

From: William Leite Araújo <william(dot)bh(at)gmail(dot)com>
To: "Jon Horsman" <horshaq(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to query information schema from shell script
Date: 2006-10-27 13:55:24
Message-ID: bc63ad820610270655h5bbc4fd4n797a7ea3d7e3bcdd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jon Horsman 2006-10-27 13:57:27 Re: How to query information schema from shell script
Previous Message George Pavlov 2006-10-27 13:47:40 Re: How to query information schema from shell script