You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Tapio Koskinen (JIRA)" <ji...@apache.org> on 2019/08/12 14:10:00 UTC

[jira] [Comment Edited] (NETBEANS-1140) Can't insert or delete records on non-default schema

    [ https://issues.apache.org/jira/browse/NETBEANS-1140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16905238#comment-16905238 ] 

Tapio Koskinen edited comment on NETBEANS-1140 at 8/12/19 2:09 PM:
-------------------------------------------------------------------

I think this is caused by call to getSchemaName() returning empty string in org.netbeans.modules.db.dataview.meta.DBMetaDataFactory#generateDBTables ([https://github.com/apache/netbeans/blob/master/ide/db.dataview/src/org/netbeans/modules/db/dataview/meta/DBMetaDataFactory.java]).

PostgreSQL's JDBC code and related discussion: [https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSetMetaData.java] [https://github.com/pgjdbc/pgjdbc/issues/538]

Maybe schema name could be parsed from the query string? Seems a bit hacky/non-trivial, but something like that is already done for Oracle in DBMetaDataFactory#adjustTableMetadata().


was (Author: milanka):
I think this is caused by call to getSchemaName(i) returning empty string in org.netbeans.modules.db.dataview.meta.DBMetaDataFactory#generateDBTables (https://github.com/apache/netbeans/blob/master/ide/db.dataview/src/org/netbeans/modules/db/dataview/meta/DBMetaDataFactory.java).

PostgreSQL's JDBC code and related discussion: [https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSetMetaData.java] [https://github.com/pgjdbc/pgjdbc/issues/538]

Maybe schema name could be parsed from the query string? Seems a bit hacky/non-trivial, but something like that is already done for Oracle in DBMetaDataFactory#adjustTableMetadata().

> Can't insert or delete records on non-default schema
> ----------------------------------------------------
>
>                 Key: NETBEANS-1140
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-1140
>             Project: NetBeans
>          Issue Type: Bug
>    Affects Versions: 9.0
>            Reporter: Tapio Koskinen
>            Priority: Minor
>
> There are some tables in "quartz" schema (PostgreSQL database). Other tables are in "public" schema. In Services-component I can right click those tables, select "View Data..." and table's data is displayed. If I now try to delete a selected record, I get error "Error code 0, SQL state 42P01 Delete command filed: ERROR: relation "qrtz_cron_triggers" does not exist Position: 13"
> PostgreSQL's log has:
> 2018-08-15 09:56:03.795 EEST [16908] ERROR: relation "qrtz_cron_triggers" does not exist at character 13
> 2018-08-15 09:56:03.795 EEST [16908] STATEMENT: DELETE FROM "qrtz_cron_triggers" WHERE "sched_name" = $1 AND "trigger_name" = $2 AND "trigger_group" = $3 
> 2018-08-15 09:56:03.795 EEST [16908] LOG: execute S_1: ROLLBACK
>  
> So it seems that the schema name is not included in the query when issuing delete statements. Using "Insert Record(s)" functionality fails with the same "relation does not exist" error.
> Records can be removed manually if schema name is included.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists