Re: SHOW

From: Stephan Bergmann <sb(at)ows(dot)es>
To: Doug McNaught <doug(at)wireboard(dot)com>
Cc: Joe Conway <joseph(dot)conway(at)home(dot)com>, bpalmer <bpalmer(at)crimelabs(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: SHOW
Date: 2001-09-04 14:46:23
Message-ID: 3B94E93F.432272BC@ows.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • Re: SHOW at 2001-09-04 14:35:07 from Doug McNaught

Browse pgsql-general by date

  From Date Subject
Next Message Eric Kolve 2001-09-04 14:52:59 many junction tables
Previous Message Doug McNaught 2001-09-04 14:35:07 Re: SHOW