Re: Calendar support in localization

2021-03-31 Thread Surafel Temesgen
On Tue, Mar 30, 2021 at 11:16 AM Daniel Verite wrote: > > The conversions from julian dates are not necessarily hard, but the > I/O functions means having localized names for all days, months, eras > of all calendars in all supported languages. If you're thinking of > implementing this from scrat

Re: Calendar support in localization

2021-03-29 Thread Surafel Temesgen
Hi Daniel, On Fri, Mar 26, 2021 at 8:51 PM Daniel Verite wrote: > Thomas Munro wrote: > > > Right, so if this is done by trying to extend Daniel Verite's icu_ext > > extension (link given earlier) and Robert's idea of a fast-castable > > type, I suppose you might want now()::icu_date + '

Re: Calendar support in localization

2021-03-18 Thread Surafel Temesgen
On Wed, Mar 17, 2021 at 3:39 PM Thomas Munro wrote: > On Thu, Mar 18, 2021 at 3:48 AM Tom Lane wrote: > > Right, so if this is done by trying to extend Daniel Verite's icu_ext > extension (link given earlier) and Robert's idea of a fast-castable > type, I suppose you might want now()::icu_date +

Re: Calendar support in localization

2021-03-17 Thread Surafel Temesgen
On Tue, Mar 16, 2021 at 12:20 PM Thomas Munro wrote: > On Wed, Mar 17, 2021 at 6:31 AM Surafel Temesgen > wrote: > > Ethiopice calendar have 13 months so it can not be stored as date and > timestamp type and you approach seems more complicated and i suggest to > have this feat

Re: Calendar support in localization

2021-03-16 Thread Surafel Temesgen
Hi Thomas On Mon, Mar 15, 2021 at 2:58 PM Thomas Munro wrote: > > One key question here is whether you need a different date type or > just different operations (functions, operators etc) on the existing > types. > > I am thinking of having a converter to a specific calendar after each operation

Calendar support in localization

2021-03-15 Thread Surafel Temesgen
Hi all, My country(Ethiopia) is one of the nations that uses different kind of calendar than what PostgreSQL have so we are deprived from the benefit of data datatype. We just uses String to store date that limits our application quality greatly. The lag became even worst once application and syste

Re: WIP: System Versioned Temporal Table

2021-03-11 Thread Surafel Temesgen
On Wed, Mar 10, 2021 at 9:02 AM Vik Fearing wrote: > > I have plenty of objection. I'm sorry that I am taking so long with my > review. I am still working on it and it is coming soon, I promise. > > okay take your time regards Surafel

Re: Evaluate expression at planning time for two more cases

2021-03-10 Thread Surafel Temesgen
Hi Ibrar, On Mon, Mar 8, 2021 at 8:13 AM Ibrar Ahmed wrote: > > It was a minor change therefore I rebased the patch, please take a look. > It is perfect thank you regards Surafel

Re: WIP: System Versioned Temporal Table

2021-03-10 Thread Surafel Temesgen
hi Ibrar, thank you for rebasing On Mon, Mar 8, 2021 at 9:34 AM Ibrar Ahmed wrote: > >> Since the get_row_start_time_col_name() and get_row_end_time_col_name() >> are similar, IMO we can pass a flag to get StartTime/EndTime column name, >> thought? >> >> For me your option is better. i will cha

Re: FETCH FIRST clause PERCENT option

2021-01-26 Thread Surafel Temesgen
On Mon, Jan 25, 2021 at 2:39 PM Kyotaro Horiguchi wrote: > Sorry for the dealy. I started to look this. > > Hi kyotaro, Thanks for looking into this but did we agree to proceed on this approach? I fear that it will be the west of effort if Andrew comes up with the patch for his approach. Andrew G

Re: WIP: System Versioned Temporal Table

2021-01-18 Thread Surafel Temesgen
On Mon, Jan 18, 2021 at 1:43 AM Vik Fearing wrote: > > This is not good, and I see that DROP SYSTEM VERSIONING also removes > these columns which is even worse. Please read the standard that you > are trying to implement! > > The standard states the function of ALTER TABLE ADD SYSTEM VERSIONING

Re: WIP: System Versioned Temporal Table

2021-01-17 Thread Surafel Temesgen
On Sat, Jan 16, 2021 at 10:12 PM Vik Fearing wrote: > > I haven't looked at this patch in a while, but I hope that ALTER TABLE t > ADD SYSTEM VERSIONING is not adding any columns. That is a bug if it does. > > Yes, that is how I implement it. I don't understand how it became a bug? regards Sura

Re: WIP: System Versioned Temporal Table

2021-01-16 Thread Surafel Temesgen
On Fri, Jan 15, 2021 at 8:02 PM Simon Riggs wrote: > > There are no existing applications, so for PostgreSQL, it wouldn't be an > issue. > > Yes we don't have but the main function of ALTER TABLE foo ADD SYSTEM VERSIONING is to add system versioning functionality to existing application regards

