pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: William Leite Araújo <william.bh@gmail.com>
To: Jon Horsman <horshaq@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: How to query information schema from shell script
Date: Fri, 27 Oct 2006 10:55:24 -0300
Message-ID: <bc63ad820610270655h5bbc4fd4n797a7ea3d7e3bcdd@mail.gmail.com> (raw)
In-Reply-To: <4f4c2a010610270631q73de201tb98446f64b942a0e@mail.gmail.com>
References: <4f4c2a010610270631q73de201tb98446f64b942a0e@mail.gmail.com>

     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@gmail.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

view thread (11+ messages)  latest in thread

Message-ID: <bc63ad820610270655h5bbc4fd4n797a7ea3d7e3bcdd@mail.gmail.com>
Permalink:  ../bc63ad820610270655h5bbc4fd4n797a7ea3d7e3bcdd@mail.gmail.com/
Also on:    postgresql.org/message-id/bc63ad820610270655h5bbc4fd4n797a7ea3d7e3bcdd@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: william.bh@gmail.com, horshaq@gmail.com
  Subject: Re: How to query information schema from shell script
  In-Reply-To: <bc63ad820610270655h5bbc4fd4n797a7ea3d7e3bcdd@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox