Re: [GENERAL] Question on how to use to_timestamp()

2016-02-14 Thread Vitaly Burovoy
On 2/13/16, Adrian Klaver wrote: > On 02/13/2016 07:42 PM, Deven Phillips wrote: >> I'm trying to convert a series of ISO8601 strings into TIMESTAMPs for >> use with a function: >> >> CREATE OR REPLACE FUNCTION v1_nexus_vlan_count(id TEXT, start_time >> TIMESTAMP,

Re: [GENERAL] Question on how to use to_timestamp()

2016-02-13 Thread Vitaly Burovoy
On 2/13/16, Deven Phillips wrote: > I'm trying to convert a series of ISO8601 strings into TIMESTAMPs for use > with a function: > > CREATE OR REPLACE FUNCTION v1_nexus_vlan_count(id TEXT, start_time > TIMESTAMP, end_time TIMESTAMP) > RETURNS TEXT AS $$ > SELECT

[GENERAL] Question on how to use to_timestamp()

2016-02-13 Thread Deven Phillips
I'm trying to convert a series of ISO8601 strings into TIMESTAMPs for use with a function: CREATE OR REPLACE FUNCTION v1_nexus_vlan_count(id TEXT, start_time TIMESTAMP, end_time TIMESTAMP) RETURNS TEXT AS $$ SELECT jsonb_pretty(jsonb_agg(row_to_json(datapoints))) AS data_array FROM ( SELECT

Re: [GENERAL] Question on how to use to_timestamp()

2016-02-13 Thread Deven Phillips
Thanks all! On Feb 13, 2016 11:06 PM, "Tom Lane" wrote: > Vitaly Burovoy writes: > > On 2/13/16, Deven Phillips wrote: > >> I'm trying to convert a series of ISO8601 strings into TIMESTAMPs for > use > >> with a function:

Re: [GENERAL] Question on how to use to_timestamp()

2016-02-13 Thread Tom Lane
Vitaly Burovoy writes: > On 2/13/16, Deven Phillips wrote: >> I'm trying to convert a series of ISO8601 strings into TIMESTAMPs for use >> with a function: ... > If your data is already in a correct ISO8601 format, you can use a > direct cast

Re: [GENERAL] Question on how to use to_timestamp()

2016-02-13 Thread Adrian Klaver
On 02/13/2016 07:42 PM, Deven Phillips wrote: > I'm trying to convert a series of ISO8601 strings into TIMESTAMPs for > use with a function: > > CREATE OR REPLACE FUNCTION v1_nexus_vlan_count(id TEXT, start_time > TIMESTAMP, end_time TIMESTAMP) > RETURNS TEXT AS $$ > SELECT