Re: positive bigint arrays

From: "Miguel Beltran R(dot)" <yourpadre(at)gmail(dot)com>
To: SpinDFazor <philaltist(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: positive bigint arrays
Date: 2013-08-26 18:02:09
Message-ID: CAEc04crYUsQ1_s=uNETqtyvv70u65_yKGbfZhrbFYaWCzWvLAw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Probably with ANY (1)

0 < any (MatrixDims)

(1) http://www.postgresql.org/docs/8.2/static/functions-comparisons.html

2013/8/26 SpinDFazor <philaltist(at)yahoo(dot)com>

> Hello,
> Newbie to pgsql here. I would like to
> ADD COLUMN "Scan resolution" bigint[]
> This works. However, how can I add a constraint that will check each member
> of the bigint array for being positive ?
> Any syntax I could think off for CONSTRAINT is raising an error due to type
> mismatch between my array and zero;
> ALTER TABLE "MRI_data" ADD COLUMN MatrixDims bigint[] CONSTRAINT
> positive_dims CHECK (MatrixDims > 0);
>
> in other words, how can I specify "any" member of the array ? I tried
> without success
> MatrixDims{:} > 0
> MatrixDims[:] > 0
> MatrixDims{} >0
> MatrixDims[] > 0
> MatrixDims > 0
>
> Any help greatly appreciated. Surprisingly I could find tons on validation
> but nothing on validation of arrays.
>
>
>
>
>
> --
> View this message in context:
> http://postgresql.1045698.n5.nabble.com/positive-bigint-arrays-tp5768576.html
> Sent from the PostgreSQL - novice mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice
>

--
________________________________________
Lo bueno de vivir un dia mas
es saber que nos queda un dia menos de vida

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message James David Smith 2013-08-27 10:26:22 Improve query speed?
Previous Message SpinDFazor 2013-08-26 14:22:48 positive bigint arrays