This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | "Show SQL Script for INSERT" Doesn't Include All Columns | ||
---|---|---|---|
Product: | db | Reporter: | olehoppe <olehoppe> |
Component: | Show Data | Assignee: | matthias42 |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | -FFJ- | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
olehoppe
2015-02-17 16:07:02 UTC
Thank you for your report. I know that "It's not a bug, but a feature" sounds lame, but here it is the case. This is what happens: When generating the insert, the columns are enumerated and checked whther they are autoincrement values or "normal" values. Autoincrement values are not part of the insert (for example derby does not allow inserts into autoincrement columns). In your case you might be faced with a bug in the postgresql driver. The relevant section is this: boolean autoIncrement = rsMeta.isAutoIncrement(i); This returns true for your email column. If you run this code: try( Connection con = DriverManager.getConnection(url, user, password); Statement statement = con.createStatement(); ResultSet result = statement.executeQuery("select * FROM customers"); ) { ResultSetMetaData meta = result.getMetaData(); System.out.println("#\tcolumn\tautoincrement"); for(int i = 1; i <= meta.getColumnCount(); i++) { System.out.println(String.format("%d\t%s\t%b", i, meta.getColumnName(i), meta.isAutoIncrement(i) )); } } you get this: # column autoincrement 1 id true 2 firstname false 3 middleinitials false 4 lastname false 5 address1 false 6 address2 false 7 city false 8 state false 9 zip false 10 zipext false 11 country false 12 phone false 13 email true 14 emailvalid false 15 wantscatalog false 16 wantsenews false 17 wantsereceipt false 18 wantseinfo false 19 wantseoffers false 20 birthmonth false 21 birthday false 22 isrewardsclubmember false 23 createdat false 24 modifiedat false This is plainly not true - email is _not_ autoincrement, although it could be argued, that it is generated. |