Re: [GENERAL] time series data

2017-10-16 Thread Khalil Khamlichi
Thanks a lot Jeremy, we ended up integrating the code you provided into our software (just before you patent it) :) Best regards, Kkh On Tue, Oct 3, 2017 at 7:58 PM, Schneider wrote: > On Mon, Oct 2, 2017 at 10:27 AM, Khalil Khamlichi > wrote: >> we have records like this >> >> ccdb1=# select

Re: [GENERAL] time series data

2017-10-14 Thread Khalil Khamlichi
Thanks, I'll check it out. Sent via mobile, please forgive typos and brevity On Oct 14, 2017 3:23 PM, "Joshua D. Drake" wrote: > On 10/01/2017 01:17 AM, Khalil Khamlichi wrote: > >> Hi everyone, >> > > Take a look at TimescaleDB they have an extension to Postgres that makes > this awesome (and

Re: [GENERAL] time series data

2017-10-14 Thread Joshua D. Drake
On 10/01/2017 01:17 AM, Khalil Khamlichi wrote: Hi everyone, Take a look at TimescaleDB they have an extension to Postgres that makes this awesome (and yes its free and open source). jD I have a data stream of a call center application coming in  to postgres in this format : user_name,

Re: [GENERAL] time series data

2017-10-03 Thread Schneider
On Mon, Oct 2, 2017 at 10:27 AM, Khalil Khamlichi wrote: > we have records like this > > ccdb1=# select user_name, agent_status, event_time from cc_events ; > > user_name | agent_status | event_time > ---+--+- > user1 | ready| 2017-01-01 10

Re: [GENERAL] time series data

2017-10-02 Thread Nico Williams
You have these choices: - turn events into INSERTs and UPDATES on a table that represents a single call You might have an events VIEW with INSTED OF insert/update triggers so you can insert events as the interface for updating calls. - store the events and have a VIEW on the events t

Re: [GENERAL] time series data

2017-10-02 Thread Khalil Khamlichi
Hi Melvin, Thanks a lot for your help, let me explain to you my problem. we have records like this ccdb1=# select user_name, agent_status, event_time from cc_events ; user_name | agent_status | event_time ---+--+- user1 | ready| 2017-01

Re: [GENERAL] time series data

2017-10-02 Thread Khalil Khamlichi
interesting proposition, I am reading the docs. On Mon, Oct 2, 2017 at 6:08 PM, Scott Marlowe wrote: > On Sun, Oct 1, 2017 at 2:17 AM, Khalil Khamlichi > wrote: > > Hi everyone, > > > > I have a data stream of a call center application coming in to postgres > in > > this format : > > > > user_

Re: [GENERAL] time series data

2017-10-02 Thread Scott Marlowe
On Sun, Oct 1, 2017 at 2:17 AM, Khalil Khamlichi wrote: > Hi everyone, > > I have a data stream of a call center application coming in to postgres in > this format : > > user_name, user_status, event_time > > 'user1', 'ready', '2017-01-01 10:00:00' > 'user1', 'talking', '2017-01-01 10:02:00' > 'u

Re: [GENERAL] time series data

2017-10-02 Thread Melvin Davidson
On Sun, Oct 1, 2017 at 6:20 PM, Clifford Snow wrote: > I have a stream that updates every minute with a trigger that updates > another table with information from the stream. That way I'm constantly > updated with no need to run a script to update before I want a report. > > Clifford > > On Sun,

Re: [GENERAL] time series data

2017-10-01 Thread Clifford Snow
I have a stream that updates every minute with a trigger that updates another table with information from the stream. That way I'm constantly updated with no need to run a script to update before I want a report. Clifford On Sun, Oct 1, 2017 at 10:08 AM, Melvin Davidson wrote: > > > On Sun, Oct

Re: [GENERAL] time series data

2017-10-01 Thread Melvin Davidson
On Sun, Oct 1, 2017 at 4:17 AM, Khalil Khamlichi wrote: > Hi everyone, > > I have a data stream of a call center application coming in to postgres > in this format : > > user_name, user_status, event_time > > 'user1', 'ready', '2017-01-01 10:00:00' > 'user1', 'talking', '2017-01-01 10:02:00' > '

[GENERAL] time series data

2017-10-01 Thread Khalil Khamlichi
Hi everyone, I have a data stream of a call center application coming in to postgres in this format : user_name, user_status, event_time 'user1', 'ready', '2017-01-01 10:00:00' 'user1', 'talking', '2017-01-01 10:02:00' 'user1', 'after_call', '2017-01-01 10:07:00' 'user1', 'ready', '2017-01-01 1

Re: [GENERAL] Time travel?