Re: WIP: System Versioned Temporal Table

2021-01-15 Thread Surafel Temesgen
On Fri, Jan 15, 2021 at 12:22 AM Simon Riggs wrote: > SELECT * FROM foo FOR SYSTEM_TIME AS OF ... > should NOT include the Start and End timestamp columns > because this acts like a normal query just with a different snapshot > timestamp > > SELECT * FROM foo FOR SYSTEM_TIME BETWEEN x AND y > SHO

Re: WIP: System Versioned Temporal Table

2021-01-15 Thread Surafel Temesgen
On Fri, Jan 15, 2021 at 12:27 AM Simon Riggs wrote: > > Yes, I think it can. The current situation is that the Start or End is > set to the Transaction Start Timestamp. > So if t2 starts before t1, then if t1 creates a row and t2 deletes it > then we will have start=t1 end=t2, but t2 Your tests d

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Surafel Temesgen
Hi Ryan On Fri, Jan 8, 2021 at 7:50 PM Ryan Lambert wrote: > I prefer to have them hidden by default. This was mentioned up-thread > with no decision, it seems the standard is ambiguous. MS SQL appears to > have flip-flopped on this decision [1]. > > I will change it to hidden by default if th

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Surafel Temesgen
Hi Simon, Thank you for all the work you does On Mon, Jan 11, 2021 at 5:02 PM Simon Riggs wrote: > > > * Anomalies around use of CURRENT_TIMESTAMP are not discussed or resolved. > Probably need to add a test that end_timestamp > start_timestamp or ERROR, > which effectively enforces serializabil

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Surafel Temesgen
Hi Andrew, On Fri, Jan 8, 2021 at 4:38 PM Andrew Dunstan wrote: > > On 1/8/21 7:33 AM, Simon Riggs wrote: > > > > * What happens if you ask for a future time? > > It will give an inconsistent result as it scans, so we should refuse a > > query for time > current_timestamp. > > > That seems like a

Re: WIP: System Versioned Temporal Table

2020-12-21 Thread Surafel Temesgen
Hi Ryan, On Fri, Dec 18, 2020 at 10:28 PM Ryan Lambert wrote: > On Thu, Nov 19, 2020 at 11:04 AM Surafel Temesgen > wrote: > > The docs have two instances of "EndtTime" that should be "EndTime". > Since my first language is not english i'm glad you

Re: Evaluate expression at planning time for two more cases

2020-11-23 Thread Surafel Temesgen
Hi Pavel Borisov, It's always good to select the optimal way even if it didn't have performance gain but in case of this patch i see 4x speed up on my laptop and it will work on any table that have NULL constraint regards Surafel

Re: FETCH FIRST clause PERCENT option

2020-09-25 Thread Surafel Temesgen
Hi Michael On Thu, Sep 24, 2020 at 6:58 AM Michael Paquier wrote: > On Mon, Aug 10, 2020 at 01:23:44PM +0300, Surafel Temesgen wrote: > > I also Implement PERCENT WITH TIES option. patch is attached > > i don't start a new tread because the patches share common code > &g

Re: [PATCH] distinct aggregates within a window function WIP

2020-09-16 Thread Surafel Temesgen
On Thu, Mar 5, 2020 at 4:17 AM Krasiyan Andreev wrote: > I have currently suspended development of this patch, based on it's > review, > but I will continue development of the other Oliver Ford's work about > adding support of respect/ignore nulls > for lag(),lead(),first_value(),last_value() and

Re: pg_dump --where option

2020-09-14 Thread Surafel Temesgen
On Fri, Jul 31, 2020 at 1:38 AM Daniel Gustafsson wrote: > > > $ pg_dump -d cary --where="test1:a3 = ( select max(aa1) from test2 )" > > testdump2 > > $ pg_dump: error: processing of table "public.test1" failed > > > > both test1 and test2 exist in the database and the same subquery works > und

Re: Improvements in Copy From

2020-09-10 Thread Surafel Temesgen
On Thu, Sep 10, 2020 at 1:17 PM vignesh C wrote: > > > > > We have a patch for column matching feature [1] that may need a header > line to be further processed. Even without that I think it is preferable to > process the header line for nothing than adding those checks to the loop, > performance

Re: Evaluate expression at planning time for two more cases

2020-09-10 Thread Surafel Temesgen
On Tue, Sep 8, 2020 at 12:59 PM Surafel Temesgen wrote: > Hi Tom > > On Tue, Sep 8, 2020 at 4:46 AM Tom Lane wrote: > > >> The "check_null_side" code you're proposing seems really horrid. >> For one thing, it seems quite out of place for eval_const_exp

Re: Evaluate expression at planning time for two more cases

2020-09-08 Thread Surafel Temesgen
Hi Tom On Tue, Sep 8, 2020 at 4:46 AM Tom Lane wrote: > Surafel Temesgen writes: > > [ null_check_on_pkey_optimization_v1.patch ] > > I took a very brief look at this. > > > I don’t add NOT NULL constraint optimization to the patch because cached > > plan is

