Home / Current Issue / Paper 1724404
PGNexus-AI: An Intelligent and Secure Natural-Language PostgreSQL Administration Framework
Subject area: Science,Engineering and Technology · Area of research: Artificial Intelligence
DOI: 10.64388/IREV10I4-1724404
Abstract
Modern teams depend on PostgreSQL for mission-critical workloads, yet administration is still done by hand-writing SQL in disconnected tools such as psql, pgAdmin and DBeaver, while AI assistants such as GitHub Copilot have no live connection to the database and cannot read its schema, execution plans or error output. LLM-generated SQL also introduces new injection-style security risks. This paper presents PGNexus-AI, a PostgreSQL-only desktop IDE that combines Google Gemini, Gemma 4 and GitHub Copilot behind a schema-grounded orchestration layer. It provides natural-language-to-SQL generation, execution-plan-driven query optimization, automatic error diagnosis and correction, and AI-generated schema documentation with column-relationship mapping. A defense-in-depth safety layer (parameterization, query preview and confirmation, read-only and sandbox execution, role-based scoping and injection screening) protects production databases, and GitHub integration version-controls SQL and migrations. We describe the architecture, methodology and an evaluation plan covering efficiency, reliability, optimization and security.
Keywords
Database Security; Large Language Models; Natural Language to SQL; PostgreSQL; Query Optimization
References
[1] Stonebraker M, Rowe LA. The design of POSTGRES. ACM SIGMOD Rec. 1986;15(2):340–355. https://doi.org/10.1145/16856.16888
[2] Vaswani A, et al. Attention is all you need. In: Proc. Adv. Neural Inf. Process. Syst. (NeurIPS). 2017. p. 5998–6008. https://doi.org/10.48550/arXiv.1706.03762
[3] Brown TB, et al. Language models are few-shot learners. In: Proc. Adv. Neural Inf. Process. Syst. (NeurIPS). 2020. p. 1877–1901. https://doi.org/10.48550/arXiv.2005.14165
[4] Chen M, et al. Evaluating large language models trained on code. arXiv:2107.03374 [Preprint]. 2021.
[5] Gemini Team, Google. Gemini: A family of highly capable multimodal models. arXiv:2312.11805 [Preprint]. 2023.
[6] Gemma Team, Google DeepMind. Gemma: Open models based on Gemini research and technology. arXiv:2403.08295 [Preprint]. 2024.
[7] Touvron H, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv:2307.09288 [Preprint]. 2023.
[8] Zhong V, Xiong C, Socher R. Seq2SQL: Generating structured queries from natural language using reinforcement learning. arXiv:1709.00103 [Preprint]. 2017.
[9] Yu T, et al. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-SQL task. In: Proc. Conf. Empirical Methods Natural Lang. Process. (EMNLP). 2018. p. 3911–3921. https://doi.org/10.18653/v1/D18-1425
[10] Rajkumar N, Li R, Bahdanau D. Evaluating the text-to-SQL capabilities of large language models. arXiv:2204.00498 [Preprint]. 2022.
[11] Pourreza M, Rafiei D. DIN-SQL: Decomposed in-context learning of text-to-SQL with self-correction. In: Proc. Adv. Neural Inf. Process. Syst. (NeurIPS). 2023. https://doi.org/10.48550/arXiv.2304.11015
[12] Li J, et al. Can LLM already serve as a database interface? A big bench for large-scale database grounded text-to-SQLs (BIRD). In: Proc. Adv. Neural Inf. Process. Syst. (NeurIPS). 2023. https://doi.org/10.48550/arXiv.2305.03111
[13] Katsogiannis-Meimarakis G, Koutrika G. A survey on deep learning approaches for text-to-SQL. VLDB J. 2023;32(4):905–936. https://doi.org/10.1007/s00778-022-00776-8
[14] Lewis P, et al. Retrieval-augmented generation for knowledge-intensive NLP tasks. In: Proc. Adv. Neural Inf. Process. Syst. (NeurIPS). 2020. p. 9459–9474. https://doi.org/10.48550/arXiv.2005.11401
[15] Mandapaka S. Adaptive machine learning techniques for PostgreSQL performance optimization: A PostgreSQL case study. Int. J. Innov. Sci. Res. Technol. 2025;10(10):3375–3381. https://doi.org/10.38124/ijisrt/25oct1435
[16] Ramadan M, El-Kilany A, Mokhtar HMO, Sobh I. RL_QOptimizer: A reinforcement learning based query optimizer. IEEE Access. 2022;10:70502–70515. https://doi.org/10.1109/ACCESS.2022.3187102
[17] Kraska T, Beutel A, Chi EH, Dean J, Polyzotis N. The case for learned index structures. In: Proc. ACM SIGMOD Int. Conf. Manage. Data. 2018. p. 489–504. https://doi.org/10.1145/3183713.3196909
[18] Marcus R, et al. Neo: A learned query optimizer. Proc. VLDB Endow. 2019;12(11):1705–1718. https://doi.org/10.14778/3342263.3342644
[19] Marcus R, Papaemmanouil O. Deep reinforcement learning for join order enumeration. In: Proc. 1st Int. Workshop Exploiting Artif. Intell. Techn. Data Manage. (aiDM). 2018. p. 1–4. https://doi.org/10.1145/3211954.3211957
[20] Krishnan S, Yang Z, Goldberg K, Hellerstein JM, Stoica I. Learning to optimize join queries with deep reinforcement learning. arXiv:1808.03196 [Preprint]. 2018.
[21] Marcus R, et al. Bao: Making learned query optimization practical. In: Proc. ACM SIGMOD Int. Conf. Manage. Data. 2021. p. 1275–1288. https://doi.org/10.1145/3448016.3452838
[22] Casmiry EN, Sinde RS, Mduma NM. A hybrid deep learning model for SQL injection attack detection. IEEE Access. 2026;14:6450–6463. https://doi.org/10.1109/ACCESS.2026.3651991
[23] Boyd SW, Keromytis AD. SQLrand: Preventing SQL injection attacks. In: Applied Cryptography and Network Security (ACNS), LNCS. 2004. p. 292–302. https://doi.org/10.1007/978-3-540-24852-1_21
[24] Pedro R, Coimbra ME, Castro D, Carreira P, Santos N. Prompt-to-SQL injections in LLM-integrated web applications: Risks and defenses. In: Proc. IEEE/ACM 47th Int. Conf. Softw. Eng. (ICSE). 2025. p. 1768–1783. https://doi.org/10.1109/ICSE55347.2025.00007
[25] Kim E, Lee S. SQL injection in LLM-generated queries: Systematic analysis of detection gaps and security risks. IEEE Access. 2026;14:12797–12815. https://doi.org/10.1109/ACCESS.2026.3654822
[26] Greshake K, Abdelnabi S, Mishra S, Endres C, Holz T, Fritz M. Not what you’ve signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection. In: Proc. 16th ACM Workshop Artif. Intell. Security (AISec). 2023. p. 79–90. https://doi.org/10.1145/3605764.3623985
[27] OWASP Foundation. OWASP Top 10:2021 – The ten most critical web application security risks. 2021. https://owasp.org/Top10/
[28] OWASP Foundation. OWASP Top 10 for large language model applications. 2023. https://owasp.org/www-project-top-10-for-large-language-model-applications/
How to cite this paper
@article{1724404,
author = {Shruti Mahendra Raskar, Dr. Brijendra Gupta},
title = {PGNexus-AI: An Intelligent and Secure Natural-Language PostgreSQL Administration Framework},
journal = {Iconic Research And Engineering Journals},
year = {2026},
volume = {10},
number = {4},
pages = {4328-4340},
issn = {2456-8880},
url = {https://www.irejournals.com/formatedpaper/1724404.pdf},
abstract = {Modern teams depend on PostgreSQL for mission-critical workloads, yet administration is still done by hand-writing SQL in disconnected tools such as psql, pgAdmin and DBeaver, while AI assistants such as GitHub Copilot have no live connection to the database and cannot read its schema, execution plans or error output. LLM-generated SQL also introduces new injection-style security risks. This paper presents PGNexus-AI, a PostgreSQL-only desktop IDE that combines Google Gemini, Gemma 4 and GitHub Copilot behind a schema-grounded orchestration layer. It provides natural-language-to-SQL generation, execution-plan-driven query optimization, automatic error diagnosis and correction, and AI-generated schema documentation with column-relationship mapping. A defense-in-depth safety layer (parameterization, query preview and confirmation, read-only and sandbox execution, role-based scoping and injection screening) protects production databases, and GitHub integration version-controls SQL and migrations. We describe the architecture, methodology and an evaluation plan covering efficiency, reliability, optimization and security.},
keywords = {Database Security; Large Language Models; Natural Language to SQL; PostgreSQL; Query Optimization},
month = {October},
doi = {https://doi.org/10.64388/IREV10I4-1724404}
}