summaryrefslogtreecommitdiff
path: root/src/parser
AgeCommit message (Collapse)Author
2025-12-08Run pgindent.Tatsuo Ishii
Also update typedefs.list and README.pgpool.
2025-10-05Fix regression introduced by the previous commit ↵Bo Peng
(df277163720a248f108192329de58077cd35ea4e), which caused a syntax error in "PGPOOL SET CACHE DELETE".
2025-10-03Feature: Import PostgreSQL 18 new parser.Bo Peng
Major changes of PostgreSQL 18 parser include: - Allow generated columns to be virtual - Add OLD/NEW support to RETURNING in DML queries - Addition of various constraints (e.g. WITHOUT OVERLAPS, ENFORCED / NOT ENFORCED) - etc.
2025-09-17Fix compiling issue on 32-bit environments.Tatsuo Ishii
It is reported that compiling src/parser/snprintf.c on 32-bit environments fails due to undefined functions (isnan() and ininf()). They come from math.h so include it. snprintf.c was imported from PostgreSQL long time ago. If we look into the original file (src/port/snprintf.c) it actually has "#include <math.h>" already. Including math.h was provided as a pull request: https://github.com/pgpool/pgpool2/pull/128 I also added a minor modification to the patch to reorder the positions of include files. Author: Gyorgy Sarvari <skandigraun@gmail.com> Discussion: https://www.postgresql.org/message-id/20250917.194736.353755422175293639.ishii%40postgresql.org Backpatch-through: v4.2
2025-07-17Run pgindent.Tatsuo Ishii
2024-10-21Feature: new PGPOOL SET CACHE DELETE command.Tatsuo Ishii
The new PGPOOl SET command allows to delete query cache by specifying the previous query used to create the query cache entry. example usage is: PGPOOL SET CACHE DELETE 'SELECT * FROM t1;' This command is particularly useful for queries that are not invalidated by the auto cache invalidation feature because the query does not have any reference to tables.
2024-10-21Feature: Import PostgreSQL 17 RC1 new parser.Bo Peng
Major changes of PostgreSQL 17 parser include: - Allow MERGE to use NOT MATCHED BY SOURCE and RETURNING clause: MERGE INTO ... WHEN NOT MATCHED BY SOURCE ... MERGE INTO ... RETURNING ... - Add new COPY option ON_ERROR ignore and LOG_VERBOSITY: COPY ... WITH (ON_ERROR ignore); COPY ... WITH (LOG_VERBOSITY verbose); - Allow to use '*' to specify the COPY FROM options FORCE_NOT_NULL and FORCE_NULL for all columns. COPY ... WITH (FORCE_NOT_NULL *); COPY ... WITH (FORCE_NULL *); - Add EXPLAIN option SERIALIZE and MEMORY EXPLAIN (MEMORY) ... EXPLAIN (ANALYZE, SERIALIZE ...) ... - Allow ALTER TABLE to use SET STATISTICS DEFAULT to set a column to the default statistics target ALTER TABLE ... ALTER COLUMN ... SET STATISTICS DEFAULT; - Allow ALTER TABLE to change a column's generation expression ALTER TABLE ... ALTER COLUMN ... SET EXPRESSION; - Add DEFAULT setting for ALTER TABLE .. SET ACCESS METHOD ALTER TABLE ... SET STATISTICS DEFAULT; - Allow event triggers to use login event: CREATE EVENT TRIGGER ... ON login ... - Add event trigger support for REINDEX.
2024-05-20Delete unnecessary if branch.Bo Peng
https://github.com/pgpool/pgpool2/issues/52
2023-10-30Update parser changes between PostgreSQL 16 BETA1 and 16 RC1.Chen Ningwei
2023-07-31Feature: Import PostgreSQL 16 BETA1 new parser.Chen Ningwei
Major changes of PostgreSQL 16 parser include: - Add new option DEFAULT to COPY FROM COPY ... FROM stdin WITH (default 'xx'); - Allow the STORAGE type to be specified by CREATE TABLE CREATE TABLE t1 ( c1 VARCHAR(10) STORAGE PLAIN, c2 TEXT STORAGE EXTENDED ); - Add EXPLAIN option GENERIC_PLAN to display the generic plan for a parameterized query EXPLAIN (GENERIC_PLAN) SELECT ...; - Allow subqueries in the FROM clause to omit aliases SELECT COUNT(*) FROM (SELECT ... FROM ...); - Add SQL/JSON constructors - Add VACUUM options SKIP_DATABASE_STATS, ONLY_DATABASE_STATS to skip or update all frozen statistics PROCESS_MAIN to only process TOAST tables VACUUM (SKIP_DATABASE_STATS); VACUUM (PROCESS_MAIN FALSE) t1 ;
2023-06-23Fix missing CTE SEARCH and CYCLE rewrites.Bo Peng
In native replication mode, Pgpool-II need to rewrite Date/Time functions to timestamp in WRITE queries. CTE SEARCH and CYCLE rewrites were missing.
2023-05-19Remove pool_config.c and scan.c from git repository.Tatsuo Ishii
They are generated files and we should not keep in the git repository.
2022-12-20Fix time stamp rewrite bug.Tatsuo Ishii
In native replication/snapshot isolation mode, any write query including timestamp/date/time data are rewritten so that all PostgreSQL servers accept same timestamp etc. value. From 4.4 outfuncs module which is used to generate rewritten query was broken for boolean data. In a parse tree constant data is represented as "A_Const". 4.4 updated the module by using PostgreSQL 15's outfuncs module. Starting from PostgreSQL 15 A_Const handles more data type including boolean. Unfortunately the pgpool's outfuncs module did not adopt the change. As a result boolean constant was ignored and turned into empty string in the rewritten query string, which caused syntax errors. This commit fixes the issue. Also modify _outA_Const() so that it uses _out* functions to handle other data types to save a few lines of code. Per report from Michiel van Leening. Discussion: at: https://www.pgpool.net/pipermail/pgpool-general/2022-December/008581.html Back-patch to: 4.4.
2022-12-14Remove more files under parser directory.Tatsuo Ishii
This is following commit caeb3a8681d7aa0f5b24539de12d29dd5a8d9997 "Remove Makefile.in etc. generated by autoconf." Create .gitignore under src/parser and add generated files by bison and flex.
2022-12-13Remove Makefile.in etc. generated by autoconf.Tatsuo Ishii
Also update some .ignore files and add some new .gitignore files. Now developers need to run autoconf/autoreconf before compiling since the generated files are not provided by git anymore.
2022-11-24Fix not to print warnings of use of backslashes in parser.Tatsuo Ishii
When standard_conforming_strings = off and escape_string_warning = on, PostgreSQL prints warnings if backslashes are used in string literal. This is fine. But previously Pgpool-II's parser printed the same message too. This is redundant.
2022-09-26Fix to to use NIL to judge a List is empty or not.Tatsuo Ishii
Previously it mistakenly judge by the value of the pointer itself is NULL, which is not allowed by our coding standard.
2022-09-22Remove unused variable.Bo Peng
2022-09-21Feature: Import PostgreSQL 15 BETA4 new parser.Bo Peng
Major changes of PostgreSQL 15 parser include: - Add new SQL MERGE command MERGE INTO ... USING ... - Add new option HEADER MATCH to COPY FROM COPY ... FROM stdin WITH (HEADER MATCH); - Allow foreign key ON DELETE SET actions CREATE TABLE t1 ( ... FOREIGN KEY (c1, c2) REFERENCES t2 ON DELETE SET NULL (c2) ); - Allow SET ACCESS METHOD in ALTER TABLE ALTER TABLE ... SET ACCESS METHOD ...;
2022-08-29Apply changes introduced in the previous commit ↵Bo Peng
50cc6f18d742c76fcc3d0ba60d2b5058267effb8 to src/parser/gram_template.y and src/parser/Makefile.in.
2022-08-27Apply changes introduced in the previous commit to ↵Bo Peng
src/parser/gram_template.y and src/parser/Makefile.in.
2022-08-26Retire pool_string module.Tatsuo Ishii
Currently there are two string manipulation modules: pool_string and StringInfo. StringInfo is more feature rich and PostgreSQL compatible because it was imported from PostgreSQL. So replace all usages of pool_string by StringInfo. This also solves a problem reported by Peng: i.e. struct name "String" collision: pool_string uses "String" and PostgreSQL 15's parser also uses "String".
2021-12-06Update Makefile.Bo Peng
2021-12-03Suppress bison warnings regarding yacc incompatibility.Tatsuo Ishii
Run bison without yacc compatibility may raise some risks, so just suppress warnings.
2021-09-27Feature: Import PostgreSQL 14 beta2 new parser.Bo Peng
Major changes of PostgreSQL 14 parser include: - Allow an alias to be used to a JOIN ... USING SELECT ... FROM t1 JOIN t2 USING (a, b, c) AS x - Allow DISTINCT to be added to GROUP BY SELECT c1, max(c2) FROM t1 GROUP BY DISTINCT c1; - New SEARCH and CYCLE clauses for common table expressions
2021-08-10Update Makefile.in and configure.Bo Peng
2021-06-11Update gram_minimal.c which is generated by gram_minimal.yBo Peng
2021-05-05Update configure file.Bo Peng
2020-12-26Apply mega typo fixes.Tatsuo Ishii
Fixes for source code files including *.[chl] and regression scripts, not only for comments but variable names and function names. Documents (sgml and some text files) are also fixed. See: https://github.com/pgpool/pgpool2/pull/38 for more details. Patch contributed by Josh Soref. Fixes for Japanese sgml files by me.
2020-11-17Fix query rewrite syntax error of "INSERT ... ON CONFLICT" in native ↵Bo Peng
replication mode. per bug 654.
2020-09-07Feature: Import PostgreSQL 13 beta3 new parser.Bo Peng
Major changes of PostgreSQL 13 parser include: - Remove an object's dependency on an extension ALTER TRIGGER ... NO DEPENDS ON EXTENSION ... ALTER FUNCTION ... NO DEPENDS ON EXTENSION ... - Allow FETCH FIRST to use WITH TIES FETCH FIRST ... WITH TIES - Add ALTER TABLE clause DROP EXPRESSION ALTER TABLE ... DROP EXPRESSION - Allow setting statistics target for extended statistics ALTER STATISTICS ... SET STATISTICS - Allow ALTER VIEW to rename view columns ALTER VIEW ... RENAME COLUMN ... TO ... - Add CREATE DATABASE clause LOCALE option CREATE DATABASE ... LOCALE - Add DROP DATABASE clause WITH FORCE option DROP DATABASE ... WITH (force) - Add VACUUM clause PARALLEL option VACUUM (PARALLEL 1) ...
2020-08-19Replace "PGBIN" and "LPATH" in pgpool_setup and watchdog_setup using ↵Bo Peng
PostgreSQL's bin path and lib path.
2020-07-14Prevent data modifying CTE to be cached.Tatsuo Ishii
Data modifying CTE was mistakenly treated as normal read only CTE and result query was created. As a result subsequent CTE was not executed. Problem reported and patch created by Hou, Zhijie. Subtle changes to the regression test by me. Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2020-July/003705.html
2019-09-17Fix compiler warnings.Tatsuo Ishii
2019-09-12Fix identical code used for different branches per Coverity.Tatsuo Ishii
2019-09-05Fix outfuncs.c to support PostgreSQL 12 CTE [NOT] MATERIALIZED.Bo Peng
2019-08-14Fix memory leak.Tatsuo Ishii
Pointed out by Coverity.
2019-08-01Multiple performance enhancements especially for of the largeMuhammad Usama
INSERT and UPDATE statements Pgpool-II only needs very little information, especially for the INSERT and UPDATE statements to decide where it needs to send the query. For example: In master-slave mode, for the INSERT statements Pgpool-II only requires the relation name referenced in the statement while it doesn't care much about the column values and other parameters. But since the parser we use in Pgpool-II is taken from PostgreSQL source which parses the complete query including the value lists which seems harmless for smaller statements but in case of INSERT and UPDATE with lots of column values and large data in value items, consumes significant time. So the idea here is to short circuit the INSERT and UPDATE statement parsing as soon as we have the required information. For that purpose, the commit adds the second minimal parser that gets invoked in master-slave mode and tries to extract the performance for large INSERT and UPDATE statements. Apart from the second parser addition, following changes aiming towards the performance enhancements are also part of the commit. 1-Some of the if statements in pool_where_to_send() function are re-arranged to make sure the more expensive functions calls, pattern_compare() and pool_has_function_call() should only be made when they are absolutely necessary. 2- Eliminates the raw_parser() calls in case of un-recognized queries. Instead of invoking the parser on "dummy read" and "dummy write" statements, the commit adds the functions to return the pre-built parse_trees for these dummy queries. 3-- strlen() call is removed from scanner_init() function and is passed to it as an argument. The reason being we already have the query length in most cases before invoking the parser so why waste CPU cycles on it. Again this becomes significant in case of large query strings. 4- Removes some of the unnecessary calls of pool_is_likely_select() function.
2019-07-24Feature: Import PostgreSQL 12 beta2 new parser.Bo Peng
The attached patch imports PostgreSQL12 beta2 parser to Pgpool-II 4.1. Major chanegs of PostgreSQL 12 parser include: - Add new VACUUM options: -- SKIP_LOCKED -- INDEX_CLEANUP -- TRUNCATE - Add COMMIT AND CHAIN and ROLLBACK AND CHAIN commands - Add a WHERE clause to COPY FROM - Allow to use CREATE OR REPLACE AGGREGATE command - Allow to use mcv (most-common-value) in CREATE STATISTICS - ADD REINDEX option CONCURRENTLY - Add EXPLAIN option SETTINGS - etc.
2019-07-10Fix Pgpool-II rewriting query error when the queries include "GROUPS" and ↵Bo Peng
"EXCLUDE" in frame clauses. This occurs only in native replication mode. Thanks to Yugo Nagata for the bug reporting.
2019-07-04Generate Makefile.in by automake 1.13.4.Bo Peng
2019-06-18Support ECDH key exchange with SSLTakuma Hoshiai
Pgpool-II is supported ECDH key exchange with SSL connections. Add new parameter 'ssl_ecdh_curve' and 'ssl_dh_params_file' to use ECDH key exchange. The user can use more secure communication with SSL as with PostgreSQL.
2019-06-07Fix to deal with backslashes according to the config of ↵Bo Peng
standard_conforming_strings in native replication mode. per bug467.
2019-05-22Fix memory leak in outfuncs.c pointed out by Coverity.Tatsuo Ishii
2019-04-02Generate Makefile.in by automake 1.13.4.Bo Peng
2019-03-30Suppress "ar: `u' modifier ignored since `D' is the default (see `U')".Tatsuo Ishii
This is actually a bug with libtools. To deal with this, add ARFLAGS to parser's Makefile.am.
2018-10-18Fix syntax error in native replication, when queries including now() etc. ↵Bo Peng
and "IN (SELECT ...)" in WHERE clause. In native replication, queries including now() etc. are rewritten to a timestamp constant value. However, Pgpool-II didn't support queries including now() etc. and "IN (SELECT ...)" in WHERE clause. Per bug433.
2018-09-10Add missing src/parser/scan.c file.Bo Peng
2018-08-30Add missing gram.c by previous commit.Bo Peng
2018-08-28Import PostgreSQL 11 beta3 parser.Bo Peng