PSQL Query Tool for Odoo 19
Run PostgreSQL Queries
Inside Odoo.
Debug data, validate records and build ad-hoc reports without leaving the backend. Read-only by default, enforced by PostgreSQL itself, with a dedicated access group, an audit log of every execution and CSV / XLSX export.
|
Read‑only
By default, enforced by PostgreSQL
|
CSV + XLSX
Export, logged
|
Audit
Log of every run
|
Odoo 19
Built & Tested
|
LGPL‑3
Open License
|
|
A guarded SQL console for the people who actually query the database.
|
SELECT id, name, email
FROM res_partner WHERE customer_rank > 0 LIMIT 3;
CSV / XLSX |
What is PSQL Query Execute?
PSQL Query Execute is a technical module for Odoo that lets the users you choose run PostgreSQL queries directly from the Odoo user interface. Queries run read-only by default: inside a savepoint where PostgreSQL itself refuses any change, with a statement timeout and a row limit, and every execution is recorded in an audit log. Managers can run write statements after an explicit confirmation, with a dry run first.
Whether you need to quickly inspect data, validate records, debug issues, or generate ad-hoc reports, this module gives technical users raw database results inside Odoo, without handing out database credentials. Note that SQL bypasses Odoo's record rules: grant the PSQL Query groups deliberately.
What Makes This Module Powerful
Three capabilities for database-level insight from inside Odoo, without giving up control.
Read-only, Enforced by PostgreSQLSELECT, WITH, VALUES, TABLE, SHOW and EXPLAIN run in a savepoint with transaction_read_only on, then roll back. Hidden writes (WITH ... DELETE, SELECT INTO, nextval) are refused by the database. |
Access Groups & Audit LogTwo groups (read-only user, write manager), not granted to every administrator. Every run, dry run, write, blocked attempt and export is logged with user, IP, SQL, outcome and duration. |
Saved Queries & ExportPrivate or shared saved queries with :name parameters, paginated results, and CSV / XLSX export with spreadsheet-formula protection. |
Everything Under the Hood
Every feature implemented and covered by automated tests on Odoo 19.
Menu Access & NavigationOwn PSQL Query app (Saved Queries, History & Audit Log), visible only to its groups. Settings administrators are not granted access automatically. |
Saved & Shared QueriesName, describe and save queries. Private by default; tick Shared to let other PSQL users read and run them. Managers see all queries. |
Bound :name ParametersWrite :customer in the SQL, click Detect Parameters and fill values. Values are sent as bound parameters, never pasted into the SQL. |
Confirmed Write ModeManagers only: INSERT, UPDATE, DELETE and DDL run as a dry run (rolled back, affected rows shown) by default; committing requires typing EXECUTE. Server-level DDL (roles, databases, extensions, ALTER SYSTEM) is always refused. |
Paginated, Safe Results25 to 200 rows per page, sticky header, NULL shown distinctly, every value HTML-escaped. Rows are read through a server-side cursor up to the row limit. |
CSV & XLSX ExportXLSX with typed cells, frozen header and autofilter; CSV in UTF-8. Text that looks like a spreadsheet formula is never turned into one. Exports are logged. |
Guard Rails & Error HandlingExactly one statement per run (anything after the first ; is refused, with strings, comments and dollar quotes understood), keyword allowlist, dangerous server functions blocked (file access, backend signalling, set_config, advisory locks, dblink), statement timeout and lock timeout. SQL errors, timeouts and blocked statements are shown on the query form and recorded in the audit log. |
|
How It Works in 4 Simple Steps
From install to results in a minute. Timeout, row limit and log retention are configurable in Settings.
1
NavigateGive users a PSQL Query group, then open the PSQL Query app |
2
Write QueryEnter a name and your SQL, with :name parameters if needed |
3
ExecuteClick Execute (read-only); managers can use Execute as Write... |
4
ExportPage through the result and click CSV or XLSX |
See It in Action
Captured from this version on a test database.
Saved Queries. Own app, visible only to the PSQL Query groups; owner, sharing and last run status at a glance
Read-only execution. 120 rows, 25 per page, run with a bound :rows parameter; status and duration above the result
Parameters. :name placeholders detected from the SQL and sent as bound values
Guard rails. A second statement after ';' is refused before reaching the database, and the attempt is logged
Confirmed write mode. Managers only; dry run by default, typing EXECUTE commits
Dry run. The statement ran, the affected row count is reported and every change was rolled back
History & Audit Log. Every read, dry run, write, blocked attempt and export, with user and duration
Settings. Statement timeout, maximum rows and audit log retention
Who Is This Module For?
System AdminsInspect tables, validate records, and debug data issues without leaving Odoo. |
DevelopersTest queries, verify data integrity, and run quick checks during development. |
ConsultantsGenerate ad-hoc reports and investigate client data from the backend. |
Odoo PartnersGive clients a controlled, audited tool for database inspection without database credentials. |
Getting Started
| Install the module: the installing administrator becomes a PSQL Query Manager; nobody else gets access automatically |
| Grant User (read-only SQL) or Manager (write SQL) in Settings > Users, then open the PSQL Query app |
| Create a saved query, give it a name and write your SQL |
| Click Execute (read-only) to run it and page through the result |
| Click CSV or XLSX to download the result; review activity in History & Audit Log |
Frequently Asked Questions
What type of queries can I run?Users run SELECT, WITH, VALUES, TABLE, SHOW and EXPLAIN, read-only. Managers can also run INSERT, UPDATE, DELETE, MERGE and DDL after confirmation (dry run first). Transaction control, SET, COPY, DO, GRANT and server-level DDL are always refused. |
Who can use it?Only members of the PSQL Query groups. Settings administrators are not added automatically, because SQL bypasses Odoo's record rules and can read any data. Timeout, row limit and log retention are in General Settings. |
Can I export results to Excel?Yes. Export the last result as XLSX (typed cells, frozen header, autofilter) or CSV. Exports are recorded in the audit log. |
What if my query has an error?The PostgreSQL error message is shown in a red banner on the query form and recorded in the audit log; the database is left untouched. |
Can I save and reuse queries?Yes. Queries are saved records, private or shared, with parameters. The History lists every past execution and can open any of them in a new query. |
Which Odoo version is supported?Odoo 19, tested on Community with PostgreSQL 18 by an automated test suite. Enterprise and Odoo.sh are expected to work but have not been verified. |
Free & Fully Supported
Open-source under LGPL-3, with ongoing bug fixes, version updates, and responsive support.
|
Promise 01 Free Bug FixesAny bugs found will be fixed free of charge for the lifetime of your installation. |
Promise 02 Version UpdatesReceive future updates and compatibility patches as new Odoo versions are released. |
Promise 03 Dedicated SupportReach our technical team via Email, Phone, or WhatsApp for any questions. |
Need Help? We're Here.
Have a question, found an issue, or want to share feedback? We respond fast via Email, Phone, or WhatsApp.
Contact Us → sales@sdlccorp.com|
Phone +1 415-594-0097 |
|
|
| Built by SDLC Corp | sdlccorp.com | Version 19.0.1.0.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 1257 |
| Technical Name |
sdlc_psql_query_execute |
| License | LGPL-3 |
| Website | https://sdlccorp.com |
Please log in to comment on this module
There are no comments yet!