Bug 124531 - PostgreSQL Native Driver: Unable to create view through Base-GUI
Summary: PostgreSQL Native Driver: Unable to create view through Base-GUI
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.1.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Connectivity
  Show dependency treegraph
 
Reported: 2019-04-03 17:00 UTC by Robert Großkopf
Modified: 2024-02-17 10:11 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
View created - image (35.01 KB, image/png)
2022-02-13 05:32 UTC, Stang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2019-04-03 17:00:52 UTC
You need a PostgreSQL-database for testing.

Open a PostgreSQL-database with the native connector of LO.
Have a look at pane "Tables". No possibility to create a view through GUI in the pane "Tables".
Have a look at pane "Queries". No possibility to create a view from an existing query, when clicking with right mousebutton on a query and searching through the content-menue.

Only possibility to create a view is through Tools > SQL.

No problem to create a view through GUI with PostgreSQL and JDBC-driver.

Tested with
Version: 6.2.2.2
Build-ID: 2b840030fec2aae0fd2658d8d4f9548af4e3518d
CPU-Threads: 6; BS: Linux 4.12; UI-Render: Standard; VCL: gtk3; 
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE
Calc: threaded
on OpenSUSE 15 64bit rpm Linux
Comment 1 Michael 2019-04-03 17:29:55 UTC
Same misbehaviour here:
Tested with
Version: 6.1.5.2
Build-ID: 90f8dcf33c87b3705e78202e3df5142b201bd805
CPU-Threads: 4; BS: Linux 4.18; UI-Render: Standard; VCL: kde4;
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group threaded
on kUBUNTU 18.04.2
Comment 2 Robert Großkopf 2019-04-03 17:39:25 UTC
Setting version to 6.1.5.2 and status to NEW. See comment 1.
Comment 3 Alex Thurgood 2019-04-04 16:13:55 UTC
Confirming also with

Version: 6.1.5.2
Build ID: 90f8dcf33c87b3705e78202e3df5142b201bd805
Threads CPU : 4; OS : Mac OS X 10.14.4; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group threaded
Comment 4 Alex Thurgood 2019-04-04 16:24:36 UTC
Note however, that I don't see the possibility to create a view even with a postgres JDBC driver (42.1.1), at least not on Mac
Comment 5 Robert Großkopf 2019-04-04 18:49:21 UTC
(In reply to Alex Thurgood from comment #4)
> Note however, that I don't see the possibility to create a view even with a
> postgres JDBC driver (42.1.1), at least not on Mac

I'm using the JDBC from my distribution OpenSUSE 15: postgresql-jdbc-9.4.jar
I could see both possibilities there: Creating views in pane "Table" and creating views from a query. But this shouldn't be the problem here. The native connector doesn't offer this but it would be possible to create views through Tools > SQL. Why should we provide a native driver if JDBC-driver works in a better way?
Comment 6 Alex Thurgood 2019-04-05 07:27:41 UTC
Hi Robert,

I agree, it was merely to comment on the comparison with JDBC. It turns out, however, that my problem with not seeing Create a View with the JDBC connection was transitory. I'm guessing that LO gets confused when an existing ODB using the native driver has its connection properties switched to JDBC. When I open the JDBC-ODB file today in LO652 I can indeed see the Create View entry under Tables, son confirming the comparison you made as well.
Comment 7 Julien Nabet 2019-05-14 15:26:28 UTC
On Win10 with master sources updated today I could reproduce this.

The feature is disabled here in GetState method:
https://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/app/AppController.cxx?r=b1cfdb7b#661

Now we must dig to know why.
Perhaps related to the fact that we don't encounter
"#include <connectivity/sdbcx/VCollection.hxx>" in postgresql part but it's just a guess.
Comment 8 Julien Nabet 2019-05-14 20:18:50 UTC
I wanted to give a try on Debian but there's no simple tuto for installing and above all configuring Postgresql easily contrary to Windows (at least not like http://www.postgresqltutorial.com/install-postgresql/).
It's a pity to see that often you're supposed to be a config expert if you're on Linux. Sometimes you just want to be guided to test something quickly, and you don't want to read everything on the subject just to install and setup a quick test.
Comment 9 Julien Nabet 2019-05-15 10:26:59 UTC
Adding #include <connectivity/sdbcx/VCollection.hxx> at different locations didn't help.
The more I look at Postgresql implementation in LO, the more it seems to me quite different than other DBs implementations.
I must recognize I'm stuck.
Comment 10 Michael 2020-02-07 09:18:39 UTC
(In reply to Robert Großkopf from comment #0)
> ...
> No problem to create a view through GUI with PostgreSQL and JDBC-driver.
Done the same, using PostgreSQL and _ODBC_-Driver. Result = No problem.
Comment 11 Robert Großkopf 2020-02-09 08:28:17 UTC
> (In reply to Robert Großkopf from comment #0)
> > ...
> > No problem to create a view through GUI with PostgreSQL and JDBC-driver.
> Done the same, using PostgreSQL and _ODBC_-Driver. Result = No problem.

Then we are using different PostgreSQL-connections with ODBC. I can't create a view with ODBC through GUI (as I can't create it through dircet connection). There is no possibility in the menue of the queries (right mouseclick on a query), no possibility in the table pane and no possibility through 
Edit > Create a View

I have changed the summary to refelect this.
Comment 12 Robert Großkopf 2020-02-10 14:41:47 UTC
I have tested it again:
Nothing changed for native driver. There is no possibility to create a view in GUI.
For ODBC the possibility to create a view will appear, if you have already created a view in your database (Tools > SQL). So this is a different bug.
Comment 13 QA Administrators 2022-02-10 03:40:45 UTC Comment hidden (obsolete)
Comment 14 Robert Großkopf 2022-02-10 06:56:29 UTC
Bug is still the same in LO 7.3.0.3 on OpenSUSE 15.3 64bit rpm Linux.
Comment 15 Stang 2022-02-13 05:32:00 UTC
Although only through Tools-> SQL, can create view with native connector using:

PostgreSQL 13.6 (Ubuntu 13.6-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit

Version: 7.3.0.3 / LibreOffice Community
Build ID: 0f246aa12d0eee4a0f7adcefbf7c878fc2238db3
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 16 Stang 2022-02-13 05:32:35 UTC
Created attachment 178251 [details]
View created - image
Comment 17 Michael 2022-02-13 10:26:50 UTC
Thank you @Stang for posts [#15](https://bugs.documentfoundation.org/show_bug.cgi?id=124531#15) and [#16](https://bugs.documentfoundation.org/show_bug.cgi?id=124531#16), but this is not the issue: As Robert Großkopf already had mentioned in the original post
> Only possibility to create a view is through Tools > SQL.
So there is no progress by now ...
Comment 18 Lionel Elie Mamane 2022-02-16 11:29:01 UTC
As far as I remember, it is just not implemented. Would be an enhancement. Also that the system shows views as views, not as tables.
Comment 19 QA Administrators 2024-02-17 03:13:05 UTC Comment hidden (obsolete)
Comment 20 Robert Großkopf 2024-02-17 10:11:34 UTC
Bug is still the same in LO 24.2.0.3 on OpenSUSE 15.4 64bit rpm Linux.