Multiple atributes with -P switch to psql

Поиск
Список
Период
Сортировка
От Harvey, Allan AC
Тема Multiple atributes with -P switch to psql
Дата
Msg-id E97A5BB7699CAD48BE2711E712471165479FE8@ntlmsg03.onesteel.com
обсуждение исходный текст
Ответы Re: Multiple atributes with -P switch to psql  ("Stuart Cooper" <stuart.cooper@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "Jasbinder Singh Bali"
Дата:
Сообщение: Exception handling in plperl
Следующее
От: "Stuart Cooper"
Дата:
Сообщение: Re: Multiple atributes with -P switch to psql