Re: proposal: possibility to read dumped table's name from file

2020-09-07 Thread Surafel Temesgen
Hi Pavel On Fri, Sep 4, 2020 at 6:22 AM Pavel Stehule wrote: > > Here is updated patch for pg_dump > > pg_dumpall also has –exclude-database=pattern and –no-comments option doesn't that qualify it to benefits from this feature? And please add a test case for this option regards Surafel

Re: Improvements in Copy From

2020-09-07 Thread Surafel Temesgen
Hi Vignesh On Wed, Jul 1, 2020 at 3:46 PM vignesh C wrote: > Hi, > > While reviewing copy from I identified few improvements for copy from > that can be done : > a) copy from stdin copies lesser amount of data to buffer even though > space is available in buffer because minread was passed as 1

Re: [PATCH] Allow queries in WHEN expression of FOR EACH STATEMENT triggers

2020-09-03 Thread Surafel Temesgen
Hi Joe, This is my review of your patch On Fri, Jul 17, 2020 at 1:22 AM Joe Wildish wrote: > Hi hackers, > > Attached is a patch for supporting queries in the WHEN expression of > statement triggers. - Currently, WHEN expressions cannot contain - subqueries. subqueries in row trigger's is

Re: Evaluate expression at planning time for two more cases

2020-09-01 Thread Surafel Temesgen
Hi , Thank you for looking into this On Fri, Aug 28, 2020 at 9:48 AM Ashutosh Bapat wrote: > } > else > has_nonconst_input = true; > @@ -3382,7 +3395,47 @@ eval_const_expressions_mutator(Node *node, > > + > +

Evaluate expression at planning time for two more cases

2020-08-27 Thread Surafel Temesgen
Hi, In good written query IS NULL and IS NOT NULL check on primary and non null constraints columns should not happen but if it is mentioned PostgreSQL have to be smart enough for not checking every return result about null value on primary key column. Instead it can be evaluate its truth value an

Re: FETCH FIRST clause PERCENT option

2020-08-10 Thread Surafel Temesgen
Hi > PERCENT and WITH TIES can play together, per spec. > I also Implement PERCENT WITH TIES option. patch is attached i don't start a new tread because the patches share common code regards Surafel diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 9fc

Re: Decomposing xml into table

2020-06-23 Thread Surafel Temesgen
Hey Tom On Mon, Jun 22, 2020 at 10:13 PM Tom Lane wrote: > Big -1 on that. COPY is not for general-purpose data transformation. > The more unrelated features we load onto it, the slower it will get, > and probably also the more buggy and unmaintainable. what new format handling takes to add r

Re: Decomposing xml into table

2020-06-23 Thread Surafel Temesgen
hey Pavel On Mon, Jun 22, 2020 at 9:59 PM Pavel Stehule wrote: > > Did you try the xmltable function? > > yes i know it but i am proposing changing given xml data in to relational form and insert it to desired table at once regards Surafel

Decomposing xml into table

2020-06-22 Thread Surafel Temesgen
In PostgreSQL there are a function table_to_xml to map the table content to xml value but there are no functionality to decompose xml back into table which can be used in system that uses xml for transport only or there are a need to migrate to database system to use database functionality. I prop

pg_dump --where option

2020-06-15 Thread Surafel Temesgen
Internally pg_dump have capability to filter the table data to dump by same filter clause but it have no interface to use it and the patch here [1] adds interface to it but it have at-least two issue, one is error message in case of incorrect where clause specification is somehow hard to debug and

Re: Conflict handling for COPY FROM

2020-03-30 Thread Surafel Temesgen
On Fri, Mar 27, 2020 at 3:27 PM Tom Lane wrote: > Surafel Temesgen writes: > > [ conflict-handling-copy-from-v16.patch ] > > I took a quick look at this patch, since it was marked "ready for > committer", but I don't see how it can possibly be considered comm

Re: Conflict handling for COPY FROM

2020-03-26 Thread Surafel Temesgen
Hi Takanori Asaba, > > > Although it is a small point, it may be better like this: > +70005 27 36 46 56 -> 70005 27 37 47 57 > > done > I want to discuss about copy from binary file. > It seems that this patch tries to avoid the error that number of field is > di

Re: A rather hackish POC for alternative implementation of WITH TIES

2020-03-26 Thread Surafel Temesgen
On Wed, Jan 22, 2020 at 3:35 PM Andrew Gierth wrote: > > "Alvaro" == Alvaro Herrera writes: > > > I was largely holding off on doing further work hoping for some > discussion of which way we should go. If you think my approach is worth > pursuing (I haven't seriously tested the performance,

Re: WIP: System Versioned Temporal Table

2020-03-10 Thread Surafel Temesgen
Hi, On Tue, Mar 3, 2020 at 9:33 PM David Steele wrote: > Hi Surafel, > > On 1/3/20 5:57 AM, Surafel Temesgen wrote: > > Rebased and conflict resolved i hope it build clean this time > > This patch no longer applies according to cfbot and there are a number > of review

Re: Conflict handling for COPY FROM

2020-03-09 Thread Surafel Temesgen
On Fri, Mar 6, 2020 at 11:30 AM asaba.takan...@fujitsu.com < asaba.takan...@fujitsu.com> wrote: > Hello Surafel, > > Sorry for my late reply. > > From: Surafel Temesgen > >On Thu, Dec 12, 2019 at 7:51 AM mailto:asaba.takan...@fujitsu.com > <mailto:asaba.takan...@

Re: [PATCH v1] Allow COPY "text" to output a header and add header matching mode to COPY FROM

2020-03-01 Thread Surafel Temesgen
On Mon, Mar 2, 2020 at 2:45 AM Rémi Lapeyre wrote: > > I created an entry for this patch in the new CommiFest but it seems that > it is not finding it. Is there anything that I need to do? > > Is is added on next open commit fest which is https://commitfest.postgresql.org/28/ now regards Suraf

Re: Conflict handling for COPY FROM

2020-02-17 Thread Surafel Temesgen
On Mon, Feb 17, 2020 at 10:00 AM Tatsuo Ishii wrote: > >> test=# copy t1 from '/tmp/a' with (error_limit 1); > >> ERROR: duplicate key value violates unique constraint "t1_pkey" > >> DETAIL: Key (i)=(2) already exists. > >> CONTEXT: COPY t1, line 2: "2 2" > >> > >> So if the number of errors

Re: Conflict handling for COPY FROM

2020-02-16 Thread Surafel Temesgen
Hi, > > ERROR_LIMIT ' class="parameter">limit_number' > > > > I think this should be: > > > > ERROR_LIMIT limit_number > > > > (no single quote) > > Thank you .Fixed > More comments: > > - I think the document should stat that if limit_number = 0, all > errors are immediately raised (be

Re: [PATCH v1] Allow COPY "text" format to output a header

2020-02-05 Thread Surafel Temesgen
On Wed, Feb 5, 2020 at 4:19 PM Rémi Lapeyre wrote: > > > > FWIW there was more recent propose patch at > https://www.postgresql.org/message-id/flat/caf1-j-0ptcwmeltswwgv2m70u26n4g33gpe1rckqqe6wvqd...@mail.gmail.com > > and among feedback given is to adding header matching feature on to > this. >

Re: [PATCH v1] Allow COPY "text" format to output a header

2020-02-04 Thread Surafel Temesgen
Hi, On Tue, Feb 4, 2020 at 4:25 PM Rémi Lapeyre wrote: > This patch adds the possibility to use the "header" option when using COPY > with > the text format. A todo entry was opened for this and I updated the tests > and > the documentation. > > This was previously discussed at > https://www.post

Re: can we use different function in place of atoi in vacuumdb.c file

2020-01-26 Thread Surafel Temesgen
Hi, On Thu, Jan 23, 2020 at 3:56 PM Mahendra Singh Thalor wrote: > Hi all, > While reviewing one patch, I found that if we give any non-integer string > to atoi (say aa), then it is returning zero(0) as output so we are not > giving any error(assuming 0 as valid argument) and continuing our > ope

Re: FETCH FIRST clause WITH TIES option

2020-01-21 Thread Surafel Temesgen
On Thu, Nov 28, 2019 at 5:49 PM Alvaro Herrera wrote: > On 2019-Nov-28, Surafel Temesgen wrote: > > > On Thu, Nov 28, 2019 at 12:36 AM Alvaro Herrera < > alvhe...@2ndquadrant.com> > > wrote: > > > > > I think you should add a /* fall-though */ comme

Re: A rather hackish POC for alternative implementation of WITH TIES

2020-01-06 Thread Surafel Temesgen
On Fri, Nov 29, 2019 at 8:40 AM Andrew Gierth wrote: > This patch is a rather hacky implementation of the basic idea for > implementing FETCH ... WITH TIES, and potentially also PERCENT, by using > a window function expression to compute a stopping point. > > Large chunks of this (the parser/rule

Re: WIP: System Versioned Temporal Table

2020-01-05 Thread Surafel Temesgen
On Mon, Oct 28, 2019 at 6:36 PM Vik Fearing wrote: > On 28/10/2019 13:48, Surafel Temesgen wrote: > > > > > > On Fri, Oct 25, 2019 at 10:45 PM Vik Fearing > > mailto:vik.fear...@2ndquadrant.com>> > wrote: > > > > > >

Re: WIP: System Versioned Temporal Table

2020-01-05 Thread Surafel Temesgen
On Fri, Jan 3, 2020 at 4:22 PM Vik Fearing wrote: > > > > Rebased and conflict resolved i hope it build clean this time > > > > It does but you haven't included your tests file so `make check` fails. > > > what tests file? i add system_versioned_table.sql and system_versioned_table.out test files

Re: WIP: System Versioned Temporal Table

2020-01-03 Thread Surafel Temesgen
gards Surafel From 640f8fc466acc90f0e46d65f21077f652651f34f Mon Sep 17 00:00:00 2001 From: Surafel Temesgen Date: Fri, 3 Jan 2020 13:50:19 +0300 Subject: [PATCH] system versioned temporal table --- doc/src/sgml/ref/alter_table.sgml | 23 ++ doc/src/sgml/ref/create_table.sgml| 47 doc/src/sg

Re: WIP: System Versioned Temporal Table

2020-01-01 Thread Surafel Temesgen
Hi, Attached is a complete patch and also contain a fix for your comments regards Surafel From 0a1e51b6fcce03014e3ee355d42443add4da7a28 Mon Sep 17 00:00:00 2001 From: Surafel Temesgen Date: Wed, 1 Jan 2020 13:27:25 +0300 Subject: [PATCH] system versioned temporal table --- doc/src/sgml/ref

Re: Conflict handling for COPY FROM

2019-12-16 Thread Surafel Temesgen
On Thu, Dec 12, 2019 at 7:51 AM asaba.takan...@fujitsu.com < asaba.takan...@fujitsu.com> wrote: > 2. I have a question about copy meta-command. > When I executed copy meta-command, output wasn't displayed. > Does it correspond to copy meta-command? > > Fixed regards Surafel diff --git a/doc/src/s

Re: Conflict handling for COPY FROM

2019-12-12 Thread Surafel Temesgen
Hi Asaba, On Thu, Dec 12, 2019 at 7:51 AM asaba.takan...@fujitsu.com < asaba.takan...@fujitsu.com> wrote: > Hello Surafel, > > I'm very interested in this patch. > Although I'm a beginner,I would like to participate in the development of > PostgreSQL. > > > 1. I want to suggest new output format.

Re: FETCH FIRST clause WITH TIES option

2019-11-28 Thread Surafel Temesgen
456789 │ -4567890123456789 > (4 filas) > > This is just crazy. > > I think you need to stare a that thing a little harder. > > This is because the new state didn't know about backward scan and there was off by one error it scan one position past to detect ties. The attac

Re: FETCH FIRST clause WITH TIES option

2019-11-27 Thread Surafel Temesgen
; research. > Done regards Surafel From 9d02731c2d96bedb72d5f526a64f1fd28ee334c5 Mon Sep 17 00:00:00 2001 From: Surafel Temesgen Date: Wed, 27 Nov 2019 11:46:45 +0300 Subject: [PATCH] limit with ties --- doc/src/sgml/ref/select.sgml| 15 +-- src/backend/catalog/sql_features

Re: Conflict handling for COPY FROM

2019-11-24 Thread Surafel Temesgen
On Thu, Nov 21, 2019 at 4:22 PM Alexey Kondratov wrote: > > Now the whole patch works exactly as expected for me and I cannot find > any new technical flaws. However, the doc is rather vague, especially > these places: > > + specifying it to -1 returns all error record. > > Actually, we retu

Re: Conflict handling for COPY FROM

2019-11-17 Thread Surafel Temesgen
On Fri, Nov 15, 2019 at 6:24 PM Alexey Kondratov wrote: > On 11.11.2019 16:00, Surafel Temesgen wrote: > > > > > > Next, you use DestRemoteSimple for returning conflicting tuples back: > > > > +dest = CreateDestReceiver(DestRemoteSimple); >

Re: FETCH FIRST clause WITH TIES option

2019-11-12 Thread Surafel Temesgen
On Mon, Nov 11, 2019 at 5:56 PM Alvaro Herrera wrote: > First, I noticed that there's a significant unanswered issue from Andrew > Gierth about this using a completely different mechanism, namely an > implicit window function. I see that Robert was concerned about the > performance of Andrew's p

Re: Conflict handling for COPY FROM

2019-11-11 Thread Surafel Temesgen
On Fri, Sep 20, 2019 at 4:16 PM Alexey Kondratov wrote: > > First of all, there is definitely a problem with grammar. In docs ERROR > is defined as option and > > COPY test FROM '/path/to/copy-test-simple.csv' ERROR -1; > > works just fine, but if modern 'WITH (...)' syntax is used: > > COPY test

Re: WIP: System Versioned Temporal Table

2019-10-28 Thread Surafel Temesgen
On Fri, Oct 25, 2019 at 10:45 PM Vik Fearing wrote: > > > > I don't understand what you mean by this. > > > > > > > > The primary purpose of adding row end time to primary key is to allow > > duplicate value to be inserted into a table with keeping constraint in > > current data but it can be

Re: WIP: System Versioned Temporal Table

2019-10-25 Thread Surafel Temesgen
On Thu, Oct 24, 2019 at 6:49 PM Vik Fearing wrote: > On 24/10/2019 16:54, Surafel Temesgen wrote: > > > > hi Vik, > > On Wed, Oct 23, 2019 at 9:02 PM Vik Fearing > > mailto:vik.fear...@2ndquadrant.com>> > wrote: > > > > > > > > If

Re: WIP: System Versioned Temporal Table

2019-10-24 Thread Surafel Temesgen
hi Vik, On Wed, Oct 23, 2019 at 9:02 PM Vik Fearing wrote: > > If we're going to be implicitly adding stuff to the PK, we also need to > add that stuff to the other unique constraints, no? And I think it > would be better to add both the start and the end column to these keys. > Most of the tem

WIP: System Versioned Temporal Table

2019-10-23 Thread Surafel Temesgen
Hi all , Temporal table is one of the main new features added in sql standard 2011. >From that I will like to implement system versioned temporal table which allows to keep past and present data so old data can be queried. Am propose to implement it like below CREATE In create table only one tab

Re: Option to dump foreign data in pg_dump

2019-09-23 Thread Surafel Temesgen
On Fri, Sep 20, 2019 at 6:20 PM Luis Carril wrote: > Hello, >thanks for the comments! > > * + if (tdinfo->filtercond || tbinfo->relkind == RELKIND_FOREIGN_TABLE) > > filter condition is not implemented completely yet so the logic only work > on foreign table so I think its better to handle it

Re: FETCH FIRST clause PERCENT option

2019-09-19 Thread Surafel Temesgen
Hi Tom, In the attached patch i include the comments given regards Surafel diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 82d8140ba2..692d6492bd 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -3035,7 +3035

Re: Option to dump foreign data in pg_dump

2019-09-18 Thread Surafel Temesgen
Hi Luis, Here is a few comment for me *I suggest the option to be just –foreign-data because if we make it –include-foreign-data its expected to have –exclude-foreign-data option too. *please add test case * + if (tdinfo->filtercond || tbinfo->relkind == RELKIND_FOREIGN_TABLE) filter condition

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2019-09-17 Thread Surafel Temesgen
Hi Alexey Here are a few comment On Sat, Aug 31, 2019 at 11:54 PM wrote: > Hi hackers, > > > Anyway, new patch, which adds SET TABLESPACE to REINDEX is attached and > this functionality seems really useful, so I will be very appreciate if > someone will take a look on it. > * There are NOWAIT op

Re: FETCH FIRST clause WITH TIES option

2019-09-10 Thread Surafel Temesgen
On Fri, Sep 6, 2019 at 5:07 PM Alvaro Herrera from 2ndQuadrant < alvhe...@alvh.no-ip.org> wrote: > On 2019-Sep-06, Surafel Temesgen wrote: > > > > ... yet this doesn't appear to have resulted in any change in the code, > > > or I just missed it. Are you

Re: FETCH FIRST clause WITH TIES option

2019-09-06 Thread Surafel Temesgen
Hi Alvaro, On Fri, Sep 6, 2019 at 1:52 AM Alvaro Herrera from 2ndQuadrant < alvhe...@alvh.no-ip.org> wrote: > As Tom just said in the thread for PERCENT, the gram.y changes need a > better representation. Also, rename EXACT_NUMBER, per that thread. > > As far as I can tell, this concerns feature

Re: FETCH FIRST clause PERCENT option

2019-09-06 Thread Surafel Temesgen
Hi Tom, On Fri, Sep 6, 2019 at 1:26 AM Tom Lane wrote: > Surafel Temesgen writes: > > [ percent-incremental-v8.patch ] > > I took a quick look through this. > > * Why is this adding new functionality in tuplestore.c? Especially > functionality to get out a different t

Take skip header out of a loop in COPY FROM

2019-08-22 Thread Surafel Temesgen
Hello, Even if skipping header is done only once its checked and skipped in a loop. If I don’t miss something it can be done out side a loop like attached patch regards Surafel diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 4f04d122c3..4e7709d7bf 100644 --- a/src/ba

Re: FETCH FIRST clause PERCENT option

2019-08-22 Thread Surafel Temesgen
On Tue, Aug 20, 2019 at 9:10 AM Kyotaro Horiguchi wrote: > Hi, > > At Wed, 7 Aug 2019 10:20:09 +0300, Surafel Temesgen > wrote in < > calay4q98xbvhtz4yj9dccmg2-s1_jurr7fyanfw+bkmr22o...@mail.gmail.com> > > Hi > > On Wed, Aug 7, 2019 at 6:11 AM Kyotaro Hori

Re: FETCH FIRST clause PERCENT option

2019-08-19 Thread Surafel Temesgen
On Mon, Aug 19, 2019 at 1:55 PM Erik Rijkers wrote: > Another little thing, not sure it's a bug: > > limit interprets its argument by rounding up or down as one would > expect: > > table onek limit 10.4; --> gives 10 rows > table onek limit 10.6; --> gives 11 rows > > but FETCH count PERCENT

Re: FETCH FIRST clause PERCENT option

2019-08-19 Thread Surafel Temesgen
Hi Erik On Mon, Aug 19, 2019 at 10:47 AM Erik Rijkers wrote: > Hi, > > (running with those two patches applied) > >select * from onek where thousand < 5 order by thousand fetch first -1 > percent rows only > is correctly caught (with "ERROR: PERCENT must not be negative") but: > >select

Re: FETCH FIRST clause PERCENT option

2019-08-07 Thread Surafel Temesgen
Hi On Wed, Aug 7, 2019 at 6:11 AM Kyotaro Horiguchi wrote: > > I have some comments. > > This patch uses distinct parameters for exact number and > percentage. On the othe hand planner has a notion of > tuple_fraction covering the both. The same handling is also used > for tuple number estimation

Re: FETCH FIRST clause PERCENT option

2019-08-01 Thread Surafel Temesgen
Hi Ryan, sorry for not be fast to replay > I was suggesting a warning in the documentation so users aren't caught > unaware about the performance characteristics. My first version was very > rough, how about adding this in doc/src/sgml/ref/select.sgml? > > "Using PERCENT is best suited to return

Re: FETCH FIRST clause PERCENT option

2019-07-17 Thread Surafel Temesgen
Hi Ryan, On Tue, Jul 9, 2019 at 4:13 PM Ryan Lambert wrote: > > "It is possible for FETCH FIRST N PERCENT to create poorly performing > query plans when the N supplied exceeds 50 percent. In these cases query > execution can take an order of magnitude longer to execute than simply > returning th

Re: Conflict handling for COPY FROM

2019-07-16 Thread Surafel Temesgen
On Sun, Jul 14, 2019 at 7:40 PM Alvaro Herrera wrote: > > error_limit being an integer, please don't use it as a boolean: > > if (cstate->error_limit) > ... > > Add an explicit comparison to zero instead, for code readability. > Also, since each error decrements the same variable, it becomes

Re: Conflict handling for COPY FROM

2019-07-11 Thread Surafel Temesgen
Hi > > Also, I would prefer having an option to ignore all errors, e.g. with > option ERROR_LIMIT set to -1. Because it is rather difficult to estimate > a number of future errors if you are playing with some badly structured > data, while always setting it to 100500k looks ugly. > Here are the p

Re: FETCH FIRST clause PERCENT option

2019-07-10 Thread Surafel Temesgen
Hi Alvaro, On Wed, Jul 10, 2019 at 6:44 PM Alvaro Herrera wrote: > What's with the new tuplestore function for getting heap tuples? That > looks really odd. > Previously I create new TTSOpsMinimalTuple type slots for every tuple returned in order to fetch it from tuplestore because tuplestore

Re: extension patch of CREATE OR REPLACE TRIGGER

2019-07-10 Thread Surafel Temesgen
Hi Takamichi Osumi, On Tue, Jul 9, 2019 > I've rebased the previous patch to be applied > I don't test your patch fully yet but here are same comment. There are same white space issue like here - bool is_internal) + bool is_internal, + Oid existing_constraint_oid) in a few place + // trigoid

Re: FETCH FIRST clause PERCENT option

2019-07-09 Thread Surafel Temesgen
Hi Ryan, On Tue, Jul 9, 2019 at 1:27 AM Ryan Lambert wrote: > Hi Surafel, > > The v5 patch [1] applies cleanly and passes make installcheck-world. > > My concern with this is its performance. As a user I would expect using > this feature to enable queries to run faster than they would simply pul

Re: FETCH FIRST clause PERCENT option

2019-07-08 Thread Surafel Temesgen
Hi Thomas, Thank you for informing me Hi Surafel, > > There's a call to adjust_limit_rows_costs() hiding under > contrib/postgres_fdw, so this fails check-world. > Fixed . I also include the review given by Ryan in attached patch regards Surafel diff --git a/contrib/postgres_fdw/postgres_fdw.c b

Re: Conflict handling for COPY FROM

2019-07-03 Thread Surafel Temesgen
Hi Alexey, Thank you for looking at it On Tue, Jul 2, 2019 at 7:57 PM Alexey Kondratov wrote: > On 28.06.2019 16:12, Alvaro Herrera wrote: > >> On Wed, Feb 20, 2019 at 7:04 PM Andres Freund > wrote: > >>> Or even just return it as a row. CopyBoth is relatively widely > supported > >>> these day

Re: FETCH FIRST clause WITH TIES option

2019-07-03 Thread Surafel Temesgen
Hi Erik, Thank you for looking at it. Can you have a look? > > It is because of the patch didn't handle that edge case. attache patch contain a fix for it regards Surafel diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml index 06d611b64c..e83d309c5b 100644 --- a/doc/src/sg

Re: Introduce MIN/MAX aggregate functions to pg_lsn

2019-07-02 Thread Surafel Temesgen
Hi, Here are same review comment - any numeric, string, date/time, network, or enum type, + any numeric, string, date/time, network, lsn, or enum type, or arrays of these types same as argument type In the documentation it refereed as pg_lsn type rather than lsn alone

Change atoi to strtol in same place

2019-07-01 Thread Surafel Temesgen
Hello, we use atoi for user argument processing in same place which return zero for both invalid input and input value zero. In most case its ok because we error out with appropriate error message for input zero but in same place where we accept zero as valued input it case a problem by preceding

Re: FETCH FIRST clause WITH TIES option

2019-07-01 Thread Surafel Temesgen
Hi Thomas On Mon, Jul 1, 2019 at 1:31 PM Thomas Munro wrote: > On Mon, Apr 8, 2019 at 8:26 PM Surafel Temesgen > wrote: > > agree > > Hi Surafel, > > A new Commitfest is starting. Can you please post a fresh rebase of this > patch? > > Thank you for informing.

Re: Conflict handling for COPY FROM

2019-06-28 Thread Surafel Temesgen
On Wed, Feb 20, 2019 at 7:04 PM Andres Freund wrote: > > > On February 20, 2019 6:05:53 AM PST, Andrew Dunstan < > andrew.duns...@2ndquadrant.com> wrote: > > > >On 2/20/19 8:01 AM, Surafel Temesgen wrote: > >> > >> > >> On Tue, Feb 19, 201

Re: FETCH FIRST clause PERCENT option

2019-06-27 Thread Surafel Temesgen
Hello, The attached patch include the fix for all the comment given regards Surafel On Mon, Apr 1, 2019 at 12:34 AM Andres Freund wrote: > Hi, > > On 2019-03-29 12:04:50 +0300, Surafel Temesgen wrote: > > > + if (node->limi

Re: with oids option not removed in pg_dumpall

2019-05-23 Thread Surafel Temesgen
Thank you for applying regards Surafel On Thu, May 23, 2019 at 3:43 AM Michael Paquier wrote: > On Tue, May 21, 2019 at 05:24:57PM +0900, Michael Paquier wrote: > > Good catch. Your cleanup looks correct to me. Andres, perhaps you > > would prefer doing the cleanup yourself? > > As I am clean

with oids option not removed in pg_dumpall

2019-05-20 Thread Surafel Temesgen
Hello, Commit 578b229718e8f remove oids option from pg_dump but its is still in pg_dumpall .The attach patch remove it regards Surafel diff --git a/doc/src/sgml/ref/pg_dumpall.sgml b/doc/src/sgml/ref/pg_dumpall.sgml index 24c8c031d6..b35c702f99 100644 --- a/doc/src/sgml/ref/pg_dumpall.sgml +++ b/do

Re: FETCH FIRST clause WITH TIES option

2019-04-08 Thread Surafel Temesgen
On Sun, Apr 7, 2019 at 1:39 AM Tomas Vondra wrote: > > 1) I've removed the costing changes. As Tom mentions elsewhere in this > thread, that's probably not needed for v1 and it's true those estimates > are probably somewhat sketchy anyway. > > > 2) v8 did this (per my comment): > > - ExecSe

Re: FETCH FIRST clause PERCENT option

2019-04-05 Thread Surafel Temesgen
On Tue, Mar 26, 2019 at 5:46 PM Tomas Vondra wrote: > On Tue, Mar 26, 2019 at 03:06:52PM +0300, Surafel Temesgen wrote: > >On Thu, Feb 28, 2019 at 11:16 PM Tomas Vondra < > tomas.von...@2ndquadrant.com> > >wrote: > > > >> > >> To give you a (admit

Re: FETCH FIRST clause PERCENT option

2019-04-05 Thread Surafel Temesgen
Thank you for looking at it On Mon, Apr 1, 2019 at 12:34 AM Andres Freund wrote: > Hi, > > On 2019-03-29 12:04:50 +0300, Surafel Temesgen wrote: > > > + if (node->limi

Re: FETCH FIRST clause PERCENT option

2019-04-05 Thread Surafel Temesgen
On Tue, Mar 26, 2019 at 5:46 PM Tomas Vondra wrote: > On Tue, Mar 26, 2019 at 03:06:52PM +0300, Surafel Temesgen wrote: > > As for the OFFSET, I don't see why that would be incompatible with PERCENT > clause. I'm not sure if it should compute the percentage from the

Re: Re: FETCH FIRST clause WITH TIES option

2019-03-31 Thread Surafel Temesgen
On Sun, Mar 31, 2019 at 3:14 AM Tomas Vondra wrote: > > > Hi, > > I got to look at the patch today, with the intent to commit, but sadly I > ran into a couple of minor issues that I don't feel comfortable fixing > on my own. Attached is a patch highlighling some of the places (0001 is > your v7 p

Re: FETCH FIRST clause PERCENT option

2019-03-29 Thread Surafel Temesgen
Hi, On Thu, Feb 28, 2019 at 2:50 PM Kyotaro HORIGUCHI < horiguchi.kyot...@lab.ntt.co.jp> wrote: > > -* previous time we got a different result. > +* previous time we got a different result.In PERCENTAGE option > there are > +* no bound on the number of output tuples */

  1   2   >