Re: [GENERAL] Check constraints for varchar[] and varchar[][] columns in a table

2016-03-04 Thread Alexander Farber
Okay, let's call it <~ :-) On Fri, Mar 4, 2016 at 4:53 PM, Tom Lane wrote: > Alexander Farber writes: > > I am trying to add CHECK constraints to the VARCHAR arrays: > > > hand1 varchar[7] NOT NULL CHECK (ALL(hand1) ~ '^[*A-Z]$'), > > > but get syntax errors near "ALL" > > - probably b

Re: [GENERAL] Check constraints for varchar[] and varchar[][] columns in a table

2016-03-04 Thread Tom Lane
Alexander Farber writes: > I am trying to add CHECK constraints to the VARCHAR arrays: > hand1 varchar[7] NOT NULL CHECK (ALL(hand1) ~ '^[*A-Z]$'), > but get syntax errors near "ALL" > - probably because that keyword is supposed to be on the right side? Yeah, the syntax has to be "scala

Re: [GENERAL] Check constraints for varchar[] and varchar[][] columns in a table

2016-03-04 Thread David G. Johnston
On Fri, Mar 4, 2016 at 6:59 AM, Alexander Farber wrote: > Hello, > > for a Scrabble-like word game using PostgreSQL 9.5 as backend > I am trying to add CHECK constraints to the VARCHAR arrays: > > CREATE TABLE words_games ( > gid SERIAL PRIMARY KEY, > created timestamptz NOT NULL,