Thread

  1. inet function return untestable texts

    PostgreSQL Bugs List <pgsql-bugs@postgresql.org> — 2001-04-06T15:40:33Z

    Laurent Wacrenier (lwa@teaser.fr) reports a bug with a severity of 2
    The lower the number the more severe it is.
    
    Short Description
    inet function return untestable texts
    
    Long Description
    I'm running 7.0.3 on FreeBSD
    
    host, netmask, etc.. inet function return unusable strings :
    for example, host('10.0.0.1') print '10.0.0.1' but
    is you make a comparison with '=', the result is alway false.
    
    char_length reports this two strings have differents length.
    
    
    
    Sample Code
    test=# select host('10.0.0.1'), char_length(host('10.0.0.1')), char_length('10.0.0.1');
       host   | char_length | char_length 
    ----------+-------------+-------------
     10.0.0.1 |           9 |           8
    (1 row)
    test=# select host('10.0.0.1') = '10.0.0.1', host('10.0.0.1') like '10.0.0.1';
     ?column? | ?column? 
    ----------+----------
     f        | t
    
    
    No file was uploaded with this report
    
    
    
  2. Re: inet function return untestable texts

    Tom Lane <tgl@sss.pgh.pa.us> — 2001-04-06T16:27:56Z

    pgsql-bugs@postgresql.org writes:
    > host, netmask, etc.. inet function return unusable strings :
    > for example, host('10.0.0.1') print '10.0.0.1' but
    > is you make a comparison with '=', the result is alway false.
    
    This is fixed in 7.1.  Someone forgot that text values shouldn't
    have trailing nulls ...
    
    			regards, tom lane