Add a check an a array column - Mailing list pgsql-general

From vdg
Subject Add a check an a array column
Date
Msg-id 1530961.uh54oR6Eve@vdg-dev
Whole thread Raw
Responses Re: Add a check an a array column
List pgsql-general
Hello,

I have a column defined as

test bigint[]

I would like to add a constraint on this column:  the values stored must be
between 0 and 1023 inclusive

I know how to add a constraint on a column which is not an array:

check (test < x'400'::bigint)

but i can't find the way to do that when there is an array of values



Any help ?

Thank you

vdg


pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: RE: [GENERAL] INSERT. RETURNING for copying records
Next
From: Andreas Kretschmer
Date:
Subject: Re: Add a check an a array column