Re: Casting

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Casting
Дата
Msg-id 11650.1016057455@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Casting  ("Graham Vickrage" <graham@digitalplanit.com>)
Список pgsql-sql
"Graham Vickrage" <graham@digitalplanit.com> writes:
> I essentially need the last four digits of the number (securing
> credit card numbers is the idea), which I can only do by manipulating text
> and casting it back.

What's wrong with a modulo operation?

regression=# select '123456789'::int8 % 10000::int8;?column? 
----------    6789
(1 row)
        regards, tom lane


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Referential integrity implementation - bug or user error?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Line Numbering in SELRCT Output