RE: Data Type to store Leading Zero(0)

From: <soumik(dot)bhattacharjee(at)kpn(dot)com>
To: <nidhig631(at)gmail(dot)com>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: RE: Data Type to store Leading Zero(0)
Date: 2021-04-15 13:47:32
Message-ID: 7bb92c536d544e818562bfe713eac363@kpn.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thanks for your mail.

* smallint will be out of range for this due to number of bytes and ideally its behaving same way as any ***int data type.
* Boolean is not possible as this is phone number.

Please suggest

Thanks..

From: Nidhi Gupta <nidhig631(at)gmail(dot)com>
Sent: woensdag 20 januari 2021 12:20
To: Bhattacharjee, Soumik <soumik(dot)bhattacharjee(at)kpn(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Data Type to store Leading Zero(0)

Use datatype smallint(1) for storing zero or use Boolean datatype.

On Wed, Jan 20, 2021, 4:43 PM <soumik(dot)bhattacharjee(at)kpn(dot)com<mailto:soumik(dot)bhattacharjee(at)kpn(dot)com>> wrote:
Hello Experts,

As per business needs we need to store Zero(0) in primary key column of table with this kind of value --> 07******** with applications written in Java microservices.

We are not able to use numeric data type as it trims the Zero value in leading, but it’s also a performance impact if we define varchar in the data type.

Please suggest.

Thanks

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2021-04-15 13:53:19 Re: Data Type to store Leading Zero(0)
Previous Message Jayson Hreczuck 2021-04-15 12:31:08 Re: Logical replication Replica identity