Skip site navigation (1) Skip section navigation (2)

Pass age function to extract function

From: Adam Bruss <abruss(at)awrcorp(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Pass age function to extract function
Date: 2011-05-02 20:16:11
Message-ID: D81DB5ADDC5C3B4484C581AF3D8EFF9D1A3848FE@ex2a.awr.local (view raw, whole thread or download thread mbox)
Lists: pgsql-general

How can one pass a non string literal interval to the extract function?

For example:

SELECT starttime, extract(minute from interval testruntime) as runtime from ( select age(endtime, starttime) as testruntime, ref_testnames_serial, starttime, endtime, dense_rank() over (order by starttime desc) dr from dtprfrm764.orion_tests where ref_testnames_serial = 389 and pass = true) x WHERE dr <= 20 ORDER BY starttime asc

Does 'minute from interval' only accept string literals?


Adam Bruss
Development Engineer
AWR Corporation/Simulation Technology & Applied Research
11520 N. Port Washington Rd., Suite 201
Mequon, WI  53092  USA
P: x104
E: abruss(at)awrcorp(dot)com


pgsql-general by date

Next:From: Rick GenterDate: 2011-05-02 20:25:44
Subject: Re: Pass age function to extract function
Previous:From: Merlin MoncureDate: 2011-05-02 19:21:39
Subject: Re: pervasiveness of surrogate (also called synthetic) keys

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group