P3 library - setting database in url?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

P3 library - setting database in url?

Ben Coman
Hi Sven,

I'm using your P3 library
    https://github.com/svenvc/P3

to connect to TimescaleDB set up like this tutorial...
    http://docs.timescale.com/v0.8/tutorials/tutorial-hello-nyc

but the following doesn't work unless I un-comment the second line...
  (P3Client new url:
'psql://postgres:password@localhost:5432/nyc_data') in: [ :client |
       [  " client database: 'nyc_data'. "
          client query: 'SELECT date_trunc(''day'', pickup_datetime)
as day, avg(fare_amount)
                  FROM rides
                  WHERE passenger_count > 1 AND pickup_datetime < ''2016-01-08''
                  GROUP BY day ORDER BY day;'
       ] ensure: [ client close ]
  ].

Is it supposed to work without the second line,
just with the database set in the url ?

cheers -ben


P.S.  TimescaleDB looks like cool tech...
    https://blog.timescale.com/time-series-data-why-and-how-to-use-a-relational-database-instead-of-nosql-d0cd6975e87c

Some notes for anyone wanting to try tutorial-hello-nyc...
a. Postgresql >9.6.3 is required, for which the default install on
Ubuntu 16.04 had a problem with libpq not being recent enough.   I
needed to follow these steps...
      https://askubuntu.com/questions/831292/how-to-install-postgresql-9-6-on-any-ubuntu-version

b. Downloading the sample data errored using the given "https" url,
but plain "http" worked...
      http://timescaledata.blob.core.windows.net/datasets/nyc_data.tar.gz

Reply | Threaded
Open this post in threaded view
|

Re: P3 library - setting database in url?

Sven Van Caekenberghe-2
Ben,

> On 29 Jan 2018, at 15:27, Ben Coman <[hidden email]> wrote:
>
> Hi Sven,
>
> I'm using your P3 library
>    https://github.com/svenvc/P3
>
> to connect to TimescaleDB set up like this tutorial...
>    http://docs.timescale.com/v0.8/tutorials/tutorial-hello-nyc

Cool.

> but the following doesn't work unless I un-comment the second line...
>  (P3Client new url:
> 'psql://postgres:password@localhost:5432/nyc_data') in: [ :client |
>       [  " client database: 'nyc_data'. "
>          client query: 'SELECT date_trunc(''day'', pickup_datetime)
> as day, avg(fare_amount)
>                  FROM rides
>                  WHERE passenger_count > 1 AND pickup_datetime < ''2016-01-08''
>                  GROUP BY day ORDER BY day;'
>       ] ensure: [ client close ]
>  ].
>
> Is it supposed to work without the second line,
> just with the database set in the url ?

Yes, it is supposed to work like that. Did you try with the latest #reset patch (split settings/properties) ?

Sven

> cheers -ben
>
>
> P.S.  TimescaleDB looks like cool tech...
>    https://blog.timescale.com/time-series-data-why-and-how-to-use-a-relational-database-instead-of-nosql-d0cd6975e87c
>
> Some notes for anyone wanting to try tutorial-hello-nyc...
> a. Postgresql >9.6.3 is required, for which the default install on
> Ubuntu 16.04 had a problem with libpq not being recent enough.   I
> needed to follow these steps...
>      https://askubuntu.com/questions/831292/how-to-install-postgresql-9-6-on-any-ubuntu-version
>
> b. Downloading the sample data errored using the given "https" url,
> but plain "http" worked...
>      http://timescaledata.blob.core.windows.net/datasets/nyc_data.tar.gz
>


Reply | Threaded
Open this post in threaded view
|

Re: P3 library - setting database in url?

Ben Coman
On 29 January 2018 at 22:32, Sven Van Caekenberghe <[hidden email]> wrote:

> Ben,
>
>> On 29 Jan 2018, at 15:27, Ben Coman <[hidden email]> wrote:
>>
>> Hi Sven,
>>
>> I'm using your P3 library
>>    https://github.com/svenvc/P3
>>
>> to connect to TimescaleDB set up like this tutorial...
>>    http://docs.timescale.com/v0.8/tutorials/tutorial-hello-nyc
>
> Cool.
>
>> but the following doesn't work unless I un-comment the second line...
>>  (P3Client new url:
>> 'psql://postgres:password@localhost:5432/nyc_data') in: [ :client |
>>       [  " client database: 'nyc_data'. "
>>          client query: 'SELECT date_trunc(''day'', pickup_datetime)
>> as day, avg(fare_amount)
>>                  FROM rides
>>                  WHERE passenger_count > 1 AND pickup_datetime < ''2016-01-08''
>>                  GROUP BY day ORDER BY day;'
>>       ] ensure: [ client close ]
>>  ].
>>
>> Is it supposed to work without the second line,
>> just with the database set in the url ?
>
> Yes, it is supposed to work like that. Did you try with the latest #reset patch (split settings/properties) ?

