This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Postgresql creation problem

Tags: None
(comma "," separated)
muscatelle
Registered Member
Posts
17
Karma
0

Postgresql creation problem

Sat Oct 20, 2018 6:05 am
I'm using KMyMoney 5 and would like to use a postgresql database backend.
Have created a database xyz, owned by the linux user jeff but on trying to "save as database" get the message below

Cannot open or create database sql://jeff@localhost/xyz?driver=QPSQL.
Retry Save As Database and click Help for further info

About KMyMoney lists installed libraries as:
KDE Frameworks 5.44.0
Qt 5.9.5 (built against 5.9.5)
The xcb windowing system

Any thoughts would be greatly appreciated
muscatelle
Registered Member
Posts
17
Karma
0

Re: Postgresql creation problem

Tue Oct 23, 2018 12:16 pm
Postgresql log below indicate that the request is getting through to postgresql, but the output seems contradictory.


2018-10-23 22:38:01.748 ACDT [2732] tonbaz@/zigtrust FATAL: database "/zigtrust" does not exist
2018-10-23 22:38:01.760 ACDT [2733] tonbaz@template1 ERROR: database "zigtrust" already exists
2018-10-23 22:38:01.760 ACDT [2733] tonbaz@template1 STATEMENT: CREATE DATABASE zigtrust WITH ENCODING='UTF8' LC_CTYPE='C' TEMPLATE=template0;
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS

Re: Postgresql creation problem

Tue Oct 23, 2018 12:58 pm
Can you check if the problem is still present or fixed by running KMyMoney from an appImage. It is easy to do:
  • Download the appimage file provided on the page mentioned above
  • Make the appimage file executable (chmod +x ...)
  • Start the appimage ( ./kmymoney--....appimage ) and see if it still fails or not
It would be cool to get information about the results. If you have problems to get this working let us know.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
muscatelle
Registered Member
Posts
17
Karma
0

Re: Postgresql creation problem

Thu Oct 25, 2018 10:06 am
Thanks

I get the message below using kmymoney--98d7cb7-x86_64.appimage:

Cannot save to current database: Error in function void MyMoneyStorageSqlPrivate::createTable(const MyMoneyDbTable&, int) : creating table/index kmmSchedules
Driver = QPSQL, Host = localhost, User = tonbaz, Database = zigtrust
Driver Error:
Database Error No -1:
Text:
Error type 0
Executed:
Query error No 42703: ERROR: column "N" does not exist
(42703) QPSQL: Unable to create query
Error type 2 /home/appimage/workspace/KMyMoney_Nightly_Appimage_Build/kmymoney/kmymoney/plugins/sql/mymoneystoragesql_p.h:2553

The tables below were created
kmmaccounts
kmmaccountspayeeidentifier
kmmbudgetconfig
kmmcostcenter
kmmcurrencies
kmmfileinfo
kmminstitutions
kmmkeyvaluepairs
kmmonlinejobs
kmmpayeeidentifier
kmmpayees
kmmpayeespayeeidentifier
kmmplugininfo
kmmprices
kmmreportconfig
kmmschedulepaymenthistory
muscatelle
Registered Member
Posts
17
Karma
0

Re: Postgresql creation problem

Thu Oct 25, 2018 10:20 pm
And from the log:

2018-10-25 20:13:40.367 ACDT [21025] tonbaz@zigtrust ERROR: column "N" does not exist
2018-10-25 20:13:40.367 ACDT [21025] tonbaz@zigtrust STATEMENT: CREATE TABLE kmmSchedules (id varchar(32) NOT NULL, name text NOT NULL, type int2 NOT NULL check(type >= 0), typeString text, occurence int2 NOT NULL check(occurence >= 0), occurenceMultiplier int2 NOT NULL check(occurenceMultiplier >= 0), occurenceString text, paymentType int2 check(paymentType >= 0), paymentTypeString text, startDate date NOT NULL, endDate date, fixed char(1) NOT NULL,
lastDayInMonth char(1) NOT NULL DEFAULT "N", autoEnter char(1) NOT NULL, lastPayment date, nextPaymentDue date, weekendOption int2 NOT NULL check(weekendOption >= 0), weekendOptionString text, PRIMARY KEY (id));

I ran the statement successfully using 'N' rather than "N" on PostgreSQL 10
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS

Re: Postgresql creation problem

Fri Oct 26, 2018 3:08 pm
I have changed the source to use single quotes as per muscatelle's investigation. See the git repo for the commit details.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
muscatelle
Registered Member
Posts
17
Karma
0
Thanks,

Downloaded the nightly build #69 App image (https://binary-factory.kde.org/job/KMyM ... _Build/69/) and it loaded into the database without a problem
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS

Re: Postgresql creation problem  Topic is solved

Sun Oct 28, 2018 7:50 pm
Thanks for the feedback. Can you mark this as solved, please? TIA.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]