On Mon, 3 Mar 2014, Owen, Greg wrote:
> John Hardin wrote:
>> Well, absent implementing native support for the "inet" data type in Squirrel/JDBC, what does this return?
>>
>> select CAST(ip AS varchar(20)), count(ip)
>> from reports
>> group by ip
>> order by count(ip) desc
>
> That returns a much improved:
>
> ip,count
> 10.1.2.12/32,23
> 10.1.2.163/32,21
> 10.1.2.97/32,15
> 10.1.2.56/32,9
>
> And by extension, I could get back to the base behavior of pgAdmin and psql with the following:
>
> select regexp_replace(CAST(ip AS varchar(20)), '/\\d{1,2}', ''), ...
>
> But it's a little daunting to think of rewriting any SQL I want to use
> in Squirrel to that extent.
A database function would probably be preferable. SELECT ip_to_str(ip), ...
> I had been rather hoping I was simply missing a driver property checkbox
> or the like.
I expect that would be something the pgSQL JDBC driver would provide,
sorry I can't help you with that.
> Thank you, John, that's very helpful even if not what I was hoping to hear!
Happy to help. You have to do something similar to get readable GUIDs out
of SQL Server.
--
John Hardin KA7OHZ http://www.impsec.org/~jhardin/
jh...@im... FALaholic #11174 pgpk -a jh...@im...
key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
Failure to plan ahead on someone else's part does not constitute
an emergency on my part. -- David W. Barts in a.s.r
-----------------------------------------------------------------------
6 days until Daylight Saving Time begins in U.S. - Spring Forward
|