| От | rob stone |
|---|---|
| Тема | Re: [GENERAL] [OT] Postgresql and PHP |
| Дата | |
| Msg-id | 1482520911.16508.9.camel@gmail.com обсуждение исходный текст |
| Ответ на | [GENERAL] [OT] Postgresql and PHP (Alessandro Baggi <alessandro.baggi@gmail.com>) |
| Список | pgsql-general |
Hello, On Fri, 2016-12-23 at 16:44 +0100, Alessandro Baggi wrote: > Hi list, > sorry for this OT. > > I have a table on postgresql like this: > > id serial not null, > srcaddr varchar(16) not null > > I use this table to store ip address. I've used also inet type but > changed to see if this solves my problem. > > From psql, I run: > > select count(*) from bs_ipsource where srcaddr = '192.168.1.1'; > > I store and retrieve IP Addresses as follows:- id serial not null, srcaddr inet not null select count(*) from bs_ipsource where srcaddr = '192.168.1.1'::inet; Cast the textual representation to inet. Never had a problem. HTH, Rob
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера