Bug 60643 - EDITING - postgresql-SDBC GUI autoincrement setting not saved in Table Design mode
Summary: EDITING - postgresql-SDBC GUI autoincrement setting not saved in Table Design...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
(earliest affected) Master
Hardware: All All
: medium normal
Assignee: Not Assigned
: 125186 133349 (view as bug list)
Depends on:
Blocks: Database-Tables
  Show dependency treegraph
Reported: 2013-02-11 09:33 UTC by Alex Thurgood
Modified: 2022-02-17 14:56 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:
Regression By:


Note You need to log in before you can comment on or make changes to this bug.
Description Alex Thurgood 2013-02-11 09:33:14 UTC
Tested on Linux 32bit master :
 Version (Build ID: 7e2f34a3172a756a0fd70cae1294250206945a6)

When using the Table Design mode, one can set a field to be AUTOINCREMENT. In postgres this is the SEQUENCE or SERIAL function. However, setting an INT(4) field to AUTO in the Table Design mode and then saving the table does not provide the appropriate statement or activate the corresponding postgres function.

The table then has to be modified by hand separately using an ALTER TABLE statement.

Comment 1 Alex Thurgood 2013-02-11 09:34:05 UTC
Adding Lionel to CC.
Comment 2 Lionel Elie Mamane 2013-02-11 17:40:26 UTC
This happens in connectivity/source/commontools/dbtools2.cxx, function dbtools::createStandardColumnPart, around lines 90-91 and 171-175. This generates the SQL for creating the new column. That code pretty much expects to be able to just stack some text behind the:

 "colName" colType NOT NULL

and that would magically make it an autoincrement column. Alas, that is not how it happens in PostgreSQL; we need to either explicitly create the sequence and set the default value to
OR change colType to one of smallserial, serial or bigserial (depending on the underlying type: int2, int4 or int8). See http://www.postgresql.org/docs/9.2/static/datatype-numeric.html#DATATYPE-SERIAL

Since dbtools::createStandardColumnPart merrily ignores the auto_increment (column 12) of getTypeInfo(), we cannot even use that at the pgsql-sdbc level to assert *some* control.

So, "any" solution will have to happen by a redesign of dbtools::createStandardColumnPart, and probably some new SDBCX interface that drivers would have to implement.
Comment 3 Joel Madero 2013-02-13 18:18:31 UTC
Marking as NEW as Lionel appears to have confirmed the issue
Comment 4 Alex Thurgood 2015-01-03 17:40:23 UTC Comment hidden (no-value)
Comment 5 QA Administrators 2016-01-17 20:02:51 UTC Comment hidden (obsolete)
Comment 6 Alex Thurgood 2016-07-26 13:21:27 UTC
Still present in

Build ID: 36e61d03a252e73139a472c5be04ffc54a5c8efb
CPU Threads: 2; OS Version: Mac OS X 10.11.6; UI Render: default; 
Locale: fr-FR (fr.UTF-8); Calc: group
Comment 7 QA Administrators 2017-09-01 11:16:19 UTC Comment hidden (obsolete)
Comment 8 Alex Thurgood 2017-09-15 14:05:48 UTC
Still present in

Build ID: ea7cb86e6eeb2bf3a5af73a8f7777ac570321527
CPU threads: 4; OS: Mac OS X 10.12.6; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group
Comment 9 Alex Thurgood 2018-07-17 12:28:46 UTC
Still present in 

Build ID: c838ef25c16710f8838b1faec480ebba495259d0
Threads CPU : 8; OS : Mac OS X 10.13.5; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group
Comment 10 Alex Thurgood 2019-05-13 06:22:16 UTC
*** Bug 125186 has been marked as a duplicate of this bug. ***
Comment 11 Alex Thurgood 2019-12-02 13:18:24 UTC
Still present in 

Build ID: a64200df03143b798afd1ec74a12ab50359878ed
Threads CPU : 8; OS : Mac OS X 10.14.6; UI Render : par défaut; VCL: osx; 
Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Calc: threaded
Comment 12 Robert Großkopf 2020-07-07 18:56:15 UTC
*** Bug 133349 has been marked as a duplicate of this bug. ***