Check for table existence - Mailing list pgsql-sql

From Michael Knudsen
Subject Check for table existence
Date
Msg-id 3C055B7E.BB52F0F1@but.auc.dk
Whole thread Raw
Responses Re: Check for table existence  (Alexander Steinert <stony8@gmx.de>)
Re: Check for table existence  (Haller Christoph <ch@rodos.fzk.de>)
Re: Check for table existence  (Roberto Mello <rmello@cc.usu.edu>)
List pgsql-sql
Hi group

First, let me say that I am new to postgres. I used MySQL before, but..
ehm..

I am trying to do a small program (in C), and I have stumbled on to some
problems:
1. How can I check if a given table exists?2. How can I check if a given existing table has the right layout? (Correct
column names and types)

Currently, I check using something like:
select * from giventable limit 0;

but that only helps checking if the table exists and if the number of
columns is correct. I'm sure, there must be a smoother way to do this, but I
cannot seem to find it. Anyone out there with good ideas?

M.
-- 
Rumour is information distilled so finely that it can filter through
anything.
-- (Terry Pratchett, Feet of Clay)


pgsql-sql by date:

Previous
From: Markus Bertheau
Date:
Subject: Re: Fixing faulty dates - select on day part of a date field
Next
From: Roberto Mello
Date:
Subject: Re: PL/pgSQL loops?