Re: Data Type to store Leading Zero(0)

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Cc: soumik(dot)bhattacharjee(at)kpn(dot)com
Subject: Re: Data Type to store Leading Zero(0)
Date: 2021-01-20 12:39:50
Message-ID: 5e0bb278-b0a1-27b6-5739-c357a86334db@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

soumik(dot)bhattacharjee(at)kpn(dot)com schrieb am 20.01.2021 um 12:13:
> 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 aperformance impact if we define *varchar*
> in the data type.

While there is a performance impact between an integer and varchar, in my experience
it's rarely that big that it will become a problem.

Thomas

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2021-01-20 14:49:34 Re: Data Type to store Leading Zero(0)
Previous Message Ian Lawrence Barwick 2021-01-20 11:36:50 Re: 3 Parameters in pg_settings in CamelCase