Bug 52388 - EDITING - postgresql data not writable, updatable, modifiable using built-in connector
Summary: EDITING - postgresql data not writable, updatable, modifiable using built-in ...
Status: CLOSED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5.5.3 release
Hardware: x86-64 (AMD64) macOS (All)
: high major
Assignee: Lionel Elie Mamane
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-23 10:33 UTC by Alex Thurgood
Modified: 2013-02-11 18:26 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Test ODB with native postgres connector (4.66 KB, application/vnd.oasis.opendocument.database)
2012-07-23 16:07 UTC, Alex Thurgood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Thurgood 2012-07-23 10:33:22 UTC
Using LibreOffice :

LibreOffice 3.5.5.3 
Version ID : 7122e39-92ed229-498d286-15e43b4-d70da21

I can not edit/update/modify/write to any tables in my postgresql database.

Additionally, the driver does not distinguish between Views and Tables (probably side-effect of the general "writable" problem).



Also tested with :
Version 3.7.0.0.alpha0+ (Build ID: 8c05d8b)

Same result, no table data can be edited.

Used XTuple demo database.

If I use the postgres JDBC connector (postgresql-8.4-702.jdbc3.jar), I can edit/update/write to the same demo database without any problems.


Alex
Comment 1 Lionel Elie Mamane 2012-07-23 12:54:20 UTC
> I can not edit/update/modify/write to any tables in my postgresql database.

Cannot reproduce with my production database.

 - What is the PostgreSQL server version

 - please attache a
   pg_dump of an affected database (--format=plain)

 - which table / query / ... do you try to edit data from, how (form?
   double-click on table?)

 - attach the .odb file you use to access the database