Yes.  This occurs after I tested the #reset patch.  I "think" it was
occurring prior but my memory is not sure.

cheers -ben

>
> Sven
>
>> cheers -ben
>>
>>
>> P.S.  TimescaleDB looks like cool tech...
>>    https://blog.timescale.com/time-series-data-why-and-how-to-use-a-relational-database-instead-of-nosql-d0cd6975e87c
>>
>> Some notes for anyone wanting to try tutorial-hello-nyc...
>> a. Postgresql >9.6.3 is required, for which the default install on
>> Ubuntu 16.04 had a problem with libpq not being recent enough.   I
>> needed to follow these steps...
>>      https://askubuntu.com/questions/831292/how-to-install-postgresql-9-6-on-any-ubuntu-version
>>
>> b. Downloading the sample data errored using the given "https" url,
>> but plain "http" worked...
>>      http://timescaledata.blob.core.windows.net/datasets/nyc_data.tar.gz
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: P3 library - setting database in url?

Ben Coman
On 29 January 2018 at 22:40, Ben Coman <[hidden email]> wrote:

> On 29 January 2018 at 22:32, Sven Van Caekenberghe <[hidden email]> wrote:
>> Ben,
>>
>>> On 29 Jan 2018, at 15:27, Ben Coman <[hidden email]> wrote:
>>>
>>> Hi Sven,
>>>
>>> I'm using your P3 library
>>>    https://github.com/svenvc/P3
>>>
>>> to connect to TimescaleDB set up like this tutorial...
>>>    http://docs.timescale.com/v0.8/tutorials/tutorial-hello-nyc
>>
>> Cool.
>>
>>> but the following doesn't work unless I un-comment the second line...
>>>  (P3Client new url:
>>> 'psql://postgres:password@localhost:5432/nyc_data') in: [ :client |
>>>       [  " client database: 'nyc_data'. "
>>>          client query: 'SELECT date_trunc(''day'', pickup_datetime)
>>> as day, avg(fare_amount)
>>>                  FROM rides
>>>                  WHERE passenger_count > 1 AND pickup_datetime < ''2016-01-08''
>>>                  GROUP BY day ORDER BY day;'
>>>       ] ensure: [ client close ]
>>>  ].
>>>
>>> Is it supposed to work without the second line,
>>> just with the database set in the url ?
>>
>> Yes, it is supposed to work like that. Did you try with the latest #reset patch (split settings/properties) ?
>
> Yes.  This occurs after I tested the #reset patch.  I "think" it was
> occurring prior but my memory is not sure.

Just checked, its the same behaviour prior to updating to the #reset patch.

>
> cheers -ben
>
>>
>> Sven
>>
>>> cheers -ben
>>>
>>>
>>> P.S.  TimescaleDB looks like cool tech...
>>>    https://blog.timescale.com/time-series-data-why-and-how-to-use-a-relational-database-instead-of-nosql-d0cd6975e87c
>>>
>>> Some notes for anyone wanting to try tutorial-hello-nyc...
>>> a. Postgresql >9.6.3 is required, for which the default install on
>>> Ubuntu 16.04 had a problem with libpq not being recent enough.   I
>>> needed to follow these steps...
>>>      https://askubuntu.com/questions/831292/how-to-install-postgresql-9-6-on-any-ubuntu-version
>>>
>>> b. Downloading the sample data errored using the given "https" url,
>>> but plain "http" worked...
>>>      http://timescaledata.blob.core.windows.net/datasets/nyc_data.tar.gz
>>>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: P3 library - setting database in url?

Sven Van Caekenberghe-2


