DBD::Pg::PG_TIMESTAMP not recognised

From: Zhivko Duchev (duchev_at_tzv.fal.de)
Date: 01/19/04

  • Next message: Tim Bunce: "Re: Can't make DBD"
    To: dbi-users@perl.org
    Date: Mon, 19 Jan 2004 18:28:05 +0100
    
    

    Hi All,
    I have problems with binding using the pg_type PG_TIMESTAMP. The code is:
    #-----------------------------------------
    use DBI;
    use DBD::Pg qw/:pg_types/;
      my
    $dbh1=DBI->connect("DBI:Pg:dbname='blobt_test';host='ots-5';port='5432'",'duchev','')
    or die 'err';
      $sqltext="INSERT INTO delme1 (d) VALUES(?)";
      $sth1=$dbh1->prepare($sqltext);

      $tmpstmp='01/02/2004';
      $sth1->bind_param(1,"$tmpstmp", {pg_type=>DBD::Pg::PG_TIMESTAMP} ); #line12

      my $rv=$sth1->execute;
      $sth1->finish;
      $dbh1->disconnect;
    #-----------------------------

    table delme1 was created : create table delme3 (d timestamp);

    The error message I receive:
    Cannot bind $1 unknown sql_type 0 at testbinddate.pl line 12.

    I have no problems with other type like PG_BYTEA for example.

    the versions:
    PostgreSQL 7.3.3 on Debian Linux 2.4.20
    Perl 5.6.1
    DBI 1.38
    DBD::Pg 1.31

    I have checked several forums but maybe I did not check the right ones and
    this is known issue ?

    Any sugestions will be greatly appreciated!

    -- 
    Zhivko Duchev
    ===================================================
    Institute for Animal Breeding
    Mariensee 31535 Neustadt Germany
    ===================================================
    

  • Next message: Tim Bunce: "Re: Can't make DBD"