postgresql/src/backend/parser
Peter Eisentraut 721856ff24 Remove distprep
A PostgreSQL release tarball contains a number of prebuilt files, in
particular files produced by bison, flex, perl, and well as html and
man documentation.  We have done this consistent with established
practice at the time to not require these tools for building from a
tarball.  Some of these tools were hard to get, or get the right
version of, from time to time, and shipping the prebuilt output was a
convenience to users.

Now this has at least two problems:

One, we have to make the build system(s) work in two modes: Building
from a git checkout and building from a tarball.  This is pretty
complicated, but it works so far for autoconf/make.  It does not
currently work for meson; you can currently only build with meson from
a git checkout.  Making meson builds work from a tarball seems very
difficult or impossible.  One particular problem is that since meson
requires a separate build directory, we cannot make the build update
files like gram.h in the source tree.  So if you were to build from a
tarball and update gram.y, you will have a gram.h in the source tree
and one in the build tree, but the way things work is that the
compiler will always use the one in the source tree.  So you cannot,
for example, make any gram.y changes when building from a tarball.
This seems impossible to fix in a non-horrible way.

Second, there is increased interest nowadays in precisely tracking the
origin of software.  We can reasonably track contributions into the
git tree, and users can reasonably track the path from a tarball to
packages and downloads and installs.  But what happens between the git
tree and the tarball is obscure and in some cases non-reproducible.

The solution for both of these issues is to get rid of the step that
adds prebuilt files to the tarball.  The tarball now only contains
what is in the git tree (*).  Getting the additional build
dependencies is no longer a problem nowadays, and the complications to
keep these dual build modes working are significant.  And of course we
want to get the meson build system working universally.

This commit removes the make distprep target altogether.  The make
dist target continues to do its job, it just doesn't call distprep
anymore.

(*) - The tarball also contains the INSTALL file that is built at make
dist time, but not by distprep.  This is unchanged for now.

The make maintainer-clean target, whose job it is to remove the
prebuilt files in addition to what make distclean does, is now just an
alias to make distprep.  (In practice, it is probably obsolete given
that git clean is available.)

The following programs are now hard build requirements in configure
(they were already required by meson.build):

- bison
- flex
- perl

Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/flat/e07408d9-e5f2-d9fd-5672-f53354e9305e@eisentraut.org
2023-11-06 15:18:04 +01:00
..
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
README Remove outdated reference to a removed file 2023-06-15 22:35:42 +09:00
analyze.c Avoid unnecessary plancache revalidation of utility statements. 2023-08-24 12:02:46 -04:00
check_keywords.pl Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
gram.y Extend ALTER OPERATOR to allow setting more optimization attributes. 2023-10-20 12:28:46 -04:00
gramparse.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
parse_agg.c Fix failure to detect some cases of improperly-nested aggregates. 2023-03-13 12:40:28 -04:00
parse_clause.c Add missing initializations of p_perminfo 2023-07-14 14:56:35 +09:00
parse_coerce.c Make Vars be outer-join-aware. 2023-01-30 13:16:20 -05:00
parse_collate.c Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
parse_cte.c Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
parse_enr.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
parse_expr.c Fix translation markers 2023-08-24 10:25:51 +02:00
parse_func.c Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
parse_merge.c Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
parse_node.c Allow underscores in integer and numeric constants. 2023-02-04 09:48:51 +00:00
parse_oper.c Extend ALTER OPERATOR to allow setting more optimization attributes. 2023-10-20 12:28:46 -04:00
parse_param.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
parse_relation.c Add missing initializations of p_perminfo 2023-07-14 14:56:35 +09:00
parse_target.c Track nesting depth correctly when drilling down into RECORD Vars. 2023-09-15 17:01:52 -04:00
parse_type.c Handle \v as a whitespace character in parsers 2023-07-06 08:16:24 +09:00
parse_utilcmd.c Add TupleDescGetDefault() 2023-09-27 18:52:40 +01:00
parser.c Code review for recent SQL/JSON commits 2023-04-04 14:04:30 +02:00
scan.l Handle \v as a whitespace character in parsers 2023-07-06 08:16:24 +09:00
scansup.c Handle \v as a whitespace character in parsers 2023-07-06 08:16:24 +09:00

README

src/backend/parser/README

Parser
======

This directory does more than tokenize and parse SQL queries.  It also
creates Query structures for the various complex queries that are passed
to the optimizer and then executor.

parser.c	things start here
scan.l		break query into tokens
scansup.c	handle escapes in input strings
gram.y		parse the tokens and produce a "raw" parse tree
analyze.c	top level of parse analysis for optimizable queries
parse_agg.c	handle aggregates, like SUM(col1),  AVG(col2), ...
parse_clause.c	handle clauses like WHERE, ORDER BY, GROUP BY, ...
parse_coerce.c	handle coercing expressions to different data types
parse_collate.c	assign collation information in completed expressions
parse_cte.c	handle Common Table Expressions (WITH clauses)
parse_expr.c	handle expressions like col, col + 3, x = 3 or x = 4
parse_enr.c	handle ephemeral named rels (trigger transition tables, ...)
parse_func.c	handle functions, table.column and column identifiers
parse_merge.c	handle MERGE
parse_node.c	create nodes for various structures
parse_oper.c	handle operators in expressions
parse_param.c	handle Params (for the cases used in the core backend)
parse_relation.c support routines for tables and column handling
parse_target.c	handle the result list of the query
parse_type.c	support routines for data type handling
parse_utilcmd.c	parse analysis for utility commands (done at execution time)

See also src/common/keywords.c, which contains the table of standard
keywords and the keyword lookup function.  We separated that out because
various frontend code wants to use it too.