{"repo":"pierreforstmann/pg_query_rewrite","free":true,"listed":false,"github":"https://github.com/pierreforstmann/pg_query_rewrite","clone":"git clone https://github.com/pierreforstmann/pg_query_rewrite.git","description":"PostgreSQL extension which allows to translate a given source SQL statement into another pre-defined SQL statement.","language":"C","stars":24,"topics":["c","postgresql","sql","postgresql-extension"],"license":null,"category":"databases-storage","readme_excerpt":"pg query rewrite pg query rewrite is a PostgreSQL extension which allows to translate a given source SQL statement into another pre-defined SQL statement. Installation Compiling This module can be built using the standard PGXS infrastructure. For this to work, the pg config program must be available in your $PATH: git clone https://github.com/pierreforstmann/pg query rewrite.git cd pg query rewrite make make install PostgreSQL setup Extension must be loaded at server level with shared preload libraries parameter: shared preload libraries = 'pg query rewrite' Following SQL statement must be run in each database: create extension pg query rewrite; pg query rewrite has been successfully tested with PostgreSQL 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16, 17 and 18. Usage pg query rewrite has a single GUC : pg query rewrite.max rules which is the maximum number of SQL statements that can be translated. This extension is enabled if the related library is loaded. If pg query rewrite.max rules parameter is not set, it set to 10 by default. To create a new rule to translate SQL statement into SQL statement run: select pgqr add rule( , ); To remove a translation rule for SQL statement , run: select pgqr remove rule( ); To remove all existing translation rules, run: select pgqr truncate(); To display current translation rules, run: select pgqr rules(); Example In postgresql.conf: shared preload libraries = 'pg query rewrite' pg query rewrite.max rules=10 Run with psql: Limitations SQL statemen","default_branch":null,"files":null,"tree":[],"storefront":"/r/pierreforstmann","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pierreforstmann/pg_query_rewrite/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}