Hey ya,
Found a behaviour that caught my attention. While it's not a real
problem, and definetely not serious, I realize that it may be good to
write about it, cause I couldn't find previous posts on the matter.
Basically, I am preparing a presentation for an install party, and
while I was checking the documentation for certain bullets I arrived
to the CHECK stuff.
Therefore, I went into my psql and threw the following, without
paying too much attention:
CREATE TABLE checksss (a serial CHECK (a > 1 and a < 10), b varchar);
followed by a :
INSERT INTO checksss (b) values ('asdf');
Obviously, postgresql replied with a big : "new row ...violates
check constraint ..."
Now, my question is: Shouldn't postgresql avoid the creation of the
table while a serial type contains a check condition? A serial type
represents a sequence, but is not the same as creating the sequence
per se, with special conditions from start.
I may be radically wrong, and this is probably the case, but I
couldn't resist and choose to ask.
Kind regards,
--
Guido Barosio
-----------------------
http://www.globant.com
guido.barosio@globant.com