pgsql: Resolve partition strategy during early parsing

Started by Alvaro Herreraabout 4 years ago3 messagescommitters
Jump to latest
#1Alvaro Herrera
alvherre@alvh.no-ip.org

Resolve partition strategy during early parsing

This has little practical value, but there's no reason to let the
partition strategy names travel through DDL as strings.

Reviewed-by: Japin Li <japinli@hotmail.com>
Discussion: /messages/by-id/20221021093216.ffupd7epy2mytkux@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5fca91025e05f803140831953c09a36f08efcef5

Modified Files
--------------
src/backend/commands/tablecmds.c | 35 +++++++++++------------------------
src/backend/parser/gram.y | 22 +++++++++++++++++++++-
src/backend/partitioning/partbounds.c | 27 +++++----------------------
src/backend/utils/cache/partcache.c | 6 ++++++
src/include/nodes/parsenodes.h | 15 ++++++++-------
src/include/partitioning/partbounds.h | 2 +-
src/include/utils/partcache.h | 3 ++-
7 files changed, 54 insertions(+), 56 deletions(-)

#2Justin Pryzby
pryzby@telsasoft.com
In reply to: Alvaro Herrera (#1)
Re: pgsql: Resolve partition strategy during early parsing

On Thu, Nov 03, 2022 at 03:41:56PM +0000, Alvaro Herrera wrote:

Resolve partition strategy during early parsing

This has little practical value, but there's no reason to let the
partition strategy names travel through DDL as strings.

Reviewed-by: Japin Li <japinli@hotmail.com>
Discussion: /messages/by-id/20221021093216.ffupd7epy2mytkux@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5fca91025e05f803140831953c09a36f08efcef5

This caused a warning in MSVC.

[16:10:46.225] c:\cirrus\src\backend\parser\gram.y(18435) : warning C4715: 'parsePartitionStrategy': not all control paths return a value

I'll send a patch to make cfbot warn about that soon.

#3David Rowley
dgrowleyml@gmail.com
In reply to: Justin Pryzby (#2)
Re: pgsql: Resolve partition strategy during early parsing

On Sat, 5 Nov 2022 at 05:19, Justin Pryzby <pryzby@telsasoft.com> wrote:

[16:10:46.225] c:\cirrus\src\backend\parser\gram.y(18435) : warning C4715: 'parsePartitionStrategy': not all control paths return a value

I noticed this too. I've just pushed a patch to fix it.

David