Tim Roberts timr at
Wed Jan 15 08:28:18 CET 2003

Dave Roberts <dvrbts at> wrote:

>Does anyone know how to shift postgres into html table mode from inside
>From inside postgres it's simple:  \pset format html

That is NOT used "from inside postgres".  Rather, it is used inside psql,
which is a completely separate command-line utility that happens to talk to
the postgres server, just as PyGreSQL does.

>However, all my attempts to pass postgres that string from inside
>PyGreSQL seem to get trapped by the interpreter.  I'm trying to use
>python cgi scripts to present queries, and since the output is going to
>stdout (the browser), if I could just kick postgres into html it would
>be self-presenting.

Right.  Postgres doesn't understand the backslash commands, psql does.  You
are talking directly to postgres, so you will have to do the formatting
- Tim Roberts, timr at
  Providenza & Boekelheide, Inc.

More information about the Python-list mailing list