pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Knudsen <mk267673@but.auc.dk>
To: pgsql-sql@postgresql.org
Subject: Check for table existence
Date: Wed, 28 Nov 2001 22:47:42 +0100
Message-ID: <3C055B7E.BB52F0F1@but.auc.dk> (raw)

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)



view thread (4+ messages)  latest in thread

Message-ID: <3C055B7E.BB52F0F1@but.auc.dk>
Permalink:  ../3C055B7E.BB52F0F1@but.auc.dk/
Also on:    postgresql.org/message-id/3C055B7E.BB52F0F1@but.auc.dk

 · 

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: mk267673@but.auc.dk
  Subject: Re: Check for table existence
  In-Reply-To: <3C055B7E.BB52F0F1@but.auc.dk>

* 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