Multiple atributes with -P switch to psql - Mailing list pgsql-general

From Harvey, Allan AC
Subject Multiple atributes with -P switch to psql
Date
Msg-id E97A5BB7699CAD48BE2711E712471165479FE8@ntlmsg03.onesteel.com
Whole thread Raw
Responses Re: Multiple atributes with -P switch to psql  ("Stuart Cooper" <stuart.cooper@gmail.com>)
List 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
placedinto 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,
pleaseadvise the sender and delete the document. Neither OneSteel nor the sender accept responsibility for any viruses
containedin this email or any attachments.
 

pgsql-general by date:

Previous
From: "Jasbinder Singh Bali"
Date:
Subject: Exception handling in plperl
Next
From: "Stuart Cooper"
Date:
Subject: Re: Multiple atributes with -P switch to psql