> On 29 Jan 2018, at 15:45, Ben Coman <[hidden email]> wrote:
>
> On 29 January 2018 at 22:40, Ben Coman <[hidden email]> wrote:
>> On 29 January 2018 at 22:32, Sven Van Caekenberghe <[hidden email]> wrote:
>>> Ben,
>>>
>>>> On 29 Jan 2018, at 15:27, Ben Coman <[hidden email]> wrote:
>>>>
>>>> Hi Sven,
>>>>
>>>> I'm using your P3 library
>>>>   https://github.com/svenvc/P3
>>>>
>>>> to connect to TimescaleDB set up like this tutorial...
>>>>   http://docs.timescale.com/v0.8/tutorials/tutorial-hello-nyc
>>>
>>> Cool.
>>>
>>>> but the following doesn't work unless I un-comment the second line...
>>>> (P3Client new url:
>>>> 'psql://postgres:password@localhost:5432/nyc_data') in: [ :client |
>>>>      [  " client database: 'nyc_data'. "
>>>>         client query: 'SELECT date_trunc(''day'', pickup_datetime)
>>>> as day, avg(fare_amount)
>>>>                 FROM rides
>>>>                 WHERE passenger_count > 1 AND pickup_datetime < ''2016-01-08''
>>>>                 GROUP BY day ORDER BY day;'
>>>>      ] ensure: [ client close ]
>>>> ].
>>>>
>>>> Is it supposed to work without the second line,
>>>> just with the database set in the url ?
>>>
>>> Yes, it is supposed to work like that. Did you try with the latest #reset patch (split settings/properties) ?
>>
>> Yes.  This occurs after I tested the #reset patch.  I "think" it was
>> occurring prior but my memory is not sure.
>
> Just checked, its the same behaviour prior to updating to the #reset patch.

For me,

  (P3Client new url: 'psql://postgres:password@localhost:5432/nyc_data') database.

  => 'nyc_data'

You'll have to trace how it fails, see #startupMessage where #database is used setting up the connection.

>> cheers -ben
>>
>>>
>>> Sven
>>>
>>>> cheers -ben
>>>>
>>>>
>>>> P.S.  TimescaleDB looks like cool tech...
>>>>   https://blog.timescale.com/time-series-data-why-and-how-to-use-a-relational-database-instead-of-nosql-d0cd6975e87c
>>>>
>>>> Some notes for anyone wanting to try tutorial-hello-nyc...
>>>> a. Postgresql >9.6.3 is required, for which the default install on
>>>> Ubuntu 16.04 had a problem with libpq not being recent enough.   I
>>>> needed to follow these steps...
>>>>     https://askubuntu.com/questions/831292/how-to-install-postgresql-9-6-on-any-ubuntu-version
>>>>
>>>> b. Downloading the sample data errored using the given "https" url,
>>>> but plain "http" worked...
>>>>     http://timescaledata.blob.core.windows.net/datasets/nyc_data.tar.gz


Reply | Threaded
Open this post in threaded view
|

Re: P3 library - setting database in url?

Sven Van Caekenberghe-2


> On 29 Jan 2018, at 15:50, Sven Van Caekenberghe <[hidden email]> wrote:
>
>
>
>> On 29 Jan 2018, at 15:45, Ben Coman <[hidden email]> wrote:
>>
>> On 29 January 2018 at 22:40, Ben Coman <[hidden email]> wrote:
>>> On 29 January 2018 at 22:32, Sven Van Caekenberghe <[hidden email]> wrote:
>>>> Ben,
>>>>
>>>>> On 29 Jan 2018, at 15:27, Ben Coman <[hidden email]> wrote:
>>>>>
>>>>> Hi Sven,
>>>>>
>>>>> I'm using your P3 library
>>>>>  https://github.com/svenvc/P3
>>>>>
>>>>> to connect to TimescaleDB set up like this tutorial...
>>>>>  http://docs.timescale.com/v0.8/tutorials/tutorial-hello-nyc
>>>>
>>>> Cool.
>>>>
>>>>> but the following doesn't work unless I un-comment the second line...
>>>>> (P3Client new url:
>>>>> 'psql://postgres:password@localhost:5432/nyc_data') in: [ :client |
>>>>>     [  " client database: 'nyc_data'. "
>>>>>        client query: 'SELECT date_trunc(''day'', pickup_datetime)
>>>>> as day, avg(fare_amount)
>>>>>                FROM rides
>>>>>                WHERE passenger_count > 1 AND pickup_datetime < ''2016-01-08''
>>>>>                GROUP BY day ORDER BY day;'
>>>>>     ] ensure: [ client close ]
>>>>> ].
>>>>>
>>>>> Is it supposed to work without the second line,
>>>>> just with the database set in the url ?
>>>>
>>>> Yes, it is supposed to work like that. Did you try with the latest #reset patch (split settings/properties) ?
>>>
>>> Yes.  This occurs after I tested the #reset patch.  I "think" it was
>>> occurring prior but my memory is not sure.
>>
>> Just checked, its the same behaviour prior to updating to the #reset patch.
>
> For me,
>
>  (P3Client new url: 'psql://postgres:password@localhost:5432/nyc_data') database.
>
>  => 'nyc_data'
>
> You'll have to trace how it fails, see #startupMessage where #database is used setting up the connection.

Ben,

Did you get your issue resolved ?

Sven

>>> cheers -ben
>>>
>>>>
>>>> Sven
>>>>
>>>>> cheers -ben
>>>>>
>>>>>
>>>>> P.S.  TimescaleDB looks like cool tech...
>>>>>  https://blog.timescale.com/time-series-data-why-and-how-to-use-a-relational-database-instead-of-nosql-d0cd6975e87c
>>>>>
>>>>> Some notes for anyone wanting to try tutorial-hello-nyc...
>>>>> a. Postgresql >9.6.3 is required, for which the default install on
>>>>> Ubuntu 16.04 had a problem with libpq not being recent enough.   I
>>>>> needed to follow these steps...
>>>>>    https://askubuntu.com/questions/831292/how-to-install-postgresql-9-6-on-any-ubuntu-version
>>>>>
>>>>> b. Downloading the sample data errored using the given "https" url,
>>>>> but plain "http" worked...
>>>>>    http://timescaledata.blob.core.windows.net/datasets/nyc_data.tar.gz


Reply | Threaded
Open this post in threaded view
|

Re: P3 library - setting database in url?

Ben Coman
Not yet.  Currently on-site with a 12 hour (non-programming) work day.
A bit hard to get stuff done after work ;).
I'll be home next Tuesday to have a look if I hadn't got to it already.

cheers -ben

On 1 February 2018 at 17:28, Sven Van Caekenberghe <[hidden email]> wrote:

>
>
>> On 29 Jan 2018, at 15:50, Sven Van Caekenberghe <[hidden email]> wrote:
>>
>>
>>
>>> On 29 Jan 2018, at 15:45, Ben Coman <[hidden email]> wrote:
>>>
>>> On 29 January 2018 at 22:40, Ben Coman <[hidden email]> wrote:
>>>> On 29 January 2018 at 22:32, Sven Van Caekenberghe <[hidden email]> wrote:
>>>>> Ben,
>>>>>
>>>>>> On 29 Jan 2018, at 15:27, Ben Coman <[hidden email]> wrote:
>>>>>>
>>>>>> Hi Sven,
>>>>>>
>>>>>> I'm using your P3 library
>>>>>>  https://github.com/svenvc/P3
>>>>>>
>>>>>> to connect to TimescaleDB set up like this tutorial...
>>>>>>  http://docs.timescale.com/v0.8/tutorials/tutorial-hello-nyc
>>>>>
>>>>> Cool.
>>>>>
>>>>>> but the following doesn't work unless I un-comment the second line...
>>>>>> (P3Client new url:
>>>>>> 'psql://postgres:password@localhost:5432/nyc_data') in: [ :client |
>>>>>>     [  " client database: 'nyc_data'. "
>>>>>>        client query: 'SELECT date_trunc(''day'', pickup_datetime)
>>>>>> as day, avg(fare_amount)
>>>>>>                FROM rides
>>>>>>                WHERE passenger_count > 1 AND pickup_datetime < ''2016-01-08''
>>>>>>                GROUP BY day ORDER BY day;'
>>>>>>     ] ensure: [ client close ]
>>>>>> ].
>>>>>>
>>>>>> Is it supposed to work without the second line,
>>>>>> just with the database set in the url ?
>>>>>
>>>>> Yes, it is supposed to work like that. Did you try with the latest #reset patch (split settings/properties) ?
>>>>
>>>> Yes.  This occurs after I tested the #reset patch.  I "think" it was
>>>> occurring prior but my memory is not sure.
>>>
>>> Just checked, its the same behaviour prior to updating to the #reset patch.
>>
>> For me,
>>
>>  (P3Client new url: 'psql://postgres:password@localhost:5432/nyc_data') database.
>>
>>  => 'nyc_data'
>>
>> You'll have to trace how it fails, see #startupMessage where #database is used setting up the connection.
>
> Ben,
>
> Did you get your issue resolved ?
>
> Sven
>
>>>> cheers -ben
>>>>
>>>>>
>>>>> Sven
>>>>>
>>>>>> cheers -ben
>>>>>>
>>>>>>
>>>>>> P.S.  TimescaleDB looks like cool tech...
>>>>>>  https://blog.timescale.com/time-series-data-why-and-how-to-use-a-relational-database-instead-of-nosql-d0cd6975e87c
>>>>>>
>>>>>> Some notes for anyone wanting to try tutorial-hello-nyc...
>>>>>> a. Postgresql >9.6.3 is required, for which the default install on
>>>>>> Ubuntu 16.04 had a problem with libpq not being recent enough.   I
>>>>>> needed to follow these steps...
>>>>>>    https://askubuntu.com/questions/831292/how-to-install-postgresql-9-6-on-any-ubuntu-version
>>>>>>
>>>>>> b. Downloading the sample data errored using the given "https" url,
>>>>>> but plain "http" worked...
>>>>>>    http://timescaledata.blob.core.windows.net/datasets/nyc_data.tar.gz
>
>