Thread

  1. I can't do typecasting...

    David Sauer <davids@penguin.cz> — 1999-11-02T14:20:12Z

    Hello,
      I have following problem and I think, that it is a bug:
    
    jelly=> select 'now'::abstime < 'now'::abstime;
    ?column?
    --------
    f       
    (1 row)
    
    ** works fine ...
    
    jelly=> select 'now'::abstime < now();
    ERROR:  Unable to identify an operator '<' for types 'abstime' and 'timestamp'
    	You will have to retype this query using an explicit cast
    
    ** ok, now () returns timestamp ...
    
    jelly=> select 'now'::abstime < abstime(now());
    ERROR:  Unable to identify an operator '<' for types 'abstime' and 'timestamp'
    	You will have to retype this query using an explicit cast
    jelly=> select 'now'::abstime < now()::abstime;
    ERROR:  Unable to identify an operator '<' for types 'abstime' and 'timestamp'
    	You will have to retype this query using an explicit cast
    jelly=> select 'now'::abstime < (now()::abstime);
    ERROR:  Unable to identify an operator '<' for types 'abstime' and 'timestamp'
    	You will have to retype this query using an explicit cast
    
    ** but typecasting from timestamp -> abstime seems doesn't work ...
    
    I'am using:
    
    Welcome to the POSTGRESQL interactive sql monitor:
      Please read the file COPYRIGHT for copyright terms of POSTGRESQL
    [PostgreSQL 6.5.2 on i586-pc-linux-gnu, compiled by gcc 2.95.1]
    
    System is RH 6.1 with glibc 2.1.2.
    
                                    thanks,
    
    
    -- 
    * David Sauer, student of Czech Technical University
    * electronic mail: davids@penguin.cz (mime compatible)