PAD is a reserved keyword defined by the SQL Standard and appears in two phrases: PAD SPACE and NO PAD. The keyword is used inside CREATE COLLATION and ALTER COLLATION statements to control whether trailing space characters are considered significant when two character strings are compared.PAD SPACE - the default in most systems - means strings are right-padded with spaces to equal length before comparison. Therefore 'abc' and 'abc ' are treated as equal.NO PAD disables this behavior. Comparisons are performed byte-for-byte without adding trailing spaces, so 'abc' is less than 'abc '.The choice affects ORDER BY, DISTINCT, GROUP BY, UNIQUE constraints, hash joins, index builds, and any operation that relies on equality or ordering. Changing the pad attribute on an existing collation requires rebuilding indexes that use that collation. Not all database engines expose PAD/NO PAD even though the SQL Standard defines it; where unsupported the statement will fail with a syntax error.
CREATE COLLATION, COLLATE, CHARACTER SET, TRIM, LPAD, RPAD
ISO/IEC 9075:1999 (SQL-99)
PAD SPACE pads strings with spaces to equal length before comparison, while NO PAD compares the raw byte sequences and treats trailing blanks as significant.
No. PAD is a reserved keyword used only inside CREATE COLLATION or ALTER COLLATION statements. Use LPAD/RPAD functions if you need to pad a string.
Not every engine implements the SQL Standard's PAD attribute. PostgreSQL, SQL Server, Oracle, and SQLite currently do not support it, so those systems raise a syntax error.
Yes. If you alter a collation from PAD SPACE to NO PAD or vice versa, any index, unique constraint, or hash that relies on the collation must be rebuilt to ensure correct ordering and uniqueness guarantees.