2016-09-29 Thread Melvin Davidson
On Thu, Sep 29, 2016 at 3:20 PM, Thomas Munro wrote: > On Fri, Sep 30, 2016 at 8:17 AM, Kevin Grittner wrote: > > On Thu, Sep 29, 2016 at 2:06 PM, Melvin Davidson > wrote: > > > >> I am using PostgreSQL 9.4.0 (Yes, I know 9.4.9 is most recent but > >> it's out of my control) > > > > As long as

Re: [GENERAL] Time travel?

2016-09-29 Thread Thomas Munro
On Fri, Sep 30, 2016 at 8:17 AM, Kevin Grittner wrote: > On Thu, Sep 29, 2016 at 2:06 PM, Melvin Davidson wrote: > >> I am using PostgreSQL 9.4.0 (Yes, I know 9.4.9 is most recent but >> it's out of my control) > > As long as the decision-maker is aware that 9.4.0 has known bugs > (fixed in later

Re: [GENERAL] Time travel?

2016-09-29 Thread Paul Jungwirth
Hi Melvin: On 09/29/2016 12:06 PM, Melvin Davidson wrote: I list the creation time for a WAL file and it shows: /home/mdavidson/dba$ ls -l --time=ctime /d-log/pg_xlog/0001000D00C9 -rw--- 1 postgres postgres 16777216 Sep 29 07:14 /d-log/pg_xlog/0001000D00C9 ctime s

Re: [GENERAL] Time travel?

2016-09-29 Thread Kevin Grittner
On Thu, Sep 29, 2016 at 2:06 PM, Melvin Davidson wrote: > I am using PostgreSQL 9.4.0 (Yes, I know 9.4.9 is most recent but > it's out of my control) As long as the decision-maker is aware that 9.4.0 has known bugs (fixed in later minor releases) that can render the database unusable without war

[GENERAL] Time travel?

2016-09-29 Thread Melvin Davidson
*So here is a strange question. I am using PostgreSQL 9.4.0 (Yes, I know 9.4.9 is most recent but it's out of my control) O/S is AWS Debian 3.16.7-2 (2014-11-06) x86_64 GNU/Linux. I list the creation time for a WAL file and it shows: /home/mdavidson/dba$ ls -l --time=ctime /d-log/pg_xlog/000100

Re: [GENERAL] Time-based trigger

2012-09-19 Thread Robert Sosinski
Good deduction Steve. Looks like we are going to use the timestamp idea. This way, the ticket will be open for sale again the second it's hold_until time lapses. The cronjob was a close second, but there could be a lag-time between runs. Thanks everyone for all the help. -- Robert Sosinski

Re: [GENERAL] Time-based trigger

2012-09-18 Thread Steve Crawford
On 09/18/2012 08:59 AM, Robert Sosinski wrote: We have a table, which has items that can be put on hold of 5 minutes (this is for an online store) once they are placed into a cart. What we need is for this hold to automatically expire after 5 minutes. Right now, we put a time stamp into the r

Re: [GENERAL] Time-based trigger

2012-09-18 Thread Rob Sargent
On 09/18/2012 10:03 AM, Szymon Guz wrote: On 18 September 2012 17:59, Robert Sosinski mailto:rsosin...@ticketevolution.com>> wrote: We have a table, which has items that can be put on hold of 5 minutes (this is for an online store) once they are placed into a cart. What we need is f

Re: [GENERAL] Time-based trigger

2012-09-18 Thread Szymon Guz
On 18 September 2012 17:59, Robert Sosinski wrote: > We have a table, which has items that can be put on hold of 5 minutes > (this is for an online store) once they are placed into a cart. What we > need is for this hold to automatically expire after 5 minutes. Right now, > we put a time stamp

[GENERAL] Time-based trigger

2012-09-18 Thread Robert Sosinski
We have a table, which has items that can be put on hold of 5 minutes (this is for an online store) once they are placed into a cart. What we need is for this hold to automatically expire after 5 minutes. Right now, we put a time stamp into the row (called hold_until) at 5 minutes into the fut

Re: [GENERAL] time zone problem

2012-01-16 Thread Adrian Klaver
On Monday, January 16, 2012 5:50:42 am Cefull Lo wrote: > Hi, > I figure it out. > If only the offset from UTC is given, you may try > > select current_timestamp at time zone (select name from > pg_catalog.pg_timezone_names where utc_offset= interval '+8 hours' limit 1) > > Would give the exact t

Re: [GENERAL] time zone problem

2012-01-16 Thread Adrian Klaver
On Monday, January 16, 2012 5:50:42 am Cefull Lo wrote: > Hi, > I figure it out. > If only the offset from UTC is given, you may try > > select current_timestamp at time zone (select name from > pg_catalog.pg_timezone_names where utc_offset= interval '+8 hours' limit 1) > > Would give the exact t

Re: [GENERAL] time zone problem

2012-01-16 Thread Cefull Lo
Hi, I figure it out. If only the offset from UTC is given, you may try select current_timestamp at time zone (select name from pg_catalog.pg_timezone_names where utc_offset= interval '+8 hours' limit 1) Would give the exact timestamp at those time zone. On Fri, Jan 13, 2012 at 11:59 PM, Cefull

Re: [GENERAL] time zone problem

2012-01-13 Thread Steve Crawford
On 01/13/2012 08:18 AM, Tom Lane wrote: Cefull Lo writes: I'm located in Hong Kong, UTC+8 time zone. When I select current_timestamp; 2012-01-13 23:56:16.825558+08 However, when I select current_timestamp at time zone 'UTC+8'; I expect the result is the same as the above one. Sorry, but it i

Re: [GENERAL] time zone problem

2012-01-13 Thread Tom Lane
Cefull Lo writes: > I'm located in Hong Kong, UTC+8 time zone. When I > select current_timestamp; > 2012-01-13 23:56:16.825558+08 > However, when I > select current_timestamp at time zone 'UTC+8'; > I expect the result is the same as the above one. Sorry, but it isn't. A time zone name spelled

[GENERAL] time zone problem

2012-01-13 Thread Cefull Lo
Hi everybody, I'm located in Hong Kong, UTC+8 time zone. When I select current_timestamp; gives now --- 2012-01-13 23:56:16.825558+08 However, when I select current_timestamp at time zone 'UTC+8'; I expect the result is the same as the above one. But

Re: [GENERAL] Time to move table to new tablespace

2012-01-10 Thread Craig Ringer
On 10/01/2012 3:10 AM, Jason Buberel wrote: "Select median price for every zip code as of 2012-01-06" (customer exports) "Select median price for 94086 from 2005-01-01 through 2012-01-06" (charting apps) So by partitioning in one dimension we impact queries in the other. Well, I know of *the

Re: [GENERAL] Time to move table to new tablespace

2012-01-09 Thread Ondrej Ivanič
Hi, On 10 January 2012 06:10, Jason Buberel wrote: > "Select median price for every zip code as of 2012-01-06" (customer exports) > "Select median price for 94086 from 2005-01-01 through 2012-01-06" (charting > apps) > > So by partitioning in one dimension we impact queries in the other. I do no

Re: [GENERAL] Time to move table to new tablespace

2012-01-09 Thread Jason Buberel
Craig, Good suggestion - I have experimented with table partitioning in the past, but the impact on performance was considerable. In our case, we have one large table with real estate statistics arranged in time (weekly for the last five years) and geography (every zip in the US). You could imagi

Re: [GENERAL] Time to move table to new tablespace

2012-01-08 Thread Ondrej Ivanič
Hi, On 8 January 2012 01:52, Jason Buberel wrote: > psql> create tablespace 'newstorage' location '/some/new/path'; > psql> alter table city_summary set tablespace = 'newstorage'; Be aware that you are not going to move indexes (see ALTER INDEX name SET TABLESPACE tablespace_name). Maybe you don

Re: [GENERAL] Time to move table to new tablespace

2012-01-08 Thread Craig Ringer
On 7/01/2012 10:52 PM, Jason Buberel wrote: I'm considering the migration of an existing large (2.3TB) table to a new tablespace. The table size, according to the '\dt+' command: public | city_summary | table | altosresearch | 2345 GB| Are there any considerations - besides the usual disk

[GENERAL] Time to move table to new tablespace

2012-01-07 Thread Jason Buberel
I'm considering the migration of an existing large (2.3TB) table to a new tablespace. The table size, according to the '\dt+' command: public | city_summary | table | altosresearch | 2345 GB| Are there any considerations - besides the usual disk and network IO constraints - that I need to ta

[GENERAL] time estimation for a test

2011-05-30 Thread salah jubeh
Hello, I have a view which is a result of the cross product of three tables, I want to test how much time is required to populate this view. Also, I want to test the scalability of this view in the future. Since, I have already live data I am wondering if I can do that without creating an autom

Re: [GENERAL] Time zone specifications, abbreviations vs full names

2011-05-08 Thread Christophe Pettus
On May 8, 2011, at 11:40 AM, Adrian Klaver wrote: > No, PST has an offset of -8. Head > desk. Thank you. -- -- Christophe Pettus x...@thebuild.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpr

Re: [GENERAL] Time zone specifications, abbreviations vs full names

2011-05-08 Thread Adrian Klaver
On Sunday, May 08, 2011 10:23:44 am Christophe Pettus wrote: > Either I am exceptionally confused, or the documentation in 8.5.3 appears > to be wrong. Could someone clarify what I'm missing? > > The documentation states: "In short, this is the difference between > abbreviations and full names: a

[GENERAL] Time zone specifications, abbreviations vs full names

2011-05-08 Thread Christophe Pettus
Either I am exceptionally confused, or the documentation in 8.5.3 appears to be wrong. Could someone clarify what I'm missing? The documentation states: "In short, this is the difference between abbreviations and full names: abbreviations always represent a fixed offset from UTC, whereas most

Re: [GENERAL] Time Series on Postgres (HOWTO?)

2011-01-15 Thread Alban Hertroys
On 15 Jan 2011, at 1:41, bubba postgres wrote: > I've been googling, but haven't found a good answer to what I should do if I > want to store time series in Postgres. > My current solution is store serialized (compressed) blobs of data. > (So for example store 1 day worth of 1 minute samples (~14

Re: [GENERAL] Time Series on Postgres (HOWTO?)

2011-01-14 Thread Jasen Betts
On 2011-01-15, bubba postgres wrote: > --000e0cd332267ac2e60499d7ceb2 > Content-Type: text/plain; charset=ISO-8859-1 > > I've been googling, but haven't found a good answer to what I should do if I > want to store time series in Postgres. > It would be nice if I could use 1 sample per column,(bec

Re: [GENERAL] Time Series on Postgres (HOWTO?)

2011-01-14 Thread Whit Armstrong
I think you want to look at kdb, onetick, and LIM (those are commercial). or potentially mongoDB where you could probably store a compressed ts directly in the db if you want. If you're not going to store each observation as a row, then why use a db at all. why not stick to flat files? -Whit O

[GENERAL] Time Series on Postgres (HOWTO?)

2011-01-14 Thread bubba postgres
I've been googling, but haven't found a good answer to what I should do if I want to store time series in Postgres. My current solution is store serialized (compressed) blobs of data. (So for example store 1 day worth of 1 minute samples (~1440 samples) stored as one row in a bytea. (Plus meta data

Re: [GENERAL] Time zone 'GMT+8'

2009-11-29 Thread Tom Lane
silly writes: >> From >> http://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-TIMEZONES > Another issue to keep in mind is that in POSIX time zone names, > positive offsets are used for locations west of Greenwich. Yeah, we're caught between two incompatible convent

Re: [GENERAL] Time zone 'GMT+8'

2009-11-29 Thread Martin Gainty
que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Sun, 29 Nov 2009 15:08:01 +0800 > From: seil...@so-net.net.tw > To: pgsql-general@postgresql.org > Subject: [GENERAL] Time zone 'GMT+8'

Re: [GENERAL] Time zone 'GMT+8'

2009-11-28 Thread silly8888
>From >http://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-TIMEZONES Another issue to keep in mind is that in POSIX time zone names, positive offsets are used for locations west of Greenwich. On Sun, Nov 29, 2009 at 2:08 AM, wrote: > The target pgsql is compiled fr

[GENERAL] Time zone 'GMT+8'

2009-11-28 Thread seiliki
The target pgsql is compiled from 8.4rc1. 'GMT+8' can be found in installed binary file .../share/postgresql/timezone/Etc/GMT+8. This is the recorded script: -BEGIN record-- db1=# select now(); now --- 2009-11-29 14:44:37.32241

Re: [GENERAL] Time Management - Training Seminar in Cape Town

2009-10-02 Thread David Fetter
On Fri, Oct 02, 2009 at 08:32:50PM +0100, Simon Riggs wrote: > > On Wed, 2009-09-30 at 23:48 -0500, Training wrote: > > > A training seminar that will put more time back in your life. > > Attending PostgreSQL training will help you to target your > prospective customers more effectively and sto

Re: [GENERAL] Time Management - Training Seminar in Cape Town

2009-10-02 Thread Simon Riggs
On Wed, 2009-09-30 at 23:48 -0500, Training wrote: > A training seminar that will put more time back in your life. Attending PostgreSQL training will help you to target your prospective customers more effectively and stop wasting their time in the first place. -- Simon Riggs www.2

[GENERAL] Time Management - Training Seminar in Cape Town

2009-10-01 Thread Training
A training seminar that will put more time back in your life. A training provider registered with Services SETA Presented by South Africa's leading Speakers Dr Brian Jude and Associates present MORE HOURS IN YOUR DAY (Time management) A Dynamic Morning Seminar Time is a unique resourc

Re: [GENERAL] Time zone HADT timestamp syntax error in trigger

2009-05-01 Thread Tom Lane
John Smithus writes: > [ 'HADT' is not recognized as a timezone abbreviation ] > The server is running PostgreSQL 8.3.7 on an AMD64 Gentoo Linux > machine. The system time zone is set to 'America/Adak' and datestyle > is set to 'sql, mdy' in postgresql.conf. Not every timezone abbreviation in the

[GENERAL] Time zone HADT timestamp syntax error in trigger

2009-04-30 Thread John Smithus
Greetings! I'm encountering an "invalid input syntax for type timestamp" error in a trigger. The server is running PostgreSQL 8.3.7 on an AMD64 Gentoo Linux machine. The system time zone is set to 'America/Adak' and datestyle is set to 'sql, mdy' in postgresql.conf. The target column type is "ti

Re: [GENERAL] Time intersect query

2009-03-23 Thread Alban Hertroys
On Mar 23, 2009, at 5:44 AM, Brad Murray wrote: My current procedure... 1) Create temporary table with each possible data point. This example uses recursive functions from pgsql 8.4 but was originally implemented by using large numbers of queries from php. My knowledge of the recursive f

[GENERAL] Time intersect query

2009-03-22 Thread Brad Murray
I'm wanting to optimize and improve a query to get the maximum number of users over a period of time. What I'm trying to accomplish is to get graphable data points of the maximum number of simultaneous users at a specified interval over a period of time, preferably with only a single pass through

Re: [GENERAL] Time without seconds

2008-12-02 Thread Grzegorz Jaśkiewicz
On Tue, Dec 2, 2008 at 10:37 AM, Andreas Kraftl <[EMAIL PROTECTED]> wrote: > > Hello, > > is it possible to get the time without the seconds and without the usage > > of a formatting function? regexp and/or date_trunc -- GJ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

[GENERAL] Time without seconds

2008-12-02 Thread Andreas Kraftl
Hello, is it possible to get the time without the seconds and without the usage of a formatting function? Example: CREATE TABLE test.testtime ( thetime time without time zone ); INSERT INTO test.testtime (thetime) VALUES ('12:34:56'); INSERT INTO test.testtime (thetime) VALUES ('23:45'); SELECT

Re: pg_casts view (was Re: date_trun() with timezones? (was Re: [GENERAL] TIME column ...))

2008-11-05 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Maybe we should just agree that its argument is a pattern for the >> castsource type's name? > I'd say it could be a pattern for both source and target. Often times I > am interested in casts in either direction. Well, it makes t

Re: pg_casts view (was Re: date_trun() with timezones? (was Re: [GENERAL] TIME column ...))

2008-11-05 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Could we change the data types of the pg_cast table to regprocedure and > regtype instead? Back when we first introduced the reg-foo types, there was some discussion of changing all relevant catalog columns to those types, but the idea crashed and bu

Re: pg_casts view (was Re: date_trun() with timezones? (was Re: [GENERAL] TIME column ...))

2008-11-05 Thread Peter Eisentraut
Tom Lane wrote: Alvaro Herrera <[EMAIL PROTECTED]> writes: Tom Lane escribi�: regression=# select casttarget::regtype,castcontext,castfunc::regprocedure from pg_cast where castsource = 'time'::regtype; BTW it very much looks like we should have a pg_casts view that displays these things in

Re: pg_casts view (was Re: date_trun() with timezones? (was Re: [GENERAL] TIME column ...))

2008-11-05 Thread Peter Eisentraut
Alvaro Herrera wrote: Tom Lane escribió: However, the interval version of the function can capture the time case because there's an implicit cast from time to interval: regression=# select casttarget::regtype,castcontext,castfunc::regprocedure from pg_cast where castsource = 'time'::regtype;

Re: pg_casts view (was Re: date_trun() with timezones? (was Re: [GENERAL] TIME column ...))

2008-11-04 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Tom Lane escribió: >> There already is a \dC command in psql, which has nice enough output >> format but doesn't provide any way to select a subset of the table. >> Maybe we should just agree that its argument is a pattern for the >> castsource type's n

Re: [GENERAL] time interval format srting

2008-11-04 Thread Sam Mason
Andreas Kretschmer replied: > I wrote: > > How about doing: > > > > SELECT justify_interval(90061 * '1 second'::INTERVAL); > > Nice, didn't know this function. Yup, PG does everything! Not sure when I discovered it; also not sure if I've ever had to use it in anger before. I am, however, sli

Re: [GENERAL] time interval format srting

2008-11-04 Thread Andreas Kretschmer
Sam Mason <[EMAIL PROTECTED]> schrieb: > On Tue, Nov 04, 2008 at 05:06:37PM +, Joao Ferreira gmail wrote: > > I've been searching the docs on a simple way to convert a time > > _duration_ in seconds to the format dd:hh:mm:ss, but I can't find it. > > > > 90061 --> 1d 1h 1m 1s > > > > (90061=

Re: [GENERAL] time interval format srting

2008-11-04 Thread A. Kretschmer
am Tue, dem 04.11.2008, um 17:06:37 + mailte Joao Ferreira gmail folgendes: > Hello, > > I've been searching the docs on a simple way to convert a time > _duration_ in seconds to the format dd:hh:mm:ss, but I can't find it. > > 90061 --> 1d 1h 1m 1s > > (90061=24*3600+3600+60+1) > > any id

Re: [GENERAL] time interval format srting

2008-11-04 Thread Sam Mason
On Tue, Nov 04, 2008 at 05:06:37PM +, Joao Ferreira gmail wrote: > I've been searching the docs on a simple way to convert a time > _duration_ in seconds to the format dd:hh:mm:ss, but I can't find it. > > 90061 --> 1d 1h 1m 1s > > (90061=24*3600+3600+60+1) > > any ideas ? > > I've been usi

Re: [GENERAL] time interval format srting

2008-11-04 Thread Scott Marlowe
On Tue, Nov 4, 2008 at 10:53 AM, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On Tue, Nov 4, 2008 at 10:06 AM, Joao Ferreira gmail > <[EMAIL PROTECTED]> wrote: >> Hello, >> >> I've been searching the docs on a simple way to convert a time >> _duration_ in seconds to the format dd:hh:mm:ss, but I can'

Re: [GENERAL] time interval format srting

2008-11-04 Thread Scott Marlowe
On Tue, Nov 4, 2008 at 10:06 AM, Joao Ferreira gmail <[EMAIL PROTECTED]> wrote: > Hello, > > I've been searching the docs on a simple way to convert a time > _duration_ in seconds to the format dd:hh:mm:ss, but I can't find it. > > 90061 --> 1d 1h 1m 1s > > (90061=24*3600+3600+60+1) select number*

[GENERAL] time interval format srting

2008-11-04 Thread Joao Ferreira gmail
Hello, I've been searching the docs on a simple way to convert a time _duration_ in seconds to the format dd:hh:mm:ss, but I can't find it. 90061 --> 1d 1h 1m 1s (90061=24*3600+3600+60+1) any ideas ? I've been using to_char and to_timestamp to format dates/timestamps... but this is diferent...

Re: pg_casts view (was Re: date_trun() with timezones? (was Re: [GENERAL] TIME column ...))

2008-11-03 Thread Alvaro Herrera
Tom Lane escribió: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > Tom Lane escribi�: > >> regression=# select casttarget::regtype,castcontext,castfunc::regprocedure > >> from pg_cast where castsource = 'time'::regtype; > > > BTW it very much looks like we should have a pg_casts view that displa

Re: pg_casts view (was Re: date_trun() with timezones? (was Re: [GENERAL] TIME column ...))

2008-11-03 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Tom Lane escribió: >> regression=# select casttarget::regtype,castcontext,castfunc::regprocedure >> from pg_cast where castsource = 'time'::regtype; > BTW it very much looks like we should have a pg_casts view that displays > these things in a human-re

pg_casts view (was Re: date_trun() with timezones? (was Re: [GENERAL] TIME column ...))

2008-11-03 Thread Alvaro Herrera
Tom Lane escribió: > However, the interval version of the function can capture the time case > because there's an implicit cast from time to interval: > > regression=# select casttarget::regtype,castcontext,castfunc::regprocedure > from pg_cast where castsource = 'time'::regtype; >castta

Re: date_trun() with timezones? (was Re: [GENERAL] TIME column manipulation/comparison hangups)

2008-11-03 Thread Tom Lane
Bill Moran <[EMAIL PROTECTED]> writes: > Not quite. As shown in the examples, date_trunc() works fine on > TIME WITHOUT TIME ZONE, but there's no such function for TIME WITH > TIME ZONE. Well, actually there's no date_trunc for time either: regression=# \df date_trunc

date_trun() with timezones? (was Re: [GENERAL] TIME column manipulation/comparison hangups)

2008-11-03 Thread Bill Moran
In response to "Scott Marlowe" <[EMAIL PROTECTED]>: > On Mon, Nov 3, 2008 at 12:25 PM, Bill Moran > <[EMAIL PROTECTED]> wrote: > > In response to "Scott Marlowe" <[EMAIL PROTECTED]>: > > > >> On Mon, Nov 3, 2008 at 12:01 PM, Bill Moran > >> <[EMAIL PROTECTED]> wrote: > >> > > >> > I'm trying to te

Re: [GENERAL] TIME column manipulation/comparison hangups

2008-11-03 Thread Scott Marlowe
On Mon, Nov 3, 2008 at 12:31 PM, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On Mon, Nov 3, 2008 at 12:25 PM, Bill Moran > <[EMAIL PROTECTED]> wrote: >> In response to "Scott Marlowe" <[EMAIL PROTECTED]>: >> >>> On Mon, Nov 3, 2008 at 12:01 PM, Bill Moran >>> <[EMAIL PROTECTED]> wrote: >>> > >>> > I

Re: [GENERAL] TIME column manipulation/comparison hangups

2008-11-03 Thread Scott Marlowe
On Mon, Nov 3, 2008 at 12:25 PM, Bill Moran <[EMAIL PROTECTED]> wrote: > In response to "Scott Marlowe" <[EMAIL PROTECTED]>: > >> On Mon, Nov 3, 2008 at 12:01 PM, Bill Moran >> <[EMAIL PROTECTED]> wrote: >> > >> > I'm trying to test the time in a time column to see if it's the same >> > minute as t

Re: [GENERAL] TIME column manipulation/comparison hangups

2008-11-03 Thread Bill Moran
In response to "Scott Marlowe" <[EMAIL PROTECTED]>: > On Mon, Nov 3, 2008 at 12:01 PM, Bill Moran > <[EMAIL PROTECTED]> wrote: > > > > I'm trying to test the time in a time column to see if it's the same > > minute as the current time. I wouldn't have thought this would be > > difficult: > > > >

Re: [GENERAL] TIME column manipulation/comparison hangups

2008-11-03 Thread Scott Marlowe
On Mon, Nov 3, 2008 at 12:01 PM, Bill Moran <[EMAIL PROTECTED]> wrote: > > I'm trying to test the time in a time column to see if it's the same > minute as the current time. I wouldn't have thought this would be > difficult: > > WHERE TO_CHAR(now(), 'HH24MI') = TO_CHAR(time_column, 'HH24MI') Use

Re: [GENERAL] TIME column manipulation/comparison hangups

2008-11-03 Thread Raymond O'Donnell
On 03/11/2008 19:01, Bill Moran wrote: > It seems as if EXTRACT() will work, but it sure feels hacky > to do: > > (extract(hours from now()) = extract(hours from time_column) > AND > (extract(minutes from now()) = extract(minutes from time_column) I'd have thought that this was the correct way

[GENERAL] TIME column manipulation/comparison hangups

2008-11-03 Thread Bill Moran
I'm trying to test the time in a time column to see if it's the same minute as the current time. I wouldn't have thought this would be difficult: WHERE TO_CHAR(now(), 'HH24MI') = TO_CHAR(time_column, 'HH24MI') Doesn't work, though: ERROR: function to_char(time with time zone, unknown) does not

Re: [GENERAL] time math - Bug or expected behavior?

2008-08-26 Thread Tom Lane
Adam Rich <[EMAIL PROTECTED]> writes: > I traced a bug in our application down to this basic operation: > set timezone to 'US/Eastern'; > select '11/02/2008'::timestamptz, '12:10'::time, > '11/02/2008'::timestamptz + '12:10'::time; > I have a date and a time stored separately and I want to combin

[GENERAL] time math - Bug or expected behavior?

2008-08-26 Thread Adam Rich
I traced a bug in our application down to this basic operation: set timezone to 'US/Eastern'; select '11/02/2008'::timestamptz, '12:10'::time, '11/02/2008'::timestamptz + '12:10'::time; I have a date and a time stored separately and I want to combine them, and use them in some timezone-aware cal

Re: [GENERAL] Time of 'pg_ctl reload'.

2008-08-20 Thread hubert depesz lubaczewski
> If I make changes to the postgresql.conf and then do a 'pg_ctl reload', how > do I get the date & time of this event? it will be added in 8.4: http://www.depesz.com/index.php/2008/05/05/waiting-for-84-pg_conf_load_time-time-related-generate_series-and-enum-values-in-dt/ depesz -- Linkedin: h

[GENERAL] Time of 'pg_ctl reload'.

2008-08-20 Thread Alexi Gen
Thank you Michael! I have another question - related to this. If I make changes to the postgresql.conf and then do a 'pg_ctl reload', how do I get the date & time of this event? Cheers! Alexi Gen On Mon, Aug 18, 2008 at 03:53:32AM -0700, Alexi Gen wrote: > Is there a table/view available from

Re: [GENERAL] Time stamp issue

2008-01-10 Thread Scott Marlowe
On Jan 8, 2008 8:51 AM, <[EMAIL PROTECTED]> wrote: > DELETE from CONCURRENT_USER WHERE (now() - CONCURRENT_USER.TIME_STAMP) > ? > > > > Here the calculated value in '?' is not supported by the postgres as it was > set as a double. > > I tried to cast it to a timestamp by using Timestamp timestamp

Re: [GENERAL] Time stamp issue

2008-01-10 Thread Martijn van Oosterhout
On Tue, Jan 08, 2008 at 08:21:40PM +0530, [EMAIL PROTECTED] wrote: > The query is something like : > > DELETE from CONCURRENT_USER WHERE (now() - CONCURRENT_USER.TIME_STAMP) > > ? > > Here the calculated value in '?' is not supported by the postgres as it > was set as a double. In postgres subtr

Re: [GENERAL] Time stamp issue

2008-01-10 Thread Chandra Sekhar Surapaneni
On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, January 08, 2008 8:52 AM To: pgsql-general@postgresql.org Subject: [GENERAL] Time stamp issue Importance: High Hi Everyone, I have a table named concurrent_user which has a column time_stamp. The column stores the timestamp for the latest en

[GENERAL] Time stamp issue

2008-01-10 Thread kapil.munish
Hi Everyone, I have a table named concurrent_user which has a column time_stamp. The column stores the timestamp for the latest entered record. My query finds the difference of the timestamp from the current time, if the value is larger than 5 minutes then the latest entered record in the tab

Re: [GENERAL] time penalties on triggers?

2007-10-10 Thread Vivek Khera
On Oct 5, 2007, at 9:10 AM, Kenneth Downs wrote: I also found it very hard to pin down the penalty of the trigger, but came up with rough figures of 30-50% overhead. The complexity of the trigger did not matter. in which language did you write your triggers? ---(

Re: [GENERAL] time penalties on triggers?

2007-10-05 Thread Kenneth Downs
Jan Theodore Galkowski wrote: Does anyone know, or can anyone point to information about how much triggers penalize inserts in PG tables? I'm getting a report that it is substantial, and before I investigate more. The triggers in question look like: I use triggers everywhere. About a year

Re: [GENERAL] time penalties on triggers?

2007-10-04 Thread Scott Marlowe
On 10/4/07, Jan Theodore Galkowski <[EMAIL PROTECTED]> wrote: > Does anyone know, or can anyone point to information about how much > triggers penalize inserts in PG tables? I'm getting a report that it is > substantial, and before I investigate more. Using your DDL, with slight variations, I cam

[GENERAL] time penalties on triggers?

2007-10-04 Thread Jan Theodore Galkowski
Does anyone know, or can anyone point to information about how much triggers penalize inserts in PG tables? I'm getting a report that it is substantial, and before I investigate more. The triggers in question look like: # # CREATE OR REPLACE FUNCTION touch_lasttouched() RETURNS TRIGGER AS $touch_

Re: [GENERAL] Time Zone design issues

2007-09-16 Thread Troy Rasiah
Alvaro Herrera wrote: > novnov escribió: >> I think I get the picture; this post is the closest to making sense to me (my >> lack of understanding is the issue, obviously). But: >> >> What's the postgresql client, in a web app? >> >> When you write "The web app sets timezone='EST5EDT' and inserts

Re: [GENERAL] Time Zone design issues

2007-09-11 Thread Steve Atkins
On Sep 11, 2007, at 2:48 AM, Gregory Stark wrote: "Ron Johnson" <[EMAIL PROTECTED]> writes: On 09/10/07 19:50, Tom Lane wrote: This whole sub-thread actually is predicated on an assumption not in evidence, which is that there is any browser anywhere that will tell the http server timezone i

Re: [GENERAL] Time Zone design issues

2007-09-11 Thread Gregory Stark
"Ron Johnson" <[EMAIL PROTECTED]> writes: > On 09/10/07 19:50, Tom Lane wrote: > >> This whole sub-thread actually is predicated on an assumption not >> in evidence, which is that there is any browser anywhere that will >> tell the http server timezone information. I'm quite sure no such >> thing

Re: [GENERAL] Time Zone design issues

2007-09-10 Thread Trevor Talbot
> > The browser may not know the setting, or may not tell it to you, > > or you might not be able to make any sense of what it says > > (timezone names are hardly standardized). > > Well that's true. Except for numeric offsets. Offsets aren't good enough due to changing DST rules. A current offs

Re: [GENERAL] Time Zone design issues

2007-09-10 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/10/07 19:50, Tom Lane wrote: > Ron Johnson <[EMAIL PROTECTED]> writes: >> On 09/10/07 15:21, Alvaro Herrera wrote: >>> I wouldn't trust the browser's TZ, and you would need a way to >>> override it. > >> Why? > > The browser may not know the se

Re: [GENERAL] Time Zone design issues

2007-09-10 Thread Tom Lane
Ron Johnson <[EMAIL PROTECTED]> writes: > On 09/10/07 15:21, Alvaro Herrera wrote: >> I wouldn't trust the browser's TZ, and you would need a way to >> override it. > Why? The browser may not know the setting, or may not tell it to you, or you might not be able to make any sense of what it says (

Re: [GENERAL] Time Zone design issues

2007-09-10 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/10/07 15:21, Alvaro Herrera wrote: [snip] > > I wouldn't trust the browser's TZ, and you would need a way to > override it. Why? - -- Ron Johnson, Jr. Jefferson LA USA Give a man a fish, and he eats for a day. Hit him with a fish, and he goe

Re: [GENERAL] Time Zone design issues

2007-09-10 Thread Alvaro Herrera
novnov escribió: > > I think I get the picture; this post is the closest to making sense to me (my > lack of understanding is the issue, obviously). But: > > What's the postgresql client, in a web app? > > When you write "The web app sets timezone='EST5EDT' and inserts a time of > '2007-07-11 12

Re: [GENERAL] Time Zone design issues

2007-09-10 Thread Martijn van Oosterhout
On Mon, Sep 10, 2007 at 12:44:04PM -0700, novnov wrote: > What's the postgresql client, in a web app? Your webapp *is* the postgresql client. The client is whatever opens the connection to the server. > When you write "The web app sets timezone='EST5EDT' and inserts a time of > '2007-07-11 12:30:

Re: [GENERAL] Time Zone design issues

2007-09-10 Thread novnov
I think I get the picture; this post is the closest to making sense to me (my lack of understanding is the issue, obviously). But: What's the postgresql client, in a web app? When you write "The web app sets timezone='EST5EDT' and inserts a time of '2007-07-11 12:30:00'." that's the black box th

  1   2   3   >