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.

Bug 149631

Summary: Exception message appears by attempt to truncate PostgreSQL table
Product: db Reporter: Roman Mostyka <romanmostyka>
Component: Show DataAssignee: jawed <jawed>
Status: VERIFIED FIXED    
Severity: blocker CC: sustaining
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Screenshot of exception message.

Description Roman Mostyka 2008-10-09 14:00:31 UTC
1. Connect to PostgreSQL.
2. Open SQL editor and execute following statement:
"create table travel."test-test" ("i-d" int);".
3. Rightclick newly create tabgle and choose "View Data".
4. Insert some data and then press "Truncate table".

Result: Exception message appears.
Comment 1 Roman Mostyka 2008-10-09 14:02:18 UTC
Created attachment 71462 [details]
Screenshot of exception message.
Comment 2 _ ahimanikya 2008-10-09 18:16:11 UTC
Did you commit the data you inserted before trying to truncate the table?
Comment 3 Roman Mostyka 2008-10-09 18:26:55 UTC
Yes, I commited. But I did it with SQL editor, but not with "Insert Record" dialog.
Comment 4 _ ahimanikya 2008-10-10 10:14:27 UTC
Can you do the step 4 first and then step 3...
Comment 5 _ ahimanikya 2008-10-10 10:19:58 UTC
Since we are holding one connection that is used by all sub-components such as sqleditor, dataview etc. 

I think somehow the connection is getting corrupted. 

Anyway, I think this is a P3
Comment 6 Roman Mostyka 2008-10-13 09:44:58 UTC
Ahi, what do you mean "Can you do the step 4 first and then step 3"? As I understand we have "Truncate Table" button
only in data view window, so I can't do step 4 before step 3. Or you mean to do step 3 after step 4 again (as step 5)?
And I really don't agree that it is P3. If connection is getting corrupted right after it was established it isn't good.
And in case of PostgreSQL "Truncate Table" functionality doesn't work at all, at least I don't know any workaround.
Actually it can be even P1, since functionality doesn't work for DB, which is supported by Sun (in Solaris).
Comment 7 jawed 2008-11-04 11:56:03 UTC
space between "truncate table" and fully qualified table name was missing hence truncate statement generated was not
understood by PostgreSQL.
http://hg.netbeans.org/main/rev/3ee8f45eecec
Comment 8 Roman Mostyka 2008-11-06 20:00:37 UTC
Verified with build 081105.
Comment 9 rbalada 2008-11-18 13:47:32 UTC
I've transplanted the changeset http://hg.netbeans.org/main/rev/3ee8f45eecec into release65_fixes repository as
http://hg.netbeans.org/release65_fixes/rev/0291802572cb