View Full Version : 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 ? |
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.
| coming very fast from mssql, missing the GUI, missing dateadd... that what i needed.thx |
There is a good tutorial at
techdocs.postgresql.org
I think this is what you need
TIME DATE FAQ (http://techdocs.postgresql.org/techdocs/faqdatesintervals.php)
vBulletin v3.5.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.