Created
July 25, 2013 13:43
-
-
Save chrisa/6079753 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| postgres=# create table foo (a char(10), b varchar(10)); | |
| CREATE TABLE | |
| postgres=# insert into foo(a) values ('foo '); | |
| INSERT 0 1 | |
| postgres=# select * from foo where a = 'foo'; | |
| a | b | |
| ------------+--- | |
| foo | | |
| (1 row) | |
| postgres=# select * from foo where a = 'foo '; | |
| a | b | |
| ------------+--- | |
| foo | | |
| (1 row) | |
| postgres=# select * from foo where a = 'foo '; | |
| a | b | |
| ------------+--- | |
| foo | | |
| (1 row) | |
| postgres=# select * from foo where a = 'foo '; | |
| a | b | |
| ------------+--- | |
| foo | | |
| (1 row) | |
| postgres=# select * from foo where a = 'foo '; | |
| a | b | |
| ------------+--- | |
| foo | | |
| (1 row) | |
| postgres=# insert into foo(b) values('foo '); | |
| INSERT 0 1 | |
| postgres=# select * from foo where b = 'foo'; | |
| a | b | |
| ---+--- | |
| (0 rows) | |
| postgres=# select * from foo where b = 'foo '; | |
| a | b | |
| ---+------- | |
| | foo | |
| (1 row) | |
| postgres=# insert into foo(b) values('foo jkjjjjjjjjjjjjjjjjjjjjjjjjj'); | |
| ERROR: value too long for type character varying(10) | |
| postgres=# insert into foo(b) values('foo a'); | |
| ERROR: value too long for type character varying(10) | |
| postgres=# insert into foo(b) values('foo '); | |
| INSERT 0 1 | |
| # wait, what? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment