On Mon, Mar 13, 2017 at 7:51 AM, vod vos wrote:
> Sorry for taking varchar(4) as an example, What I want urgently is how to
> make a constraint of fixed length of a numeric data,
> that you can only input data like 23.45, and if you input the data like
> 2.45, 23.4356, 233.45,
Hello
> -Original Message-
> From: pgsql-general-ow...@postgresql.org
> [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of vod vos
> Sent: Montag, 13. März 2017 15:52
> To: rob stone
> Cc: pgsql-general
> Subject: Re: [GENERAL]
Sorry for taking varchar(4) as an example, What I want urgently is how to make
a constraint of fixed length of a numeric data,
that you can only input data like 23.45, and if you input the data like 2.45,
23.4356, 233.45, you will get a warning
message from postgresql.
I think expr will do
Hello,
On Sat, 2017-03-11 at 22:14 -0800, vod vos wrote:
> Hi everyone,
>
> How to define the exact limit length of numeric type? For example,
>
> CREATE TABLE test (id serial, goose numeric(4,1));
>
> 300.2 and 30.2 can be inserted into COLUMN goose, but I want 30.2 or
> 3.2 can not be
"David G. Johnston" writes:
> On Sun, Mar 12, 2017 at 12:00 AM, vod vos wrote:
>> The INSERT action still can be done. What I want is just how to limit the
>> length of the insert value, you can just type format like 59.22, only four
>> digits length.
On 03/12/2017 12:33 AM, vod vos wrote:
So there is no other simpler method for checking that? like varchar(4), only 4
char can be input?
That is not how that works:
test=# create table varchar_test(fld_1 varchar(4));
CREATE TABLE
test=# \d varchar_test
Table "public.varchar_test"
So there is no other simpler method for checking that? like varchar(4), only 4
char can be input?
would using regexp cost more CPU or memory resources?
On 星期六, 11 三月 2017 23:21:16 -0800 Charles Clavadetscher
wrote
> Hello
>
> > -Original
Please don't top-post on these lists.
On Sun, Mar 12, 2017 at 12:00 AM, vod vos wrote:
> Maybe CHECK (goose >= 100 AND goose <= -100) works better, But if :
>
> INSERT INTO test VALUES (1, 59.2);
> INSERT INTO test VALUES (1, 59.24);
> INSERT INTO test VALUES (1, 59.26);
>
Hello
> -Original Message-
> From: pgsql-general-ow...@postgresql.org
> [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of vod vos
> Sent: Sonntag, 12. März 2017 08:01
> To: Pavel Stehule
> Cc: pgsql-general
> Subject: Re:
Maybe CHECK (goose >= 100 AND goose <= -100) works better, But if :
INSERT INTO test VALUES (1, 59.2);
INSERT INTO test VALUES (1, 59.24);
INSERT INTO test VALUES (1, 59.26);
INSERT INTO test VALUES (1, 59.2678);
The INSERT action still can be done. What I want is just how to limit the
length
On Sat, Mar 11, 2017 at 11:14 PM, vod vos wrote:
>
> Hi everyone,
>
> How to define the exact limit length of numeric type? For example,
>
> CREATE TABLE test (id serial, goose numeric(4,1));
>
> [...]
> 30.2 can be inserted into COLUMN goose, but I want 30.2
> [...]
> can
2017-03-12 7:25 GMT+01:00 Pavel Stehule :
>
>
> 2017-03-12 7:14 GMT+01:00 vod vos :
>
>>
>> Hi everyone,
>>
>> How to define the exact limit length of numeric type? For example,
>>
>> CREATE TABLE test (id serial, goose numeric(4,1));
>>
>> 300.2 and
2017-03-12 7:14 GMT+01:00 vod vos :
>
> Hi everyone,
>
> How to define the exact limit length of numeric type? For example,
>
> CREATE TABLE test (id serial, goose numeric(4,1));
>
> 300.2 and 30.2 can be inserted into COLUMN goose, but I want 30.2 or 3.2
> can not be inserted,
## vod vos (vod...@zoho.com):
> How to define the exact limit length of numeric type? For example,
>
> CREATE TABLE test (id serial, goose numeric(4,1));
>
> 300.2 and 30.2 can be inserted into COLUMN goose, but I want 30.2
> or 3.2 can not be inserted, how to do this?
testing=# CREATE TABLE
Hello
> -Original Message-
> From: pgsql-general-ow...@postgresql.org
> [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of vod vos
> Sent: Sonntag, 12. März 2017 07:15
> To: pgsql-general
> Subject: [GENERAL] How to define the limit length for numeric
Hi everyone,
How to define the exact limit length of numeric type? For example,
CREATE TABLE test (id serial, goose numeric(4,1));
300.2 and 30.2 can be inserted into COLUMN goose, but I want 30.2 or 3.2 can
not be inserted, how to do this?
Thank you.
--
Sent via pgsql-general mailing
16 matches
Mail list logo