How to display messages from SQL functions and query run timer?

I'm trying to switch from pgAdmin to DataGrip for managing my postgres databases and I can't find some basic things:

First, I'd like to see messages coming from RAISE NOTICE etc. inside functions. Is there a panel for that? I don't see anything until a function completes executing. Tried looking at Output window, Database event log, General event log - nothing there.

Second, I can't see a timer while running a query, so I can't really tell how long the query is taking until it's finished. That's very handy in pgAdmin, but I can't find it anywhere in DataGrip. Is there an option for that?

Third, I don't completely understand the difference between database consoles and files. I can run a query in a database console, but I can't run it from a file in the same way. When I hit run in a file, DataGrip offers me to run my query in a new or existing console. How can I run queries directly from files without spawning new consoles, or cluttering existing ones? My workflow is quite simple - I keep all my .sql files in a git repo folder and just want to both edit and run queries direclty from files.

4 comments
Comment actions Permalink

Hello Nick,

>First, I'd like to see messages coming from RAISE NOTICE etc. inside functions. Is there a panel for that? I don't see anything until a function completes executing. Tried looking at Output window, Database event log, General event log - nothing there.

Please vote and follow related request: https://youtrack.jetbrains.com/issue/DBE-1884 . Currently RAISE NOTICE will show up only when procedure finishes.

>Second, I can't see a timer while running a query, so I can't really tell how long the query is taking until it's finished. That's very handy in pgAdmin, but I can't find it anywhere in DataGrip. Is there an option for that?

Note possible currently, please vote for https://youtrack.jetbrains.com/issue/DBE-269

>Third, I don't completely understand the difference between database consoles and files. I can run a query in a database console, but I can't run it from a file in the same way. When I hit run in a file, DataGrip offers me to run my query in a new or existing console. How can I run queries directly from files without spawning new consoles, or cluttering existing ones? My workflow is quite simple - I keep all my .sql files in a git repo folder and just want to both edit and run queries direclty from files.

When you are executing the query for the first time for the sql file, DataGrip asks you at this point to choose the database connection (i.e. attach currently opened Editor with the sql file to the Database SQL Console, which represents database connection). After you choose one and IDE connects to this database there is indication in the Editor appears:

The sql statement which will be sent to execution is framed and status bar shows the connection which is attached to opened Editor tab (the Procedure Editor). From this moment this editor is associated with this database connection. You can change this association at any time:

So one may think of it as SQL Console, but it is just the same Procedure Editor.

It works in such a way that you don't need to change opened editor or jump into any other window. The code stays where it was (in the editor and is not copied into the SQL Console) so you can execute it from the file.

0
Comment actions Permalink

Ok, voted for the first one, second one is a broken link.

I hope these features will land before my trial period ends:) It's kinda hard to decide if switching from pgAdmin worth it or not, because DataGrip has excellent code completion/git integration from one side, but lacks things like query timer / realtime messages and some more specific like listed triggers and custom types in database panel. Any plans for those?

0
Comment actions Permalink

>second one is a broken link.

removed trailing space, now it works, thanks.

>Any plans for those?

Please follow issues in YouTrack. I think timer request could be implemented rather soon.

0
Comment actions Permalink

Andrey, privet!

Ok, voted for second one. I'll keep my eye on issues, thanks.

0

Please sign in to leave a comment.