Bug 265155 - QPSQL: Unable to create query (WARNING: nonstandard use of \\ in a string literal)
Summary: QPSQL: Unable to create query (WARNING: nonstandard use of \\ in a string lit...
Status: RESOLVED INTENTIONAL
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: 1.4.90
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 267807 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-02 02:19 UTC by Ivan D Vasin
Modified: 2011-09-19 02:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
output from the initial ``akonadictl start`` (24.29 KB, text/plain)
2011-02-02 02:19 UTC, Ivan D Vasin
Details
Akonadi Server Self-Test report (8.88 KB, text/plain)
2011-02-02 02:20 UTC, Ivan D Vasin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan D Vasin 2011-02-02 02:19:13 UTC
Created attachment 56771 [details]
output from the initial ``akonadictl start``

Version:           1.4.90 (using KDE 4.6.0) 
OS:                Linux



Reproducible: Always

Steps to Reproduce:
1. move or remove $HOME/.local/share/akonadi and $HOME/.config/akonadi.
2. create a user and a database for Akonadi on the PostgreSQL server.
3. use akonaditray to configure Akonadi to use the PostgreSQL database driver.
4. $ akonadictl start

Actual Results:  
the output, which is attached, contains many error messages like this:

WARNING:  nonstandard use of \\ in a string literal
[...]
QPSQL: Unable to create query

performing operations in Akonadi-powered applications produces many more of these.  otherwise they seem to work normally, but i haven't tested too extensively.

Expected Results:  
Akonadi starts up cleanly using the QPSQL backend.

the database server is PostgreSQL 8.4.6 running on localhost.
Comment 1 Ivan D Vasin 2011-02-02 02:20:14 UTC
Created attachment 56772 [details]
Akonadi Server Self-Test report
Comment 2 Christophe Marin 2011-02-02 10:55:42 UTC
Curious. what does this return: grep standard_conforming_strings ~/.local/share/akonadi/db_data/postgresql.conf
Comment 3 Ivan D Vasin 2011-02-02 20:34:16 UTC
(In reply to comment #2)
> Curious. what does this return: grep standard_conforming_strings
> ~/.local/share/akonadi/db_data/postgresql.conf

$ grep standard_conforming_strings ~/.local/share/akonadi/db_data/postgresql.conf
standard_conforming_strings = on
Comment 4 Christophe Marin 2011-02-03 18:19:09 UTC
Reading your last comment on bug 264383, now I understand why you get the error.

Using an external Postgres server is not supported.

You may add standard_conforming_strings = on to your system postgresql config.
Comment 5 Ivan D Vasin 2011-02-03 19:01:53 UTC
(In reply to comment #4)
> Using an external Postgres server is not supported.

then why is it an option in AkonadiTray?  why is it, in fact, the only option?

are you implying that Akonadi can be configured to run its own postgres process?

for MySQL, there is a checkbox in AkonadiTray to "Use internal MySQL server", but there is no such option for PostgreSQL.  simply clearing all of the settings for the external server and running ``akonadictl start`` triggers an error, "Cannot connect to PostgreSQL server.", and subsequent related errors.

i don't see anything obvious in $HOME/.config/akonadi/akonadiserverrc that would indicate a setting to use an internal server.  after clearing external server settings via AkonadiTray, for my QPSQL section i have:

[QPSQL]
Name=
Host=
User=
Password=
Port=
Options=
ServerPath=/usr/lib/postgresql/8.4/bin/pg_ctl
InitDbPath=/usr/lib/postgresql/8.4/bin/initdb
StartServer=true

> You may add standard_conforming_strings = on to your system postgresql config.

indeed, this resolves the issue.  thanks!
Comment 6 Christophe Marin 2011-02-03 19:23:11 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Using an external Postgres server is not supported.
> 
> then why is it an option in AkonadiTray?  why is it, in fact, the only option?
> 
> are you implying that Akonadi can be configured to run its own postgres
> process?
> 

Yes. For both backends, the default is to start an instance of the chosen database.

A minimalist akonadiserverrc is enough to use the internal postgres solution:

[%General]
Driver=QPSQL
Comment 7 Christophe Marin 2011-03-09 10:25:40 UTC
*** Bug 267807 has been marked as a duplicate of this bug. ***
Comment 8 Christophe Marin 2011-09-19 02:31:45 UTC
Git commit 423c5e76820a905233ed49b0d75b8d7c00420732 by Christophe Giboudeaux.
Committed on 19/09/2011 at 04:31.
Pushed by cgiboudeaux into branch 'master'.

Indicate which setting must be turned on if an external PSQL server is used.
CCBUG: 265155

M  +8    -0    kcm/serverconfigmodule.cpp
M  +8    -0    kcm/serverpsqlstorage.ui

http://commits.kde.org/kdepim-runtime/423c5e76820a905233ed49b0d75b8d7c00420732