Created
June 28, 2015 08:25
-
-
Save franckverrot/8406d7d720730fe6fbbe to your computer and use it in GitHub Desktop.
Verbose constraint violation message
This file contains 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
λ /usr/local/pgsql/bin/psql | |
psql (9.5devel) | |
Type "help" for help. | |
[email protected]/49942=# create table foo(bar varchar(4), baz varchar(2)); | |
CREATE TABLE | |
[email protected]/49942=# insert into foo values ('foo!', 'ok'); | |
INSERT 0 1 | |
[email protected]/49942=# insert into foo values ('foo2!', 'ok'); | |
ERROR: value too long for bar of type character varying(4) | |
[email protected]/49942=# insert into foo values ('foo!', 'ok2'); | |
ERROR: value too long for baz of type character varying(2) | |
[email protected]/49942=# | |
λ psql | |
psql (9.4.1) | |
Type "help" for help. | |
[email protected]/50053=# create table foo(bar varchar(4), baz varchar(2)); | |
CREATE TABLE | |
[email protected]/50053=# insert into foo values ('foo!', 'ok'); | |
INSERT 0 1 | |
[email protected]/50053=# insert into foo values ('foo2!', 'ok'); | |
ERROR: value too long for type character varying(4) | |
[email protected]/50053=# insert into foo values ('foo!', 'ok2'); | |
ERROR: value too long for type character varying(2) | |
[email protected]/50053=# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment