[Patch] change the return value of PQsendFlushRequest

2021-07-05 Thread zhangj...@fujitsu.com
Hi all

The return value of function PQsendFlushRequest is 1 or 0.
---

Sends a request for the server to flush its output buffer.

int PQsendFlushRequest(PGconn *conn);




Returns 1 for success.  Returns 0 on any failure.

-
But in the following code, false is returned.
I think it would be better to change to 0.

int PQsendFlushRequest(PGconn *conn)
{
..
if (conn->asyncStatus != PGASYNC_IDLE &&
conn->pipelineStatus == PQ_PIPELINE_OFF)
{
appendPQExpBufferStr(>errorMessage,
 libpq_gettext("another 
command is already in progress\n"));
return false;  ※
}
..
}

Best Regards!
Zhangjie



PQsendFlushRequest.patch
Description: PQsendFlushRequest.patch


RE: [Patch] change the default value of shared_buffers in postgresql.conf.sample

2021-06-27 Thread zhangj...@fujitsu.com
> On the whole this seems pretty cosmetic so I'm inclined to leave it alone.  
> But if we were going to do anything I think that adjusting both initdb.c and 
> guc.c to use 128MB might be the most appropriate thing.

Thank you for your suggestions. initdb.c and guc.c have been modified together.

Best Regards!
Zhangjie

-Original Message-
From: Tom Lane  
Sent: Thursday, June 24, 2021 11:50 PM
To: Zhang, Jie/张 杰 
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: [Patch] change the default value of shared_buffers in 
postgresql.conf.sample

"zhangj...@fujitsu.com"  writes:
> In PostgreSQL 14, The default value of shared_buffers is 128MB, but in 
> postgresql.conf.sample, the default value of shared_buffers is 32MB.
> I think the following changes should be made.

> File: postgresql\src\backend\utils\misc\ postgresql.conf.sample 
> #shared_buffers = 32MB  =>  #shared_buffers = 128MB

As submitted, this patch breaks initdb, which is looking for the exact string 
"#shared_buffers = 32MB".

We could adjust that too of course, but I'm dubious first that any change is 
needed, and second that this is the right one:

1. Since initdb will replace that string, users will never see this entry as-is 
in live databases.  So is it worth doing anything?

2. The *actual*, hard-wired, default in guc.c is 1024 (8MB), not either of 
these numbers.  So maybe the sample file ought to use that instead.  Or maybe 
we should change that value too ... it's surely as obsolete as can be.

On the whole this seems pretty cosmetic so I'm inclined to leave it alone.  But 
if we were going to do anything I think that adjusting both initdb.c and guc.c 
to use 128MB might be the most appropriate thing.

regards, tom lane


postgresql.conf.sample_0625.patch
Description: postgresql.conf.sample_0625.patch


[Patch] change the default value of shared_buffers in postgresql.conf.sample

2021-06-24 Thread zhangj...@fujitsu.com
Hi all

In PostgreSQL 14, The default value of shared_buffers is 128MB, but in 
postgresql.conf.sample, the default value of shared_buffers is 32MB.

I think the following changes should be made.

File: postgresql\src\backend\utils\misc\ postgresql.conf.sample
#shared_buffers = 32MB  =>  #shared_buffers = 128MB

[PostgreSQL 14]
shared_buffers (integer)
Sets the amount of memory the database server uses for shared memory buffers. 
The default is typically 128 megabytes (128MB)
https://www.postgresql.org/docs/14/runtime-config-resource.html


In PostgreSQL 9.2, The default value of shared_buffers is 32MB.

[PostgreSQL 9.2]
shared_buffers (integer)
Sets the amount of memory the database server uses for shared memory buffers. 
The default is typically 32 megabytes (32MB)
https://www.postgresql.org/docs/9.2/runtime-config-resource.html

Here is a patch.

Best Regards!




postgresql.conf.sample.patch
Description: postgresql.conf.sample.patch


[Patch] Rename PQtraceSetFlags to PQsetTraceFlags for bookindex.html

2021-06-21 Thread zhangj...@fujitsu.com
Hi all

PQtraceSetFlags has been renamed PQsetTraceFlags, but the  has not 
been modified,
so PQtraceSetFlags is still displayed in bookindex.html.

   -
   - 
PQtraceSetFlagsPQtraceSetFlags
   +
   + 
PQsetTraceFlagsPQtraceSetFlags

https://github.com/postgres/postgres/commit/d0e750c0acaf31f60667b1635311bcef5ab38bbe

Here is a patch.

Best Regards!



PQsetTraceFlags.patch
Description: PQsetTraceFlags.patch