Re: [SQL] request for help with COPY syntax

2007-10-26 Thread Chuck D.
On October 25, 2007 09:22:10 pm Tom Lane wrote: > > Did the sed actually do anything? (Hint: the file size of > geonames_fixed.txt would be larger than geonames.txt if it did. > Or you could diff the two files to confirm that something sensible > happened.) > > I suspect that your shell may be fou

Re: [SQL] JOINing based on whether an IP address is contained within a CIDR range?

2007-10-26 Thread Jonah H. Harris
On 10/26/07, Harald Fuchs <[EMAIL PROTECTED]> wrote: > There are PostgreSQL builtin functions for that, but I think they are > unable to use indexes. I use http://pgfoundry.org/projects/ip4r/ > and I think it's the best thing since the invention of sliced bread ;-) Yes: ip4r('ip') <<= ip4r(cidr('

Re: [SQL] JOINing based on whether an IP address is contained within a CIDR range?

2007-10-26 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, "Jamie Tufnell" <[EMAIL PROTECTED]> writes: > Hi, > I am storing a log of HTTP requests in a database table (including IP > address): > http_log: id(PK), path, time, ip > I have another table that contains CIDR ranges and names for them: > network_names: id(PK),

Re: [SQL] get only rows for latest version of contents

2007-10-26 Thread Sébastien Meudec
Hi Erik Thx for your suggestion. I've done some tests and correct the order to get what i want. In fact the order i would like to have is 3,2,1,null (null is a draft version on my api). But the order ASC gives 1,2,3,null And the order DESC gives null,3,2,1 So i use order by -(version_no) that giv