Results 1 to 4 of 4

Thread: timestamp

  1. #1
    Join Date
    Jan 2002
    Posts
    3

    Red face Unanswered: timestamp

    in PhpPgAdmin i have this:

    function arguments returns language
    a1 timestamp int2 plpgsql




    DECLARE
    vdt ALIAS FOR $1;
    BEGIN
    INSERT INTO rbt_g1_i60 SELECT vdt,max(1*p_1142+0),avg(1*p_1143+0) FROM rbt_g1_i5 WHERE dt>( TIMESTAMP (''''||vdt ||'''') - INTERVAL ' 60 SECONDS')AND dt<=vdt;
    RETURN 0;
    END;


    ... and i'm not able to transfer this function, so i can paste it into psql. there's too much '''''' for me. can anyone help me ?

  2. #2
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    psql

    why don't you write it in a file and
    execute this with
    psql -d [DB] -U [user] -f [file]

    then the function will be created without problems

    Is this what you want or am I missing a point.
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  3. #3
    Join Date
    Jan 2002
    Posts
    3

    waw, i used linux. :-) psql -d [DB] -U [user] -f [file]

    coming very fast from mssql, missing the GUI, missing dateadd... that what i needed.thx

  4. #4
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    time functions

    There is a good tutorial at
    techdocs.postgresql.org

    I think this is what you need

    TIME DATE FAQ
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •