Search Postgresql Archives

Re: Multiple atributes with -P switch to psql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stuart,

Thanks for the reply.

You are dead right, and as expected the problem is not with psql.

> $ psql -H  -P tableattr='width="80%" bgcolor="#FFFFFF"'
> 
> works for me. Carefully study my nice simple quoting: single quotes ''
> around the whole
> tableattr='THING' shebang and non-escaped double quotes "" for width
> and bgcolor values.
> 
> Cheers,
> Stuart.
> 

In my defence I did try that exact quoting, the problem is that it is being run from a script. I have thrown together an example to show the problem.
I have not yet worked to a solution.

If you know what it is I would be very greatful.

Allan


#!/bin/bash
set -x

DATABASEHOST="-h jitsnwm"
DATABASEUSER=galvuser
DATABASE=galvdb

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

ED=/usr/local/pgsql/bin

$ED/psql $DATABASEHOST -U $DATABASEUSER -d $DATABASE -q -P footer -P title=Summar
y -H $TABLEOPTIONS <<EOF_SQL

select version();

EOF_SQL

Produces....

postgres@jitsnwm:~/agl/sql> ./z.sh
+ DATABASEHOST=-h jitsnwm
+ DATABASEUSER=galvuser
+ DATABASE=galvdb
+ TABLEOPTIONS=-P border=5 -P tableattr='width="80%" bgcolor="#AFAFAF"'
+ ED=/usr/local/pgsql/bin
+ /usr/local/pgsql/bin/psql -h jitsnwm -U galvuser -d galvdb -q -P footer -P title=Summary -H -P border=5 -P 'tableattr='\''width="80%"' 'bgcolor="#AFAFAF"'\'''
<table border="5" 'width="80%">
  <caption>Summary</caption>
  <tr>
    <th align="center">version</th>
  </tr>
  <tr valign="top">
    <td align="left">PostgreSQL 8.2.0 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.3 (SuSE Linux)</td>
  </tr>
</table>



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.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux