> 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?

% for tn in `psql -Umnp -dmnp_gp -hstgdb0 -tA -c"select table_name from
information_schema.tables where table_name like 'employee%'"`; do
for> echo FOUND TABLE $tn
for> done
FOUND TABLE employee_role
FOUND TABLE employee

hope this helps,

george

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to