Re: SHOW - Mailing list pgsql-general

From Stephan Bergmann
Subject Re: SHOW
Date
Msg-id 3B94E93F.432272BC@ows.es
Whole thread Raw
In response to Re: SHOW  (bpalmer <bpalmer@crimelabs.net>)
List pgsql-general
Hi!
>
> Hmm, works for me.  What version of Postgres are you using?

I'm using 7.1.3 on Linux (compiled using the sources of pg).

But thanx to the output list of Oliver I now have the result:
how to get the header names of a table using the libpq. It's
very interesting, that using PostgreSQL I need to build a huge
query string:

  sprintf(pgquery2, "SELECT a.attname FROM pg_class c, pg_attribute a
WHERE c.relname = '%s' AND a.attnum > 0 AND a.attrelid = c.oid;",
ThisDBFileName);
  pgres = PQexec(pgsock2, pgquery2);


...when using e.g. MySQL I only need 4 words:

  sprintf(myquery2, "SHOW COLUMNS FROM %s", ThisDBFileName);
  if (mysql_query(mysql2, myquery2)) (...)


Thanx
Steve


pgsql-general by date:

Previous
From: Jerry Asher
Date:
Subject: Re: upgrade from 7.1.2 to 7.1.3 and uh, where are my
Next
From: Eric Kolve
Date:
Subject: many junction tables