Custom GUCs and typos

2025-05-25 Thread Srinath Reddy Sadipiralla
refix. 3) I also added all the above support for the SET command also which previously was not there. 4) TODO: add support for ALTER SYSTEM SET ,if this patch makes sense. thoughts? [0] https://www.postgresql.org/message-id/flat/196f3f8e12f.87666a6c16169.9160742057750715009%40zohocorp.com --

Re: [Util] Warn and Remove Invalid GUCs

2025-05-22 Thread Srinath Reddy Sadipiralla
On Thu, May 22, 2025 at 9:00 PM Tom Lane wrote: > Srinath Reddy Sadipiralla writes: > > the extension is loaded and then i entered the bogus extension GUC into > > postgresql.conf and restarted, i did not observe any complain/warning . > > Were you looking in the right p

Re: [Util] Warn and Remove Invalid GUCs

2025-05-22 Thread Srinath Reddy Sadipiralla
+ { + struct config_generic *var = hentry->gucvar; + + if((var->flags & GUC_CUSTOM_PLACEHOLDER) != 0 && !has_valid_class_prefix(var->name)){ + ereport(WARNING, + (errcode(ERRCODE_INVALID_NAME), + errmsg("invalid configuration parameter name \"%s\", removing it", + var

Support for Physical Column Reordering in PG

2025-05-18 Thread Srinath Reddy Sadipiralla
ql command to reposition the column like other databases makes sense? thoughts ? -- Thanks, Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/

Re: Make wal_receiver_timeout configurable per subscription

2025-05-16 Thread Srinath Reddy Sadipiralla
roach is simpler and likely sufficient, I'd prefer starting with this. > Thought? Both ways LGTM,for starters we can go with changing GUC's context. > BTW, this could be extended in the future to other GUCs used by > logical replication workers, such as wal_retrieve_retry_in

Re: Suggestion to add --continue-client-on-abort option to pgbench

2025-05-14 Thread Srinath Reddy Sadipiralla
lag, case ESTATUS_DEADLOCK_ERROR: stats->deadlock_failures++; break; + case ESTATUS_OTHER_SQL_ERROR: + stats->other_sql_failures++; + break; default: /* internal error which should never occur */ pg_fatal("unexpected error status: %d", estatus); -- Thanks, Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/

Re: [Proposal] Add \dAt [AMPTRN [TBLPTRN]] to list tables by Table Access Method in psql

2025-04-15 Thread Srinath Reddy
est to interact with the table and structure their workloads to align with the TAM's intended access patterns. Thanks, Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/

[Proposal] Add \dAt [AMPTRN [TBLPTRN]] to list tables by Table Access Method in psql

2025-04-15 Thread Srinath Reddy
s starting with 'auto' Would love to hear if this sounds like a useful addition — if so, I’d be happy to work on a patch. Also, please let me know if something similar has been discussed before. Thanks, Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/

Re: New committer: Jacob Champion

2025-04-11 Thread Srinath Reddy
Congrats, Jacob. Thanks && Regards, Srinath Reddy Sadipiralla, EDB: https://www.enterprisedb.com <http://www.enterprisedb.com/>

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-03-29 Thread Srinath Reddy
t; wondering if it would be better to add these checks to the grammar instead > of trying to patch up all the various places they are used in the tree. > > hmm... need to think. May the force be with you, Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/ postgres=# COMMIT; postgres=# \q

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-03-29 Thread Srinath Reddy
for the same ,except this the patches LGTM. May the force be with you, Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/ postgres=# \q v05_002-Log-about-all-the-invalid-database-role-user-names-t.patch Description: Binary data

why in appendShellStringNoError() loop still continues even after it found CR or LF?

2025-03-29 Thread Srinath Reddy
execution,then the caller will decide what to do but every place this function is called they are just throwing the error. if theres no proper reason to loop and continue we can use strpbrk and return false when we found \n or \r. thoughts? May the force be with you, Srinath Reddy Sadipiralla EDB: https

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-03-27 Thread Srinath Reddy
are just throwing the error. if we could just break the loop right after we found \n or \r in appendShellStringNoError() we can also use strpbrk() here and during creation of new database as you suggested. thoughts? May the force be with you, Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/ postgres=#\q

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-03-26 Thread Srinath Reddy
HINT: newline or carriage return character is not allowed in database name Thanks and regards, Srinath Reddy Sadipiralla, EDB: https://www.enterprisedb.com postgres=#\q >

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-03-26 Thread Srinath Reddy
;)); + psql (18devel) Type "help" for help. postgres=# create database "test postgres"# lines"; ERROR: database name contains a newline or carriage return character HINT: newline or carriage return character is not allowed in database name Thanks and regards, Srinath Reddy Sadipiralla, EnterpriseDB: http://www.enterprisedb.com postgres=#\q

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-03-26 Thread Srinath Reddy
ng this. > > *Solution 3:* > While dumping the database, report FATAL if the database name has \n or \r > and add a hint message in FALAL (rename particular database to dump without > \n\r char). > sol3_v01* is doing the same. > > Please review attached patches and let me know feedback. > > Hi , I have reviewed all solutions but based on the commit message and comments, it is clear that the goal is to *entirely forbid database names containing carriage return (CR) or line feed (LF)* characters. *Solution 1 LGTM and aligns with this approach* by enforcing the restriction at the time of database creation, ensuring consistency throughout PostgreSQL. This approach eliminates ambiguity and guarantees that such database names *cannot be created or dumped with CR or LF.* To validate this behavior, I have also implemented a *TAP test* for Solution 1. Thanks and regards, Srinath Reddy Sadipiralla, EnterpriseDB: http://www.enterprisedb.com 0001-Add-TAP-test.patch Description: Binary data

Re: making EXPLAIN extensible

2025-03-02 Thread Srinath Reddy
Hi Robert, thanks for working on this and +1 for the idea. i have reviewed 1,2 patches using 3rd patch(pg_overexplain module) and they LGTM,will review more the 3rd patch. Regards, Srinath Reddy Sadipiralla EDB:http://www.enterprisedb.com

Re: bug: ALTER TABLE ADD VIRTUAL GENERATED COLUMN with table rewrite

2025-02-28 Thread Srinath Reddy
Hi, I have applied the patch and verified,and patch LGTM. Thanks and regards Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/

Re: Postmaster crashed during start

2025-02-25 Thread Srinath Reddy
On Wed, Feb 26, 2025 at 9:50 AM Srinath Reddy wrote: > > > On Wed, Feb 26, 2025 at 9:23 AM Tom Lane wrote: > >> Srinath Reddy writes: >> > when we kill postmaster using kill -9 and start immediately it crashes >> with >> >> FATAL: pre-existing sh

Postmaster crashed during start

2025-02-25 Thread Srinath Reddy
ernel is and it didn't got time to do the clean up of the dead postmaster process so didn't detached and decrement the shmem_nattach. thoughts? Thanks and Regards Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com <http://www.enterprisedb.com/>

Re: Non-text mode for pg_dumpall

2025-02-17 Thread Srinath Reddy
particular dump file. Thanks and Regards Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com <http://www.enterprisedb.com/> Srinath Reddy Sadipiralla,

Re: Non-text mode for pg_dumpall

2025-02-03 Thread Srinath Reddy
%s", outfile); + ofile = fopen(out_file_path, PG_BINARY_W); + } + if (ofile == NULL) { fclose(pfile); - pg_fatal("could not open file: \"%s\"", out_file_path); + pg_fatal("could not open file: \"%s\"", outfile); } /* Now append global.d

Re: Non-text mode for pg_dumpall

2025-02-03 Thread Srinath Reddy
up(fn), PG_BINARY_W); + } + else{ + snprintf(out_file_path, MAXPGPATH, "%s", outfile); + ofile = fopen(out_file_path, PG_BINARY_W); + } + if (ofile == NULL) { Regards, Srinath Reddy Sadipiralla, EDB: https://www.enterprisedb.com <http://www.enterprisedb.com/> >

Re: Non-text mode for pg_dumpall

2025-02-01 Thread Srinath Reddy
"[or]\n")); + printf(_("%s restores a PostgreSQL entire cluster from an archive created by pg_dumpall.\n\n"), progname); Regards, Srinath Reddy Sadipiralla, EDB: https://www.enterprisedb.com <http://www.enterprisedb.com/>

Re: hash_search_with_hash_value is high in "perf top" on a replica

2025-01-31 Thread Srinath Reddy
ough, but it looks pretty suspicious. > > Hi, i think high CPU usage make sense,as hash_search_with_hash_value is called every time when ever startup process in replica reads a wal and tries to redo it ,as it goes through readbuffer_common to check if the page which the wal effects and wants to redo is in buffer pool or not using BufferAlloc->BufTableLookup>hash_search_with_hash_value. Regards, Srinath Reddy Sadipiralla, EDB: https://www.enterprisedb.com <http://www.enterprisedb.com/>

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-01-30 Thread Srinath Reddy
d verified the same.The reason is in runPgDump during appendShellString for forming the pg_dump command , in appendShellStringNoError we are considering the string as invalid if it has '\n' and '\r'. > > I think, if we are allowing new lines in the db name, then we should dump > it. > Agreed. Regards, Srinath Reddy Sadipiralla, EDB: https://www.enterprisedb.com <http://www.enterprisedb.com/>

Fwd: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2025-01-28 Thread Srinath Reddy
On Sun, Jan 26, 2025 at 9:49 PM Tom Lane wrote: > Srinath Reddy writes: > > as suggested did the changes and attached the patch for the same. > > Uh ... what in the world is the point of changing > BufferIsExclusiveLocked's signature? > > as

Re: Non-text mode for pg_dumpall

2025-01-27 Thread Srinath Reddy
make check-world fails,i think we don't need $port and $filename instead we can use something like 'xxx'.so fixed it in the below patch. Regards, Srinath Reddy Sadipiralla, EDB: http://www.enterprisedb.com v1-fix-make-check-world.patch Description: Binary data

Re: Non-text mode for pg_dumpall

2025-01-27 Thread Srinath Reddy
m Regards, Srinath Reddy Sadipiralla, EDB: http://www.enterprisedb.com

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2025-01-27 Thread Srinath Reddy
On Sun, Jan 26, 2025 at 10:24 PM Srinath Reddy wrote: > > as there was repeated code between BufferIsExclusiveLocked and > BufferIsDirty to check if buffer is pinned and its locked exclusively,i > thought it would be nice to move that repeated code into > BufferIsExclusiveLocked

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2025-01-26 Thread Srinath Reddy
On Sun, Jan 26, 2025 at 9:49 PM Tom Lane wrote: > Srinath Reddy writes: > > as suggested did the changes and attached the patch for the same. > > Uh ... what in the world is the point of changing > BufferIsExclusiveLocked's signature? > >

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2025-01-26 Thread Srinath Reddy
as suggested did the changes and attached the patch for the same. Regards, Srinath Reddy Sadipiralla, EDB: http://www.enterprisedb.com On Sun, Jan 26, 2025 at 3:20 AM Tom Lane wrote: > Srinath Reddy Sadipiralla writes: > >> On Thu, 05 Dec 2024 21:11:42 +0530 Andres

Re: why -Fdance archive format option works with ./pg_restore but not with ./pg_dump?

2025-01-25 Thread Srinath Reddy
Thanks Tom and Andrew. Regards, Srinath Reddy Sadipiralla, EDB: http://www.enterprisedb.com On Sat, Jan 25, 2025 at 9:55 PM Tom Lane wrote: > Srinath Reddy writes: > > wouldn't it be nice if we get the error message as same as when we didn't > > gave format option

Re: why -Fdance archive format option works with ./pg_restore but not with ./pg_dump?

2025-01-25 Thread Srinath Reddy
Please use psql. wouldn't it be nice if we get the error message as same as when we didn't gave format option and pg_restore finds the format using _discoverArchiveFormat there it suggests to try psql ,instead of saying "p/plain text" format is a invalid format,as we a

Re: why -Fdance archive format option works with ./pg_restore but not with ./pg_dump?

2025-01-25 Thread Srinath Reddy
g_restore's parsing logic for this and replace it > in-place. To the extent that that's copying and pasting stuff, fine. > It's not like there's no other duplicativeness in their switch-parsing > logic. > > regards, tom lane > Agreed and m

Re: why -Fdance archive format option works with ./pg_restore but not with ./pg_dump?

2025-01-24 Thread Srinath Reddy
ree to submit a patch tightening the test. > Hi Andrew, thanks for the reply,here's the patch for the same. Regards, Srinath Reddy Sadipiralla EnterpriseDB: http://www.enterprisedb.com 0001-Compare-whole-string-value-using-pg_strcasecmp-pg_restore.patch Description: Binary data

why -Fdance archive format option works with ./pg_restore but not with ./pg_dump?

2025-01-23 Thread Srinath Reddy
Hi, in pg_restore archive format option is parsed using only the first character of the value but in pg_dump the archive format option's value is compared with whole string using pg_strcasecmp is there any specific reason? Regards, Srinath Reddy Sadipiralla EnterpriseDB:

Re: [PATCH] immediately kill psql process if server is not running.

2025-01-20 Thread Srinath Reddy
, +1,will look into it. Thanks. Srinath Reddy Sadipiralla,

Re: [PATCH] immediately kill psql process if server is not running.

2025-01-19 Thread Srinath Reddy
cleanup means you are talking about the one which happens at the end of main where PQfinish,fclose which has already been handled in this patch. But as you mentioned, history is not written to .psql_history in this patch ,we can save to psql_history by calling finishInput() ,for this I updated th

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2024-12-09 Thread Srinath Reddy Sadipiralla
Hi, added this bug to commitfest https://commitfest.postgresql.org/51/5428/  Regards, Srinath Reddy Sadipiralla Member of Technical Staff Zoho

Fwd: Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2024-12-09 Thread Srinath Reddy Sadipiralla
Forwarded message From: Srinath Reddy Sadipiralla To: "Nazir Bilal Yavuz", "pgsql-hackers", "Andres Freund" Date: Mon, 09 Dec 2024 10:14:06 +0530 Subject: Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferI

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2024-12-09 Thread Srinath Reddy Sadipiralla
On Sun, 08 Dec 2024 18:23:21 +0530 Nazir Bilal Yavuz wrote --- Hi Srinath, On Sat, 7 Dec 2024 at 11:17, Srinath Reddy Sadipiralla <mailto:srinath.re...@zohocorp.com> wrote: > > On Fri, 06 Dec 2024 16:40:51 +0530 Nazir Bilal Yavuz > > <mailto:byav

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2024-12-07 Thread Srinath Reddy Sadipiralla
s my patch to this looks good?🤔 Regards, Srinath Reddy Sadipiralla Member of Technical Staff Zoho

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2024-12-05 Thread Srinath Reddy Sadipiralla
> On Thu, 05 Dec 2024 21:11:42 +0530 Andres Freund > <mailto:and...@anarazel.de> wrote --- > Hi, > On 2024-12-05 18:38:16 +0530, Srinath Reddy Sadipiralla wrote: >> Why we need to check for local buffers in BufferIsExclusiveLocked and >> BufferIsDirty

Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2024-12-05 Thread Srinath Reddy Sadipiralla
Hi, Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?,these 2 functions are called only from XlogRegisterBuffer,AFAIK which will be called only for permanent relations.Please correct me if i am wrong. Regards, Srinath Reddy Sadipiralla Member of Technical

[PATCH] immediately kill psql process if server is not running.

2024-11-08 Thread Srinath Reddy Sadipiralla
using select() and recv()  functions .If either one of the value is returned we terminate the psql process. 2) Doing the same thing as above but in single process using readline callbacks(only supports --with-readline) Regards, Srinath Reddy Sadipiralla Member Technical Staff Zoho 0001

Re: Building Postgres 17.0 with meson

2024-11-05 Thread Srinath Reddy Sadipiralla
gresql.org/docs/current/install-meson.html#CONFIGURE-EXTRA-LIB-DIRS-MESON Regards, Srinath Reddy Sadipiralla Member Technical Staff ZOHO

Re: \watch 0 or \watch 0.00001 doesn't do what I want

2024-10-09 Thread Srinath Reddy Sadipiralla
s the query just once and then hangs forever, until I hit CTRL-C to cancel. hi heikki,but i am in pg 14.7 and the query is running perfectly without getting stuck. Regards, Srinath Reddy Sadipiralla Member Technical Staff ZOHO

Re: Question: Why Are File Descriptors Not Closed and Accounted for PostgreSQL Backends?

2024-05-24 Thread Srinath Reddy Sadipiralla
innakangas wrote --- On 24/05/2024 15:17, Srinath Reddy Sadipiralla wrote: > Hi PostgreSQL Community, > when a backend process starts, pq_init is called where it opens a FD during  > CreateWaitEventSet() > > > if (!AcquireExternalFD()) > { > /* treat this as though epoll

Question: Why Are File Descriptors Not Closed and Accounted for PostgreSQL Backends?

2024-05-24 Thread Srinath Reddy Sadipiralla
epoll_create1(EPOLL_CLOEXEC); but we didn't closed or called ReleaseExternalFD() for accounting,lets say if we have multiple clients connected and are actively running queries, won't the max number of open FDs (ulimit -n) limit of the system gets reached and cause "Too many open files issue"? Regards Srinath Reddy