[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: long postgresql string
From: |
Ben Pfaff |
Subject: |
Re: long postgresql string |
Date: |
Fri, 28 May 2010 20:36:31 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Dr Eberhard W Lisse <address@hidden> writes:
> I have managed to compile PSPP with PostgreSQL support on Ubuntu 10.04
> the standard version came without it and can run simple queries, however
> when I run something like the below (shortened) it wants the whole SQL
> statement in one line, and that line must be less than 255 characters,
> which defeats the purpose:
You can use + to concatenate parts of a string and split strings
across lines, as in:
GET DATA /TYPE=PSQL
/CONNECT='host=localhost port=5432 dbname=epp '
/SQL="SELECT ip, clid, date(created) AS eppdate, " +
"CASE WHEN request ILIKE '%poll op=%' THEN 'poll' " +
"WHEN request ILIKE '%<login%' THEN 'login' " +
"WHEN request ILIKE '%<logout%' THEN 'logout' " +
"ELSE 'other' " +
"END AS epprequest " +
"FROM epp_log".
I can't think of a good reason for the 255-character limit. I
think it must be a relic from before PSPP added support for long
string values. I've pushed out a change that removes this
restriction to the "master" branch.
--
"Writing is easy.
All you do is sit in front of a typewriter and open a vein."
--Walter Smith