Multiple atributes with -P switch to psql

From: "Harvey, Allan AC" <HarveyA(at)OneSteel(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Multiple atributes with -P switch to psql
Date: 2007-03-14 02:59:30
Message-ID: E97A5BB7699CAD48BE2711E712471165479FE8@ntlmsg03.onesteel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

Trying to get psql to produce multiple table attributes in the <table> tag when psql is used with the -H switch.

eg
TABLEOPTIONS="-P border=5 -P tableattr=width=\"80%\""
psql $DATABASEHOST -U $DATABASEUSER -d $DATABASE -q -P footer -P title=Summary -H $TABLEOPTIONS

produces
...
<table border="5" width="80%">
...

As expected.

TABLEOPTIONS="-P border=5 -P tableattr=width=\"80%\" -P tableattr=bgcolor=\"#FFFFFF\""

produces
...
<table border="5" bgcolor="#FFFFFF">
...

Seems to hang on to the last.

And
TABLEOPTIONS="-P border=5 -P tableattr=\"width=\"80%\" bgcolor=\"#FFFFFF\"\""

produces
...
<table border="5" "width="80%">
...

My quoting of the quotes is wrong but the point is that the quote to encapsulate the white space for the tablattr is placed into the HTML produced.

It maybe that you can only pass one table attribute or that I'm missing something.
I favour the latter.

Calls are from within a bash script.

Can anyone set me straight?

version
-------------------------------------------------------------------------------------
PostgreSQL 8.2.0 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.3 (SuSE Linux)
(1 row)

Thanks

Allan

The material contained in this email may be confidential, privileged or copyrighted. If you are not the intended recipient, use, disclosure or copying of this information is prohibited. If you have received this document in error, please advise the sender and delete the document. Neither OneSteel nor the sender accept responsibility for any viruses contained in this email or any attachments.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jasbinder Singh Bali 2007-03-14 03:23:03 Exception handling in plperl
Previous Message Jeff Davis 2007-03-14 00:58:02 Re: OT: Canadian Tax Database