Re: 48.1. Logical Decoding Examples

2023-10-24 Thread Kevin Wang
In my testing environment, I did not specify "shared_preload_libraries" and
I cannot create the logical replication slot with the "test_decoding" type.
test_decoding is in contrib folder and is not build-in, so if you do not
specify it, you cannot create the replication slot.

On Mon, Oct 23, 2023 at 2:25 PM Euler Taveira  wrote:

> On Sun, Oct 22, 2023, at 7:41 PM, PG Doc comments form wrote:
>
> At the beginning of this section, please change this statement:
>
> Before you can use logical decoding, you must set wal_level to logical and
> max_replication_slots to at least 1, and shared_preload_libraries to
> 'test_decoding'.
>
>
> There is no need to preload the output plugin. logical decoding will do
> it. The
> documentation is correct (see LoadOputputPlugin() function).
>
>
> --
> Euler Taveira
> EDB   https://www.enterprisedb.com/
>
>


Wrong link in the documentation for versions 11, 12

2023-10-24 Thread Maxim Yablokov

Hello!

Our team have noticed that the link in the field "References" for 
data_type on the following pages 
(https://www.postgresql.org/docs/12/view-pg-sequences.html, 
https://www.postgresql.org/docs/11/view-pg-sequences.html) is incorrect, 
so I've fixed it. Patches are attached, please have a look.


--
Best regards,
Maxim Yablokov
Technical writer-translator
Postgres Professional diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index bd622680d23..13fb04ea616 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -10248,7 +10248,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
  
   data_type
   regtype
-  pg_type.oid
+  pg_type.oid
   Data type of the sequence
  
  
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 2322076f5af..494473c177e 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -10333,7 +10333,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
  
   data_type
   regtype
-  pg_type.oid
+  pg_type.oid
   Data type of the sequence
  
  


Re: 'value' has special behaviour in alter system

2023-10-24 Thread Bruce Momjian
On Thu, Dec 15, 2022 at 12:10:27PM -0500, Tom Lane wrote:
> "Jonathan S. Katz"  writes:
> > On 12/15/22 10:50 AM, David G. Johnston wrote:
> >> I suggest changing it to:
> >> SET configuration_parameter { TO | = } { value [, ...] | DEFAULT }
> 
> > +1 in general. I would also suggest we add an example in the Examples 
> > section to show what the output is when you add single-quotes.
> 
> I think the core problem here is that the syntax diagram and discussion
> don't clearly discuss the behavior for list values.  David's version of
> the syntax diagram looks fine, but not sure about the text.  There likely
> needs to be some explicit acknowledgement of the fact that some GUCs
> act differently than others (cf GUC_LIST_INPUT and GUC_LIST_QUOTE flags).
> 
> +1 for examples, for sure.

Finally getting back to this, there is a lot going on and Tom is right
that the inconsistent use of GUC_LIST_QUOTE adds a lot of confusion. 
Here are the list settings, and which ones add double-quotes to
non-alphanumeric quoted values:

GUC_LIST_QUOTE (adds quotes)
temp_tablespaces
session_preload_libraries
shared_preload_libraries
local_preload_libraries
search_path
unix_socket_directories

NO GUC_LIST_QUOTE (does not add quotes)
DateStyle
createrole_self_grant
log_destination
listen_addresses
synchronous_standby_names
wal_consistency_checking
debug_io_direct

and this leads to different quoting behaviors depending on which
category of list you are using.  First, let's look at alphanumeric
values, which are treated the same by list types with different
GUC_LIST_QUOTE statuses:

ALTER SYSTEM SET shared_preload_libraries TO a, b, c;
.conf   shared_preload_libraries = 'a, b, c'

ALTER SYSTEM SET listen_addresses TO a, b, c;
.conf   listen_addresses = 'a, b, c'

Even with quotes, the output is the same:

ALTER SYSTEM SET shared_preload_libraries TO a, 'b', c;
.conf   shared_preload_libraries = 'a, b, c'

ALTER SYSTEM SET shared_preload_libraries TO a, "b", c;
.conf   shared_preload_libraries = 'a, b, c'

ALTER SYSTEM SET listen_addresses TO a, 'b', c;
.conf   listen_addresses = 'a, b, c'

ALTER SYSTEM SET listen_addresses TO a, "b", c;
.conf   listen_addresses = 'a, b, c'

With non-alphanumeric (spaces), there is a difference:

ALTER SYSTEM SET shared_preload_libraries TO a, 'b x', c;
.conf   shared_preload_libraries = 'a, "b x", c'

ALTER SYSTEM SET listen_addresses TO a, 'b x', c;
.conf   listen_addresses = 'a, b x, c'

For listen_addresses to get the quoting behavior of
shared_preload_libraries, I have to use double-quotes inside single
quotes:

ALTER SYSTEM SET listen_addresses TO 'a, "b x", c';
.conf   listen_addresses = 'a, "b x", c'

Do we want to retain this difference in list processing?

I have developed the attached patch to document this.

-- 
  Bruce Momjian  https://momjian.us
  EDB  https://enterprisedb.com

  Only you can decide what is important to you.
diff --git a/doc/src/sgml/ref/alter_system.sgml b/doc/src/sgml/ref/alter_system.sgml
index 6f8bd39eaf..14def69419 100644
--- a/doc/src/sgml/ref/alter_system.sgml
+++ b/doc/src/sgml/ref/alter_system.sgml
@@ -21,7 +21,7 @@ PostgreSQL documentation
 
  
 
-ALTER SYSTEM SET configuration_parameter { TO | = } { value | 'value' | DEFAULT }
+ALTER SYSTEM SET configuration_parameter { TO | = } { value [, ...] | DEFAULT }
 
 ALTER SYSTEM RESET configuration_parameter
 ALTER SYSTEM RESET ALL
@@ -83,9 +83,18 @@ ALTER SYSTEM RESET ALL
   New value of the parameter.  Values can be specified as string
   constants, identifiers, numbers, or comma-separated lists of
   these, as appropriate for the particular parameter.
+  Values with non-alphanumeric characters must be quoted.
   DEFAULT can be written to specify removing the
   parameter and its value from postgresql.auto.conf.
  
+
+ 
+  Parameters that accept lists of strings can specify multiple values
+  separated by commas.  For some list-accepting parameters, quoted
+  values will produce double-quoted output to preserve whitespace and
+  commas; for others, double-quotes must be used inside single-quoted
+  strings to get this effect.
+ 
 

   


Re: 'value' has special behaviour in alter system

2023-10-24 Thread Tom Lane
Bruce Momjian  writes:
> I have developed the attached patch to document this.

This seems a little imprecise:

+  Values with non-alphanumeric characters must be quoted.

I think accurate is more like "Values that are neither a number
nor a valid identifier must be quoted."

Also, that para already mentions that the input can be a
comma-separated list when appropriate, so your add-on para seems
partially repetitive.  I think you could just drop the first
sentence of it.

regards, tom lane




Re: 'value' has special behaviour in alter system

2023-10-24 Thread Bruce Momjian
On Tue, Oct 24, 2023 at 02:05:53PM -0400, Tom Lane wrote:
> Bruce Momjian  writes:
> > I have developed the attached patch to document this.
> 
> This seems a little imprecise:
> 
> +  Values with non-alphanumeric characters must be quoted.
> 
> I think accurate is more like "Values that are neither a number
> nor a valid identifier must be quoted."
> 
> Also, that para already mentions that the input can be a
> comma-separated list when appropriate, so your add-on para seems
> partially repetitive.  I think you could just drop the first
> sentence of it.

Agreed, updated patch attached.

-- 
  Bruce Momjian  https://momjian.us
  EDB  https://enterprisedb.com

  Only you can decide what is important to you.
diff --git a/doc/src/sgml/ref/alter_system.sgml b/doc/src/sgml/ref/alter_system.sgml
index 6f8bd39eaf..bea5714ba1 100644
--- a/doc/src/sgml/ref/alter_system.sgml
+++ b/doc/src/sgml/ref/alter_system.sgml
@@ -21,7 +21,7 @@ PostgreSQL documentation
 
  
 
-ALTER SYSTEM SET configuration_parameter { TO | = } { value | 'value' | DEFAULT }
+ALTER SYSTEM SET configuration_parameter { TO | = } { value [, ...] | DEFAULT }
 
 ALTER SYSTEM RESET configuration_parameter
 ALTER SYSTEM RESET ALL
@@ -83,9 +83,17 @@ ALTER SYSTEM RESET ALL
   New value of the parameter.  Values can be specified as string
   constants, identifiers, numbers, or comma-separated lists of
   these, as appropriate for the particular parameter.
+  Values that are neither numbers nor valid identifiers must be quoted.
   DEFAULT can be written to specify removing the
   parameter and its value from postgresql.auto.conf.
  
+
+ 
+  For some list-accepting parameters, quoted values will produce
+  double-quoted output to preserve whitespace and commas; for others,
+  double-quotes must be used inside single-quoted strings to get
+  this effect.
+ 
 

   


Re: Getting started

2023-10-24 Thread Bruce Momjian
xOn Mon, Dec 12, 2022 at 08:20:03AM +0100, Laurenz Albe wrote:
> On Sat, 2022-12-10 at 18:46 +, PG Doc comments form wrote:
> > The following documentation comment has been logged on the website:
> > 
> > Page: https://www.postgresql.org/docs/15/user-manag.html
> > Description:
> > 
> > https://www.postgresql.org/docs/current/tutorial-createdb.html
> > 
> > The "getting started" page skips right from the installing to already having
> > started the program, but on linux machines, you cannot start psql without
> > inputting a special command, "sudo -u postgres psql".  Typing psql will make
> > the program tell you that your username doesn't exist, and you can't create
> > a username for psql without starting psql first.  I had to search somewhere
> > else to learn that I had to start psql with that special command.  
> 
> Yes, the "initdb" step is missing.
> 
> If we had that, it would be clear that the rest of the chapter assumes that
> you are running shell commands with an operating system user whose name
> is identical to the bootstrap superuser.

I looked at this and initdb is mentioned in the installation section,
and an incorrect user name is mentions as part of craetedb failure.  I
don't see what we can add to improve things here.

-- 
  Bruce Momjian  https://momjian.us
  EDB  https://enterprisedb.com

  Only you can decide what is important to you.




Re: Minipatch concerning tags + new spelling/punctuation patch

2023-10-24 Thread Michael Paquier
On Mon, Oct 23, 2023 at 12:33:03PM +0300, Maxim Yablokov wrote:
> We have also prepared a small patch concerning spelling, punctuation, etc.
> We've decided to send it separately, so it'll be easier to review. Please
> have a look.

Yep, these are improvements.  So applied and backpatched (all these
applied down to 16, except for one down to 11).

> (just in case: e.kiryan...@postgrespro.ru, e.indrupsk...@postgrespro.ru,
> o.sibirya...@postgrespro.ru, m.yablo...@postgrespro.ru)

Thanks for the list.  I've used that in the commit message.
--
Michael


signature.asc
Description: PGP signature