Comment 2 Lionel Elie Mamane 2012-07-23 13:08:34 UTC
(In reply to comment #0)

> Additionally, the driver does not distinguish between Views and Tables
> (probably side-effect of the general "writable" problem).

No, that's just "feature not implemented yet".
Comment 3 Alex Thurgood 2012-07-23 16:07:33 UTC
Created attachment 64554 [details]
Test ODB with native postgres connector
Comment 4 Alex Thurgood 2012-07-23 16:08:03 UTC
(In reply to comment #2)
> (In reply to comment #0)
> 

> No, that's just "feature not implemented yet".


Ah OK :-))
Comment 5 Alex Thurgood 2012-07-23 16:22:13 UTC
(In reply to comment #1)
> > I can not edit/update/modify/write to any tables in my postgresql database.
> 
> Cannot reproduce with my production database.
> 
>  - What is the PostgreSQL server version
> 
>  - please attache a
>    pg_dump of an affected database (--format=plain)
> 
>  - which table / query / ... do you try to edit data from, how (form?
>    double-click on table?)
> 
>  - attach the .odb file you use to access the database


Output from pg_config :
pg_config
BINDIR = /usr/bin
DOCDIR = /usr/share/doc/postgresql
HTMLDIR = /Library/WebServer/Documents/postgresql
INCLUDEDIR = /usr/include
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/server
LIBDIR = /usr/lib
PKGLIBDIR = /usr/lib/postgresql
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/man
SHAREDIR = /usr/share/postgresql
SYSCONFDIR = /private/etc/postgresql
PGXS = /usr/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--prefix=/usr' '--sbindir=/usr/libexec' '--sysconfdir=/private/etc' '--localstatedir=/var/pgsql' '--htmldir=/Library/WebServer/Documents/postgresql' '--enable-thread-safety' '--enable-dtrace' '--with-tcl' '--with-perl' '--with-python' '--with-gssapi' '--with-krb5' '--with-pam' '--with-ldap' '--with-bonjour' '--with-openssl' '--with-libxml' '--with-libxslt' '--with-system-tzdata=/usr/share/zoneinfo' 'CFLAGS=-arch x86_64 -arch i386 -pipe -Os -g -Wall -Wno-deprecated-declarations' 'LDFLAGS=-arch x86_64 -arch i386 -pipe -Os -g -Wall -Wno-deprecated-declarations' 'LDFLAGS_EX=-mdynamic-no-pic'
CC = gcc
CPPFLAGS = -I/usr/include/libxml2
CFLAGS = -arch x86_64 -arch i386 -pipe -Os -g -Wall -Wno-deprecated-declarations -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv
CFLAGS_SL = 
LDFLAGS = -arch x86_64 -arch i386 -pipe -Os -g -Wall -Wno-deprecated-declarations -Wl,-dead_strip_dylibs
LDFLAGS_EX = -mdynamic-no-pic
LDFLAGS_SL = 
LIBS = -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm 
VERSION = PostgreSQL 9.0.5



The dump of the demo DB from XTuple is 33 Mb, so can't upload it here.

Alex
Comment 6 Alex Thurgood 2012-07-23 16:52:00 UTC
(In reply to comment #1)

> 
>  - which table / query / ... do you try to edit data from, how (form?
>    double-click on table?)


The following tables from the XTuple db are writable with the JDBC connector :

All of the tables in "fixcountry".
All of the tables in "te"
All of the tables in "xtdesktop"
All of the tables in "xtpos"
All but 29 of the 284 tables in "public"

The ones which are not writable are all defined as Views.


 Alex
Comment 7 Lionel Elie Mamane 2012-07-23 17:02:55 UTC
(In reply to comment #5)
> (In reply to comment #1)
>>> I can not edit/update/modify/write to any tables in my postgresql database.

>> Cannot reproduce with my production database.

>>  - please attach a
>>    pg_dump of an affected database (--format=plain)

> The dump of the demo DB from XTuple is 33 Mb, so can't upload it here.

The best would be to DROP tables and/or DELETE data until the dump is small enough that you can upload here.

Alternatively:

 - give me (by private email if needed) a link to a download

 - a "pg_dump --schema-only" might show me what the trouble is.

 - another kind of partial dump, but I need *all* information about at least one affected table,
   including (and especially) index / key structure and privileges (ACLs). Option "--table=FOO"
   might work well enough for that.
Comment 8 Alex Thurgood 2012-07-23 17:16:05 UTC
(In reply to comment #7)



> Alternatively:
> 
>  - give me (by private email if needed) a link to a download
> 


I'll e-mail you a link to an online disk space you can download the dump file from.


Alex
Comment 9 Lionel Elie Mamane 2012-07-26 09:41:09 UTC
Cannot reproduce with:

 - LibO branch feature/base-preview, PostgreSQL 9.1.3 (Debian package)
 - LibO branch libreoffice-3-6, PostgreSQL 9.1.3 (Debian package)
 - LibO branch libreoffice-3-6, PostgreSQL 9.0.6 (Debian package)
 - LibO 3.5.5.3 (official x86-64 deb binaries), PostgreSQL 9.1.3 (Debian package)

Exact things I tried to reproduce:

# create a PostgreSQL cluster to isolate testing from my production database
# edit provided dump so that it does not muck with postgres role
# (and set it to a password I don't know)
# remove line "ALTER ROLE postgres (...)"
$ sudo -u postgres psql -f 2unub51GIdbNpz6Fiyw2Fa 
$ sudo -u postgres psql -c "ALTER ROLE admin UNENCRYPTED PASSWORD 'admin';"
# open attachment.cgi?id=64554 in LibO
# double-click on table public.acalitem
# first row, where acalitem_id=170, change acalitem_periodlength to 34.
# move to another row

I always connect as user "admin" since that's what the .odb provides by default. If you test with another user, play say which.


1) You might have an older PostgreSQL-SDBC installed as en extension? Remove it.
2) please connect to PostgreSQL with the program psql: psql -Uadmin demo
3) it should say something like:


    psql (9.1.3, server 9.0.6)
    Type "help" for help.

    Please give me the version numbers it gives above.

4) issue command:
    select version();
    what does it say?

5) issue command:
    \d+ public.acalitem
    what does it say?

6) issue command:
    \dp public.acalitem
    what does it say?
Comment 10 Alex Thurgood 2012-07-27 06:38:17 UTC
(In reply to comment #9)
> Cannot reproduce with:
> 
>  - LibO branch feature/base-preview, PostgreSQL 9.1.3 (Debian package)
>  - LibO branch libreoffice-3-6, PostgreSQL 9.1.3 (Debian package)
>  - LibO branch libreoffice-3-6, PostgreSQL 9.0.6 (Debian package)
>  - LibO 3.5.5.3 (official x86-64 deb binaries), PostgreSQL 9.1.3 (Debian
> package)
> 


Will check later today and report back, but FWIW, it works for me too on Linux Ubuntu 12.04. This may well be Mac specific...


Alex
Comment 11 Lionel Elie Mamane 2012-10-14 17:05:18 UTC
Alex? Any news on this bug? Does it work on Mac for you, too, now?
Comment 12 Alex Thurgood 2012-10-15 07:00:21 UTC
Oh, sorry, I'd forgotten about this one, been a bit rushed recently. Let me check again and get back to you.


Alex
Comment 13 fred 2012-10-17 14:57:42 UTC
hello
I am facing the problem described by alex
I had a few tests on differents postgresql configurations & servers
The problem occurs only when host is not localhost
all databases connected on my local machine works well (can edit / update... rows)
but this is impossible on distant servers
Did some tests on pg roles : table owner or not, superuser or not... the issue is the same
hope this could by solved soon ;-)
(I manage a database migration and I hope tu use LOO for database interfaces)
thanks for you answer
fred
Comment 14 Lionel Elie Mamane 2012-10-17 15:20:26 UTC
(In reply to comment #13)
> I am facing the problem described by alex

What version of LibreOffice on what OS?
What version of PostgreSQL client libs?
What version of PostgreSQL server?
What connect string?
Comment 15 fred 2012-10-17 16:59:44 UTC
>What version of LibreOffice on what OS?
LibreOffice 3.5.4.2 
Version ID : 350m1(Build:2)
on ubuntu 12.04 (32bits)

>What version of PostgreSQL client libs?
LOO postgresql sdbc built-in connector
I don't know if it uses the libpq library

>What version of PostgreSQL server?
tested with postgresql-8.3, 8.4 & 9.1

>What connect string?
host=[host] dbname=[mydb]

what else ? ;-)
Comment 16 Lionel Elie Mamane 2012-10-18 08:18:20 UTC
(In reply to comment #15)

>> What version of LibreOffice on what OS?

> LibreOffice 3.5.4.2 
> Version ID : 350m1(Build:2)
> on ubuntu 12.04 (32bits)

You are using the Ubuntu package or packages downloaded from www.libreoffice.org? That makes a difference because the Ubuntu packages (I presume) use "system" libpq from ubuntu package, but the www.libreoffice.org downloads use a bundled libpq.

>> What version of PostgreSQL client libs?
> LOO postgresql sdbc built-in connector
> I don't know if it uses the libpq library

It uses libpq; my question was "what version of libpq".

Did you uninstall any "old" PostgreSQL SDBC connector extension? There should be no reference to anything PostgreSQL in menu tools / extension manager.

>> What version of PostgreSQL server?
> tested with postgresql-8.3, 8.4 & 9.1

PostgreSQL 8.3: not supported

PostgreSQL 8.4 and 9.1: should work; if not, it is a bug. I'd like to fix it, thanks for keeping along.


Could you please give the information asked in comment 9, replacing public.acalitem by a table you try to update, and "admin" by the user you are connecting as? Thanks.
Comment 17 Lionel Elie Mamane 2012-12-06 18:56:34 UTC
@fred: could you please give the info I asked in comment 9? Right now, I can't reproduce this problem, so cannot work on fixing it.
Comment 18 Alex Thurgood 2013-02-11 17:42:52 UTC
This is WFM now on a locally hosted instance of postgres 9.2.3 on OSX Server, using LO 4.0.0 release for Mac OSX and the built-in SDBC connector.


Am inclined to close this as RESOLVED WFM. Lionel, what do you reckon ?


Alex
Comment 19 Lionel Elie Mamane 2013-02-11 18:00:05 UTC
Original reporter cannot reproduce anymore -> closing
Comment 20 Alex Thurgood 2013-02-11 18:25:37 UTC
Closing
Comment 21 Alex Thurgood 2013-02-11 18:26:31 UTC
Just for added info, also tested on LO365 for OSX and it works there too.