From: | Rob Sargentg <robjsargent(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Appending a newline to a column value - in a psql cronjob |
Date: | 2012-01-13 13:55:22 |
Message-ID: | 4F1037CA.7080302@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 01/13/2012 05:11 AM, Alexander Farber wrote:
> Hello!
>
> I'm using PostgreSQL 8.4.9 on CentOS 6.2 and with bash.
>
> The following cronjob works well for me
> (trying to send a mail to myself - for moderation):
>
> 6 6 * * * psql -c "select
> 'http://mysite/user.php?id=' ||id, about from pref_rep where
> length(about)> 1 and last_rated> now() - interval '1 day'"
>
> but I can't figure out how to append a newline to the
> 1st value (because otherwise the line is too long
> and I have to scroll right in my mail reader):
>
> What I've tried sofar:
>
> # history
> 1001 psql -c "select 'http://mysite/user.php?id=' ||id||'\n', about from .....
> 1002 psql -c "select 'http://mysite/user.php?id=' ||id||'\\n', about
> from .....
> 1003 psql -c "select 'http://mysite/user.php?id=' ||id|| "\\n",
> about from .....
> 1004 psql -c "select 'http://mysite/user.php?id=' ||id|| \"\\n\",
> about from .....
> 1005 psql -c "select 'http://mysite/user.php?id=' ||id|| \"\n\",
> about from .....
> 1006 psql -c "select 'http://mysite/user.php?id=' ||id|| \'\n\',
> about from .....
>
> Thank you
> Alex
>
Given that it's a constant, I would just drop the http header :)
From | Date | Subject | |
---|---|---|---|
Next Message | David Johnston | 2012-01-13 14:02:52 | Re: Appending a newline to a column value - in a psql cronjob |
Previous Message | Edwin Quijada | 2012-01-13 12:42:16 | Re: Compiling C function with VC++ for Windows version |