Add a check an a array column

From: vdg <vdg(dot)encelade(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Add a check an a array column
Date: 2012-09-08 14:27:49
Message-ID: 1530961.uh54oR6Eve@vdg-dev
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2012-09-08 15:31:38 Re: Add a check an a array column
Previous Message David Johnston 2012-09-08 12:59:09 Re: RE: [GENERAL] INSERT. RETURNING for copying records