Re: Window function?

2022-06-04 Thread John W Higgins
On Sat, Jun 4, 2022 at 1:18 AM Robert Stanford wrote: > Hi, > > From this: > Input Start End > 5 2022-06-04 09:09:00 2022-06-04 09:09:29 > 4 2022-06-04 09:08:50 2022-06-04 09:09:00 > 4 2022-06-04 09:08:10 2022-06-04 09:08:50 > 4 2022-06-04 09:07:4

Re: Call pstrdup() of palloc.h will change source string, please help!

2022-06-04 Thread Tom Lane
"=?ISO-8859-1?B?bWVuZ2Zhbmp1bg==?=" writes: > pstrdup() will change source "system_time( stt , ett )" to "system_time( stt > " and return "system_time( stt " when it is called > in ValidateForeignTableOptions() and CStoreGetOptions(). That claim is not very credible. I'm not sure where the bug

Re: unoptimized nested loops

2022-06-04 Thread Tim Kelly
I resolved the problem by eliminating the planner from the decision making altogether, through using a (permanently) temporary table populated by the subset of data records from an initial query generated from the metadata, then searching only in the temp table for the actual data records I wan

Call pstrdup() of palloc.h will change source string, please help!

2022-06-04 Thread mengfanjun
Hello, I'm working on modifying an postgresql extension called "cstore_fdw". My function is like: > static bool ParsePeriod(const char *periodString, Period *result) {     bool isSuccess = true;     char *dupPeriodForString;         char delimiters[

Re: Window function?

2022-06-04 Thread David G. Johnston
On Sat, Jun 4, 2022 at 7:50 AM Tom Lane wrote: > Robert Stanford writes: > > Can anyone suggest an elegant way to coalesce consecutive rows so only > the > > first start time and last end time for each group of events (by input) is > > returned. > > Window functions don't change the number of qu

Re: Why password authentication failed for user "postgres"?

2022-06-04 Thread Jeff Janes
On Fri, Jun 3, 2022 at 6:32 PM BeginnerC wrote: > Hello everyone, > I am a newbie to the postgres,when I use the psql to connect to the > postgres,a error message printed: > These command list like this: > > psql -U postgres > Password for user postgres:postgres > *postgreSQL: password authentica

Re: Window function?

2022-06-04 Thread Tom Lane
Robert Stanford writes: > Can anyone suggest an elegant way to coalesce consecutive rows so only the > first start time and last end time for each group of events (by input) is > returned. Window functions don't change the number of query result rows, so that idea is a dead end. The standard way

Re: Window function?

2022-06-04 Thread Robert Stanford
On Sat, 4 Jun 2022 at 22:56, Thiemo Kellner wrote: > Hi Robert > > Interesting problem. I need to think about it. > > You need to figure out when Input changes. You can achieve this by using > lead or lag (depending of the sort direction over start) > https://www.postgresql.org/docs/current/funct

Re: Window function?

2022-06-04 Thread Thiemo Kellner
Hi Robert Interesting problem. I need to think about it. You need to figure out when Input changes. You can achieve this by using lead or lag (depending of the sort direction over start) https://www.postgresql.org/docs/current/functions-window.html . Hope this nudges you to a solution. Kind

Window function?

2022-06-04 Thread Robert Stanford
Hi, I have time series data from multiple inputs with start and end timestamps. Can anyone suggest an elegant way to coalesce consecutive rows so only the first start time and last end time for each group of events (by input) is returned. Sample from and to below where the rows for Input number