Re: Resolve UNKNOWN type to relevant type instead of text type while bulk update using values

2023-01-04 Thread Sayyid Ali Sajjad Rizavi
be resolved to `text` type. On Thu, Jan 5, 2023 at 11:23 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wednesday, January 4, 2023, Sayyid Ali Sajjad Rizavi < > sasriz...@gmail.com> wrote: >> >> >> *Option 1:* Cast to the relevant column typ

Resolve UNKNOWN type to relevant type instead of text type while bulk update using values

2023-01-04 Thread Sayyid Ali Sajjad Rizavi
Hi ! I discovered an interesting behavior in PostgreSQL bulk update query using `from (values %s)` syntax. Let's see an example; ``` update persons p set age = t.age from ( values ('uuid1', null), ('uuid2', null) ) as t(id, age) where p.id = t.id; ``` The `age` column is of

Re: [PATCH] Add .idea to gitignore for JetBrains CLion

2022-12-04 Thread Sayyid Ali Sajjad Rizavi
I searched the commit fest app and there's already someone who has made this. On Sun, Dec 4, 2022 at 7:28 AM Sayyid Ali Sajjad Rizavi wrote: > From 6d10dafdd7c7789eddd7fd72ca22dfde74febe23 Mon Sep 17 00:00:00 2001 > From: Ali Sajjad > Date: Sun, 4 Dec 2022 06:03:11 -0800 > Subject:

[PATCH] Add .idea to gitignore for JetBrains CLion

2022-12-04 Thread Sayyid Ali Sajjad Rizavi
>From 6d10dafdd7c7789eddd7fd72ca22dfde74febe23 Mon Sep 17 00:00:00 2001 From: Ali Sajjad Date: Sun, 4 Dec 2022 06:03:11 -0800 Subject: [PATCH] Add .idea to gitignore for JetBrains CLion --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index

Re: Enable pg_stat_statements extension for limited statements only

2022-11-30 Thread Sayyid Ali Sajjad Rizavi
. Basically keeping track of queries. Although now I'm less convinced if a considerable amount of people will be interested in this, but let me know what you think. On Wed, Nov 30, 2022 at 10:15 AM Tom Lane wrote: > Sayyid Ali Sajjad Rizavi writes: > > Hi, I'd like to propose a change and g

Allow round() function to accept float and double precision

2022-11-30 Thread Sayyid Ali Sajjad Rizavi
Whenever rounding a number to a fixed number of decimal points in a calculation, we need to cast the number into a numeric before using round((col1/100.0)::numeric, 2). It would be convenient for everyone if round() also accepts float and double precision. Is this something I could work with?

Enable pg_stat_statements extension for limited statements only

2022-11-30 Thread Sayyid Ali Sajjad Rizavi
Hi, I'd like to propose a change and get advice if I should work on it. The extension pg_stat_statements is very helpful, but the downside is that it will take up too much disk space when storing query stats if it's enabled for all statements like SELECT, INSERT, UPDATE, DELETE. For example,