Save LOB doesn't work

Right-clicking on a LOB column and choosing 'Save LOB...' brings up the file chooser to choose the file to save the LOB in, but nothing actually gets saved. I set the maximum LOB size to larger then the LOB field but that didn't fix anything. I've tried both with the release Datagrip 2017.1 and the latest EAP 2017.2.

1
10 comments

Hi,

Could you provide example DDL, specify your database and jdbc driver and specify the file you're trying to save?

Thank you.

0

SQL Server (Microsoft) driver - 6.0.8112.100

SQL Server 2012

The file is a gzipped PDF.

The field is defined like this: 'compressedBinaryObjectLOB image'

Double-clicking on the field gives a hex dump that can be scrolled through. Right-clicking and choosing 'Save LOB...' gives you a file save selector but then does nothing. No file is saved.

1

Hi,

A possible fix will be available in DataGrip 2017.2 RC2 or in DataGrip 2017.2.

Thank you

0

DataGrip 2017.2 RC2 fixed the problem. The LOB saves now.

1

This seems to be broken again - using PyCharm 2020.3.3 with PostgreSQL 11 (Amazon Aurora).

Trying to save a big json value from a field.

0

@... please send us IDE logs or at least error you got when saving. along with a size of 'big value'.

0

@... thanks for getting back to me.  It was a 244kb JSON object.  I got no error - just status message "0 rows returned" and no content in the file.

Is there a how-to somewhere on isolating relevant logs for the action, or enabling a debug mode whilst I do it?

Thanks

Nick

0

If you switch to 'output' tab there should be a query executed. what's there?

please reproduce the issue and attach database.log file from Help -> Show SQL log.

also it would be nice to see table DDL and example of json that won't be saved.

0

There's no table DDL as such (or at least, a lot).  The JSON column is produced by a procedure.  It returns a single column/row with JSON.

frodi.public> select intf_lambda_hitachi.schedule()
[2021-02-04 17:14:27] 1 row retrieved starting from 1 in 4 s 268 ms (execution: 4 s 130 ms, fetching: 138 ms)
frodi.public> select intf_lambda_hitachi.stock_allocations('VT')
[2021-02-04 17:14:37] 1 row retrieved starting from 1 in 187 ms (execution: 172 ms, fetching: 15 ms)
frodi.public> select intf_lambda_hitachi.stock_allocations('VT')
[2021-02-04 17:14:51] 0 rows retrieved in 163 ms (execution: 161 ms, fetching: 2 ms)

Same thing from SQL Log:

-- 2021-02-04 17:14:37 [mistral] [Mistral 4a: Production] [console: console [Mistral 4a: Production]] [session id: 451342533] [statement id: 184884196] 
select intf_lambda_hitachi.stock_allocations('VT')
-- ] --------------------------------------------------
-- 2021-02-04 17:14:37 [mistral] [Mistral 4a: Production] [console: console [Mistral 4a: Production]] [session id: 451342533] [statement id: 184884196] results received
-- 2021-02-04 17:14:37 [mistral] [Mistral 4a: Production] [console: console [Mistral 4a: Production]] [session id: 451342533] [statement id: 184884196] finished - execution time: 169 ms, fetching time: 18 ms, total result sets count: 1
-- [ --------------------------------------------------
-- 2021-02-04 17:14:50 [mistral] [Mistral 4a: Production] [console: console [Mistral 4a: Production]] [session id: 451342533] [statement id: 184884197]
select current_database() as a, current_schemas(false) as b
-- ] --------------------------------------------------
-- 2021-02-04 17:14:50 [mistral] [Mistral 4a: Production] [console: console [Mistral 4a: Production]] [session id: 451342533] [statement id: 184884197] results received
-- 2021-02-04 17:14:50 [mistral] [Mistral 4a: Production] [console: console [Mistral 4a: Production]] [session id: 451342533] [statement id: 184884197] finished - execution time: 19 ms, fetching time: 4 ms, total result sets count: 1
-- [ --------------------------------------------------
-- 2021-02-04 17:14:50 [mistral] [Mistral 4a: Production] [console: console [Mistral 4a: Production]] [session id: 451342533] [statement id: 184884198]
select intf_lambda_hitachi.stock_allocations('VT')
-- ] --------------------------------------------------
-- 2021-02-04 17:14:51 [mistral] [Mistral 4a: Production] [console: console [Mistral 4a: Production]] [session id: 451342533] [statement id: 184884198] results received
-- 2021-02-04 17:14:51 [mistral] [Mistral 4a: Production] [console: console [Mistral 4a: Production]] [session id: 451342533] [statement id: 184884198] finished - execution time: 159 ms, fetching time: 4 ms, total result sets count: 1

When I click on "save lob" I get the file dialogue, then the status message says '0 rows retrieved' (the original query shows 1 row, which is correct).  

I have just tried saving a JSONB LOB from a simple select on a table  - that worked, and I get the status message in the bottom right of the screen - I also note the execution says '1 row retrieved'.  

So, is it possible this just doesn't work with functions?  I tried this:

CREATE TEMP TABLE lob
AS (SELECT intf_lambda_hitachi.stock_allocations('VT'));

SELECT *
FROM lob;

...and got the same behaviour as direct from the function (i.e. no rows retrieved).  

Then I tried this:

select 1, * from intf_lambda_hitachi.stock_allocations('VT')

..and bingo, lob file created successfully.

Not such a horrible workaround - is it to do with how the IDE tries to uniquely identify the row it wants for the second query?

I like this feature because it lets me temporarily grab a bigger lob than the IDE is configured to show in the result grid.  That works fine with this workaround.

1

IDE has several issues with Save LOB functionality.
Could you vote and comment to the issue https://youtrack.jetbrains.com/issue/DBE-11429?

0

Please sign in to leave a comment.