Re: The same result for with SPACE and without SPACE
От | M Sarwar |
---|---|
Тема | Re: The same result for with SPACE and without SPACE |
Дата | |
Msg-id | DM4PR19MB5978BEB92FCD2765A0E6AA9BD35BA@DM4PR19MB5978.namprd19.prod.outlook.com обсуждение исходный текст |
Ответ на | Re: The same result for with SPACE and without SPACE (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-admin |
Thanks for this email.
I am checking all the emails.
Sincerely,
Sarwar
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Wednesday, June 14, 2023 6:45 PM
To: M Sarwar <sarwarmd02@outlook.com>
Cc: Scott Ribe <scott_ribe@elevated-dev.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: The same result for with SPACE and without SPACE
Sent: Wednesday, June 14, 2023 6:45 PM
To: M Sarwar <sarwarmd02@outlook.com>
Cc: Scott Ribe <scott_ribe@elevated-dev.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: The same result for with SPACE and without SPACE
M Sarwar <sarwarmd02@outlook.com> writes:
> I expect this to behave the same way whether it comes from CHAR or VARCHAR.
You expect incorrectly. CHAR comparison is insensitive to trailing
spaces:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fdocs%2Fcurrent%2Fdatatype-character.html&data=05%7C01%7C%7C10a23b4db34a484aa3cb08db6d291b28%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638223795537107272%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=PMlQtWXS2OrzG%2FNZlFB3qGpKwKaTjnA4fsEQKFTVivk%3D&reserved=0
regards, tom lane
> I expect this to behave the same way whether it comes from CHAR or VARCHAR.
You expect incorrectly. CHAR comparison is insensitive to trailing
spaces:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fdocs%2Fcurrent%2Fdatatype-character.html&data=05%7C01%7C%7C10a23b4db34a484aa3cb08db6d291b28%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638223795537107272%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=PMlQtWXS2OrzG%2FNZlFB3qGpKwKaTjnA4fsEQKFTVivk%3D&reserved=0
regards, tom lane
В списке pgsql-admin по дате отправления: