Alvaro Herrera <[EMAIL PROTECTED]> writes:
> Andrew Hammond escribió:
>> Which got me looking for "date_part". But that only seems to be in the
>> gram.y file, include/catalog/pg_proc.h and the test suite. The pg_proc.h
>> stuff looks pretty interesting, but to decipher it, I figured I need to read
Andrew Hammond escribió:
> Ok, I've been hunting through src/backend to try and find the code for
> EXTRACT(epoch ...). I found EXTRACT in src/backend/parser/gram.y, which
> seems like a reasonable place to start.
>
> | EXTRACT '(' extract_list ')'
> {
> FuncCall *n = makeNode(Func
On 5/18/07, Andrew Hammond <[EMAIL PROTECTED]> wrote:
On 5/17/07, Tom Lane <[EMAIL PROTECTED]> wrote:
>
> "Andrew Hammond" <[EMAIL PROTECTED]> writes:
> > On 5/17/07, Tom Lane < [EMAIL PROTECTED]> wrote:
> >> What are the grounds for defining it that way rather than some other
> >> way?
>
> > Th
On 5/17/07, Tom Lane <[EMAIL PROTECTED]> wrote:
"Andrew Hammond" <[EMAIL PROTECTED]> writes:
> On 5/17/07, Tom Lane <[EMAIL PROTECTED]> wrote:
>> What are the grounds for defining it that way rather than some other
>> way?
> The only alternative that came to mind when I wrote it was using a
num
"Andrew Hammond" <[EMAIL PROTECTED]> writes:
> On 5/17/07, Tom Lane <[EMAIL PROTECTED]> wrote:
>> What are the grounds for defining it that way rather than some other
>> way?
> The only alternative that came to mind when I wrote it was using a numeric
> instead of float.
No, I'm wondering what's
On 5/17/07, Tom Lane <[EMAIL PROTECTED]> wrote:
Andrew Hammond <[EMAIL PROTECTED]> writes:
> Yet another potential addition to the family of operators. Some guy
> was asking for it on IRC so...
> CREATE OR REPLACE FUNCTION interval_over_interval(interval, interval)
> RETURNS float STRICT IMMUTA
Andrew Hammond <[EMAIL PROTECTED]> writes:
> Yet another potential addition to the family of operators. Some guy
> was asking for it on IRC so...
> CREATE OR REPLACE FUNCTION interval_over_interval(interval, interval)
> RETURNS float STRICT IMMUTABLE LANGUAGE sql AS $$
> SELECT extract(epoch from
Yet another potential addition to the family of operators. Some guy
was asking for it on IRC so...
CREATE OR REPLACE FUNCTION interval_over_interval(interval, interval)
RETURNS float STRICT IMMUTABLE LANGUAGE sql AS $$
SELECT extract(epoch from $1)::float / extract(epoch from $2);
$$;
CREATE OPER