Re: bigint out of range

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: bigint out of range
Дата
Msg-id 20190518093519.2kd6hyw37wcx6qwc@hjp.at
обсуждение исходный текст
Ответ на Re: bigint out of range  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: bigint out of range  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On 2019-05-16 08:48:51 -0700, David G. Johnston wrote:
> On Thu, May 16, 2019 at 8:31 AM Daulat Ram <Daulat.Ram@exponential.com> wrote:
>
>
>     url_hash        | bigint                  |           | not null |
>
>
> Change the type of url_hash; make it text instead of bigint.

Or numeric(38, 0). I think it isn't coincidence that he tries to store
a 38-digit number in it.

> As a bonus:
>
> Use text instead of arbitrary varchar(4000) fields and add, e.g., check (length
> (url) < 4000) or something better.
>
> Needing 38 digit integers for "id" fields seems odd.

I guess the schema was copied from Oracle. In Oracle, all numbers are
really 38 digit decimal floating point numbers and the limit for
varchar2 is 4000.

        hp

--
   _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |   | hjp@hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Tim Cross
Дата:
Сообщение: Re: Loading table with indexed jsonb field is stalling
Следующее
От: Alastair McKinley
Дата:
Сообщение: Strange performance degregation in sql function (PG11.1)