Bug 152450 - PostgreSQL JDBC: Creating query - table alias is always appended by GUI, special settings wont work here
Summary: PostgreSQL JDBC: Creating query - table alias is always appended by GUI, spec...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.4.3.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-10 07:55 UTC by Robert Großkopf
Modified: 2023-06-01 03:19 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2022-12-10 07:55:48 UTC
Open a JDBC-connection to PostgreSQL.
Create a query by the GUI.
Switch design view off.
Code is like this:
SELECT * FROM "public"."Table1" "Table1"
There is an alias for "public"."Table1".

Close the editor (query isn't needed any more).
Go to Edit → Database → Advanced Settings → Special Settings
"Append the table alias name on SELECT statements" isn't set.
You could set this or unset this - there is no difference while creating a query in GUI.

This isn't only a "cosmetical" problem, because of https://bugs.documentfoundation.org/show_bug.cgi?id=130376
An autoincremented value won't be shown in PostgreSQL if query is created with an alias. 
Every time you open a query in Design mode the alias will be set. So you have to change to direct SQL code and remove the alias to get a query, which will run with autoincremented values.
Comment 1 Stéphane Guillou (stragu) 2023-05-30 21:55:36 UTC
I tried following the steps in:

Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

... but couldn't as "Advanced Settings" was greyed out in the Edit > Database menu.

Can you please provide more precise, sequential steps, Robert?
And test in 7.5 as well to see if the situation is the same.
Thank you!
Comment 2 Robert Großkopf 2023-05-31 07:44:04 UTC
(In reply to Stéphane Guillou (stragu) from comment #1)
> 
> ... but couldn't as "Advanced Settings" was greyed out in the Edit >
> Database menu.
> 
It will be greyed out, if you connect to PostgreSQL with the internal driver of LO.
Have a look at the statusbar, down in left corner: PostgreSQL

This bug appears when connecting by JDBC. Statusbar will show JDBC and a connecting string like this appears in the statusbar:
postgresql://localhost:5432/<name of your database>

Connecting by JDBC will show "Advanced Settings".
Comment 3 QA Administrators 2023-06-01 03:19:21 UTC Comment hidden (obsolete)