Issue 57377 - No editing of fields possible in postgressql tables without primary key
Summary: No editing of fields possible in postgressql tables without primary key
Status: CLOSED WONT_FIX
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 2.0
Hardware: All Linux, all
: P3 Trivial with 2 votes (vote)
Target Milestone: ---
Assignee: christoph.lukasiak
QA Contact: issues@dba
URL:
Keywords: needmoreinfo
Depends on:
Blocks:
 
Reported: 2005-11-04 18:45 UTC by sparg
Modified: 2006-05-31 14:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description sparg 2005-11-04 18:45:00 UTC
I have encountered errors when updating numeric fields using JDBC drivers for
Postgres 8; and now also the same error using Microsoft's JDBC driver for MS SQL
server updating money fields.

Error from SQL server as follows: 

[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Disallowed implicit
conversion from data type nvarchar to data type money, table
'traindb.dbo.stocktransactions', column 'stockvalue'. Use the CONVERT function
to run this query.

It seems OpenOffice is sending incorrect data types for numeric/money fields to
JDBC drivers. This issue is probably the same as 51965 and 56921.

So JDBC access is currently broken for business applications.
Comment 1 christoph.lukasiak 2006-02-07 16:23:01 UTC
1. may you add a step by step description leading to the problem
2. for postgres may you try this alternative driver:
http://dba.openoffice.org/drivers/postgresql/index.html#install_2.0

p.s. can you imagine, that your driver mismach the jdbc standards in some cases? ;)
Comment 2 sparg 2006-02-18 20:00:10 UTC
I have tried again to recreate this issue but it now seems different. I can read
my postgres database through the JDBC driver. I can also add columns to tables.
But I cannot edit any column, irrespective of data type. I'm using openoffice
2.0.1 under Linux.

Step by step is as follows:

1. From a working postgres installation run the following SQL e.g. from psql to
create and populate a test table

create table transtable (
id bigint,
description varchar(50),
value numeric(20,2)
);

insert into transtable values (1, 'The first transaction', 200.54);
insert into transtable values (2, 'The second transaction', 153.48);

2. Download the jdbc driver from jdbc.postgresql.org/download.html I used the
8.1-405.jdbc3.jar file to match my Postgres 8.1.2 installation

3. Add the postgres-jdbc driver jar file to openoffice in
Tools-options-java-Classpath-Add Archive

4. Restart openoffice for the JDBC driver to be recognised

5. Use create a new database wizard, connect to an existing JDBC database
Datasource URL: jdbc:postgresql://127.0.0.1:5432/testdb (in my case)

user, enter username known to postgres with sufficient permissions e.g. postgres.

JDBC driver class: org.postgresql.Driver

6. Click Test Class - Should report that driver loaded successfully

7. Click test connection - Ensure connection is established correctly before
proceeding.

8. Next click on Tables and double click on transtable. The two rows inserted
above should be returned.

9. Try to edit one of the fields

I am aware that there is a postgres SDBC driver project, but JDBC should work!
Also as I had the same problem with MSSQL and the Microsoft JDBC driver this
suggests a wider issue with JDBC and OpenOffice than one driver not following
the JDBC standards. The postgres driver I used is the 'official' one and does
work when accessed through Java. I don't know enough about JDBC to know how
closely it follows the JDBC standard.
Comment 3 christoph.lukasiak 2006-04-11 15:53:02 UTC
clu->sparg: you have written that the behavior changes - has it changed for both
drivers (also MSSQL)? bugs must be reproducable - may you recheck it if it still
occurs in current version?

please also read: http://qa.openoffice.org/issue_handling/basic_rules.html

p.s. sorry, but at the moment you are the only one with this problem, jdbc in
general works fine and so this must be a special (local?) problem we have to
investigate further

thx
Comment 4 christoph.lukasiak 2006-04-12 15:36:04 UTC
clu->sparg: after further investigation i found out that the described problem
occurs if no primary key is set in the table (postgres sql) -> no editing of
data possible
Comment 5 christoph.lukasiak 2006-04-12 15:38:58 UTC
=> close

do not hestitate to reopen issue if you do not agree or you have anything to add

thx