Bug 45251 - EDITING postgreSQL-SDBC Can not set Primary Key via Table editor / new tablewizard / new table in design mode
Summary: EDITING postgreSQL-SDBC Can not set Primary Key via Table editor / new tablew...
Status: RESOLVED DUPLICATE of bug 49708
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5.0 RC2
Hardware: x86-64 (AMD64) Linux (All)
: low enhancement
Assignee: Lionel Elie Mamane
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-25 22:03 UTC by Drew Jensen
Modified: 2013-07-25 07:34 UTC (History)
5 users (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 Drew Jensen 2012-01-25 22:03:14 UTC
Tested on Ubuntu 11.04, Libo3.5 RC2, Postgres 8.4 and 9.1

Open an ODB connected to a psql server.
Open a table property dialog for a table w/o a Primary Key
No way to create one.
Comment 1 Lionel Elie Mamane 2012-02-02 02:28:17 UTC
Confirmed.

Setting to "enhancement" since AFAIK this never worked with PostgreSQL-SDBC in the past.

Setting low priority as I'm going to focus on data manipulation issues before data definition issues. (data definition can conceivably be done with SQL statements rather than GUI and/or separate PostgreSQL-specific GUI).
Comment 2 Drew Jensen 2012-02-02 06:27:22 UTC
same situation with the new table wizard, the set primary key ability is never displayed. 

Would you prefer I open a new issue?
Comment 3 Lionel Elie Mamane 2012-02-02 06:34:56 UTC
(In reply to comment #2)
> same situation with the new table wizard, the set primary key ability is never
> displayed. 

> Would you prefer I open a new issue?

Nah, it is most probably all the same bug and root cause.
Comment 4 Alex Thurgood 2013-02-11 09:15:02 UTC
I got this message in the console when I saved a table definition using the Table Designer in my 32bit build from LO master (08/02/2013) :

NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "country_pkey" for table "country"

and a primary key was automatically created on the INT(4) field.

There is however something strange here : although I used the GUI to specify that this field should be autoincremented, and although it seemed to accept that value and save it as such, in reality it did not, and the first time I tried to enter data into the table by Tab switching from the INT field to my varchar fields, I got an error on saving the tuple, with postgres complaining about a field mismatch. When I checked the table definition again, I saw that the SERIAL function had not been set on that field.

Will open a separate bug report against that.

Alex
Comment 5 Robert Großkopf 2013-07-24 19:41:02 UTC
You could not change any field in a created table using PostgreSQL and SDBC (and also with other external databases). I have tested the following:
Tools → SQL
CREATE TABLE test ( id INT, name VARCHAR(50) );
Refreshed the table-container.
Opened the table for changing.
Added a field and switched it to primary-key.
Works.

My system: LO 4.1.0.4, OpenSUSE 12.3 64bit rpm
Comment 6 Lionel Elie Mamane 2013-07-24 22:13:25 UTC
(In reply to comment #5)
> You could not change any field in a created table using PostgreSQL and SDBC.
> I have tested the following:
> Tools → SQL
> CREATE TABLE test ( id INT, name VARCHAR(50) );
> Refreshed the table-container.
> Opened the table for changing.
> Added a field and switched it to primary-key.
> Works.

I'm not sure I understand completely. Are you saying this bug is fixed?
Comment 7 Robert Großkopf 2013-07-25 06:26:39 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > You could not change any field in a created table using PostgreSQL and SDBC.
> > I have tested the following:
> > Tools → SQL
> > CREATE TABLE test ( id INT, name VARCHAR(50) );
> > Refreshed the table-container.
> > Opened the table for changing.
> > Added a field and switched it to primary-key.
> > Works.
> 
> I'm not sure I understand completely. Are you saying this bug is fixed?

I have understand the description as followed:
It is impossible to set a primary-key in the table editor for a table, which hasn't a primary key. I have tested this with PostgreSQL and the direct driver. I could create a new field in the table and set this field to a primary key. I'm using LO 4.1.0.4.
Could it be the same reason like
https://bugs.freedesktop.org/show_bug.cgi?id=49708 ?

It doesn't work in LO 4.0.3.3!
Comment 8 Lionel Elie Mamane 2013-07-25 07:34:25 UTC
(In reply to comment #7)
> (In reply to comment #6)

>> I'm not sure I understand completely. Are you saying this bug is fixed?

> I have understand the description as followed:
> I have tested this with PostgreSQL and the direct
> driver. I could create a new field in the table and set this field to a
> primary key. I'm using LO 4.1.0.4.
> Could it be the same reason like
> https://bugs.freedesktop.org/show_bug.cgi?id=49708 ?

Probably. Assuming it is. If anybody can still reproduce with LibreOffice 4.1.0.2 or later or with LibreOffice 4.0.5, then reopen.

*** This bug has been marked as a duplicate of bug 49708 ***