v.20.5New Feature

Added Column Position to system.columns and system.parts_columns Tables

Added column position to system.columns table and column_position to system.parts_columns table. It contains ordinal position of a column in a table starting with 1. This closes #7744. #11655 (alexey-milovidov).
Added a position column to the system.columns table and a column_position column to the system.parts_columns table, representing the ordinal position of columns in a table starting from 1.

Why it matters

This feature provides users with the ability to identify the exact order of columns within tables and parts, which can be useful for schema introspection, debugging, and ensuring consistent column ordering across operations.

How to use it

Query the system.columns and system.parts_columns tables to retrieve the new position and column_position columns respectively. For example:

sql<br>SELECT name, position FROM system.columns WHERE table = 'your_table_name'<br>