pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: David G. Johnston <david.g.johnston@gmail.com>
To: Alistair Johnson <aewj@mit.edu>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Is it possible to use keywords (date units) in a function definition?
Date: Mon, 8 Jun 2020 15:40:05 -0700
Message-ID: <e5e9dcdf-2d71-a6d0-693a-125f5dd64cce@aklaver.com> (raw)
In-Reply-To: <CAKFQuwYwjDZLTY1JkkTL-4VtmBdK23-FZzVs7woweP0h+FSDmQ@mail.gmail.com>
References: <CAKHmqNC0utZwF1GWgQD4+cxa+VwNQHLKuo9Cmx4Mh4khYQZYxg@mail.gmail.com>
	<CAKFQuwYwjDZLTY1JkkTL-4VtmBdK23-FZzVs7woweP0h+FSDmQ@mail.gmail.com>

On 6/8/20 3:10 PM, David G. Johnston wrote:
> On Mon, Jun 8, 2020 at 2:57 PM Alistair Johnson <aewj@mit.edu 
> <mailto:aewj@mit.edu>> wrote:
> 
> 
>     RETURN EXTRACT(datepart FROM end - start);
>     Any ideas? Is this even possible?
> 
> 
> Use the "date_part" function.

That would work on the Postgres side, but the OP also wants this to run 
on BigQuery and unfortunately it won't work there.

> 
> David J.


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (7+ messages)  latest in thread

Message-ID: <e5e9dcdf-2d71-a6d0-693a-125f5dd64cce@aklaver.com>
Permalink:  ../e5e9dcdf-2d71-a6d0-693a-125f5dd64cce@aklaver.com/
Also on:    postgresql.org/message-id/e5e9dcdf-2d71-a6d0-693a-125f5dd64cce@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, david.g.johnston@gmail.com, aewj@mit.edu
  Subject: Re: Is it possible to use keywords (date units) in a function definition?
  In-Reply-To: <e5e9dcdf-2d71-a6d0-693a-125f5dd64cce@aklaver.com>
  References: <CAKHmqNC0utZwF1GWgQD4+cxa+VwNQHLKuo9Cmx4Mh4khYQZYxg@mail.gmail.com> <CAKFQuwYwjDZLTY1JkkTL-4VtmBdK23-FZzVs7woweP0h+FSDmQ@mail.gmail.com> <e5e9dcdf-2d71-a6d0-693a-125f5dd64cce@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox