I guess behaviour is the same in Oracle as well.
From: Paul Smith* <paul@xxxxxxxxxx>
Sent: Thursday, June 15, 2023 11:48 AM
To: pgsql-admin@xxxxxxxxxxxxxxxxxxxx <pgsql-admin@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: The same result for with SPACE and without SPACE
On 15/06/2023 16:21, Wetmore, Matthew (CTR) wrote:
Yes, that's totally expected behaviour. The "problem" is that it's pretty much obvious behaviour as well.
insert into matt_test values(123)
So, all three inserts you did are actually the same, and all store the *NUMBER* 123 in the table. Spaces are not part of the number, so are not stored
When you make the table store 'TEXT' or VARCHAR fields, then spaces ARE relevant for that type, so the data stored is different. For CHAR fields, they are space-padded or truncated as necessary to be the defined field size.
This is all pretty much basic SQL behaviour. Any correctly implemented SQL database server will behave exactly the same.