DOCS: What SGML markup to use for user objects like tables, columns, etc?

Поиск
Список
Период
Сортировка
Искать

DOCS: What SGML markup to use for user objects like tables, columns, etc?

От:
Peter Smith <smithpb2250@gmail.com>
Дата:
Hi,

I am looking for some guidelines/recommended SGML tags to use when
referring in the PG documentation to any user-defined
schema/table/column names.

This is most commonly seen near a  SQL example.

Currently, it seems a bit inconsistent. The rendering also looks quite
different for these different markups.


EXAMPLES OF DIFFERENT USAGE
===========================

1.  as seen in create_publication.sgml,
alter_publication.sgml, ddl.sgml, etc.

e.g.
  
   Add tables users,
   departments and schema
   production to the publication
   production_publication:

ALTER PUBLICATION production_publication ADD TABLE users, departments,
TABLES IN SCHEMA production;

 

===

2. , as seen in logical-replication.sgml

e.g.

CREATE SUBSCRIPTION mysub CONNECTION 'dbname=foo host=bar
user=repuser' PUBLICATION mypub;

  

  
   The above will start the replication process, which synchronizes the
   initial table contents of the tables users and
   departments and then starts replicating
   incremental changes to those tables.
  

===

3. , as seen in advanced.sgml

e.g.
   
    Let's create two tables:  A table cities
    and a table capitals.  Naturally, capitals
    are also cities, so you want some way to show the capitals
    implicitly when you list all cities.  If you're really clever you
    might invent some scheme like this:


CREATE TABLE capitals (
  name       text,
  population real,
  elevation  int,    -- (in ft)
  state      char(2)
);

======

My AI tool says the following.

----
PostgreSQL documentation typically uses:
 for specific, concrete names
 for generic placeholders
 for system objects and data types
----

TBH, this seemed like good advice to me... however there are quite a
few examples not following that.

Thoughts?

======
Kind Regards,
Peter Smith.
Fujitsu Australia


Re: DOCS: What SGML markup to use for user objects like tables, columns, etc?

От:
Bruce Momjian <bruce@momjian.us>
Дата:
On Mon, Jun 23, 2025 at 10:29:50AM +1000, Peter Smith wrote:
> Hi,
> 
> I am looking for some guidelines/recommended SGML tags to use when
> referring in the PG documentation to any user-defined
> schema/table/column names.
> 
> This is most commonly seen near a  SQL example.
> 
> Currently, it seems a bit inconsistent. The rendering also looks quite
> different for these different markups.
> 
> 
> EXAMPLES OF DIFFERENT USAGE
> ===========================
> 
> 1.  as seen in create_publication.sgml,
> alter_publication.sgml, ddl.sgml, etc.
> 
> e.g.
>   
>    Add tables users,
>    departments and schema
>    production to the publication
>    production_publication:
> 
> ALTER PUBLICATION production_publication ADD TABLE users, departments,
> TABLES IN SCHEMA production;
> 
>  
> 
> ===
> 
> 2. , as seen in logical-replication.sgml
> 
> e.g.
> 
> CREATE SUBSCRIPTION mysub CONNECTION 'dbname=foo host=bar
> user=repuser' PUBLICATION mypub;
> 
>   
> 
>   
>    The above will start the replication process, which synchronizes the
>    initial table contents of the tables users and
>    departments and then starts replicating
>    incremental changes to those tables.
>   
> 
> ===
> 
> 3. , as seen in advanced.sgml
> 
> e.g.
>    
>     Let's create two tables:  A table cities
>     and a table capitals.  Naturally, capitals
>     are also cities, so you want some way to show the capitals
>     implicitly when you list all cities.  If you're really clever you
>     might invent some scheme like this:
> 
> 
> CREATE TABLE capitals (
>   name       text,
>   population real,
>   elevation  int,    -- (in ft)
>   state      char(2)
> );
> 
> ======
> 
> My AI tool says the following.
> 
> ----
> PostgreSQL documentation typically uses:
>  for specific, concrete names
>  for generic placeholders
>  for system objects and data types
> ----
> 
> TBH, this seemed like good advice to me... however there are quite a
> few examples not following that.
> 
> Thoughts?

You are right that we are inconsistent.  I think  is the
accepted way to reference table names, and  for column
names.  If you can create a patch to make them consistent, I can apply
it.

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

  Do not let urgent matters crowd out time for investment in the future.


Re: DOCS: What SGML markup to use for user objects like tables, columns, etc?

От:
Peter Smith <smithpb2250@gmail.com>
Дата:
Вложения:
On Thu, Jul 24, 2025 at 2:18 AM Bruce Momjian  wrote:
>
> On Mon, Jun 23, 2025 at 10:29:50AM +1000, Peter Smith wrote:
> > Hi,
> >
> > I am looking for some guidelines/recommended SGML tags to use when
> > referring in the PG documentation to any user-defined
> > schema/table/column names.
> >
> > This is most commonly seen near a  SQL example.
> >
> > Currently, it seems a bit inconsistent. The rendering also looks quite
> > different for these different markups.
> >
> >
> > EXAMPLES OF DIFFERENT USAGE
> > ===========================
> >
> > 1.  as seen in create_publication.sgml,
> > alter_publication.sgml, ddl.sgml, etc.
> >
> > e.g.
> >   
> >    Add tables users,
> >    departments and schema
> >    production to the publication
> >    production_publication:
> > 
> > ALTER PUBLICATION production_publication ADD TABLE users, departments,
> > TABLES IN SCHEMA production;
> > 
> >  
> >
> > ===
> >
> > 2. , as seen in logical-replication.sgml
> >
> > e.g.
> > 
> > CREATE SUBSCRIPTION mysub CONNECTION 'dbname=foo host=bar
> > user=repuser' PUBLICATION mypub;
> > 
> >   
> >
> >   
> >    The above will start the replication process, which synchronizes the
> >    initial table contents of the tables users and
> >    departments and then starts replicating
> >    incremental changes to those tables.
> >   
> >
> > ===
> >
> > 3. , as seen in advanced.sgml
> >
> > e.g.
> >    
> >     Let's create two tables:  A table cities
> >     and a table capitals.  Naturally, capitals
> >     are also cities, so you want some way to show the capitals
> >     implicitly when you list all cities.  If you're really clever you
> >     might invent some scheme like this:
> >
> > 
> > CREATE TABLE capitals (
> >   name       text,
> >   population real,
> >   elevation  int,    -- (in ft)
> >   state      char(2)
> > );
> >
> > ======
> >
> > My AI tool says the following.
> >
> > ----
> > PostgreSQL documentation typically uses:
> >  for specific, concrete names
> >  for generic placeholders
> >  for system objects and data types
> > ----
> >
> > TBH, this seemed like good advice to me... however there are quite a
> > few examples not following that.
> >
> > Thoughts?
>
> You are right that we are inconsistent.  I think  is the
> accepted way to reference table names, and  for column
> names.  If you can create a patch to make them consistent, I can apply
> it.
>

Thanks! Here is a v1 patch.

Replacements were identified by regex. Hopefully, I found most of them...

The patch replaces SGML tags as suggested:
- use  for table names
- use  for column names

======
Kind Regards,
Peter Smith.
Fujitsu Australia

Re: DOCS: What SGML markup to use for user objects like tables, columns, etc?

От:
Peter Smith <smithpb2250@gmail.com>
Дата:
Вложения:
Added a CF entry [1] for this.

A rebase was needed. PSA patch v2.

======
[1] https://commitfest.postgresql.org/patch/6063/

Kind Regards,
Peter Smith.
Fujitsu Australia.

Re: DOCS: What SGML markup to use for user objects like tables, columns, etc?

От:
Peter Smith <smithpb2250@gmail.com>
Дата:
On Thu, Jul 24, 2025 at 2:18 AM Bruce Momjian  wrote:
...
> You are right that we are inconsistent.  I think  is the
> accepted way to reference table names, and  for column
> names.  If you can create a patch to make them consistent, I can apply
> it.

Thanks for offering to apply the patch. It has been available for a
few months now.

======
Kind Regards,
Peter Smith.
Fujitsu Australia


Re: DOCS: What SGML markup to use for user objects like tables, columns, etc?

От:
Bruce Momjian <bruce@momjian.us>
Дата:
On Tue, Nov  4, 2025 at 02:35:29PM +1100, Peter Smith wrote:
> On Thu, Jul 24, 2025 at 2:18 AM Bruce Momjian  wrote:
> ...
> > You are right that we are inconsistent.  I think  is the
> > accepted way to reference table names, and  for column
> > names.  If you can create a patch to make them consistent, I can apply
> > it.
> 
> Thanks for offering to apply the patch. It has been available for a
> few months now.

My apologies for not getting to this sooner.  (Seems I need to review
all my saved emails for these type of items.)  Patch applied to master.
Nice improvement.

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

  Do not let urgent matters crowd out time for investment in the future.


Re: DOCS: What SGML markup to use for user objects like tables, columns, etc?

От:
Peter Smith <smithpb2250@gmail.com>
Дата:
On Sun, Nov 9, 2025 at 1:50 AM Bruce Momjian  wrote:
>
> On Tue, Nov  4, 2025 at 02:35:29PM +1100, Peter Smith wrote:
> > On Thu, Jul 24, 2025 at 2:18 AM Bruce Momjian  wrote:
> > ...
> > > You are right that we are inconsistent.  I think  is the
> > > accepted way to reference table names, and  for column
> > > names.  If you can create a patch to make them consistent, I can apply
> > > it.
> >
> > Thanks for offering to apply the patch. It has been available for a
> > few months now.
>
> My apologies for not getting to this sooner.  (Seems I need to review
> all my saved emails for these type of items.)  Patch applied to master.
> Nice improvement.
>

Thanks for pushing!

I updated the CF entry -- https://commitfest.postgresql.org/patch/6063/#

======
Kind Regards,
Peter Smith.
Fujitsu Australia


Re: DOCS: What SGML markup to use for user objects like tables, columns, etc?

От:
Bruce Momjian <bruce@momjian.us>
Дата:
On Mon, Nov 10, 2025 at 08:30:47AM +1100, Peter Smith wrote:
> On Sun, Nov 9, 2025 at 1:50 AM Bruce Momjian  wrote:
> >
> > On Tue, Nov  4, 2025 at 02:35:29PM +1100, Peter Smith wrote:
> > > On Thu, Jul 24, 2025 at 2:18 AM Bruce Momjian  wrote:
> > > ...
> > > > You are right that we are inconsistent.  I think  is the
> > > > accepted way to reference table names, and  for column
> > > > names.  If you can create a patch to make them consistent, I can apply
> > > > it.
> > >
> > > Thanks for offering to apply the patch. It has been available for a
> > > few months now.
> >
> > My apologies for not getting to this sooner.  (Seems I need to review
> > all my saved emails for these type of items.)  Patch applied to master.
> > Nice improvement.
> >
> 
> Thanks for pushing!
> 
> I updated the CF entry -- https://commitfest.postgresql.org/patch/6063/#

Thanks!

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

  Do not let urgent matters crowd out time for investment in the future.


FAQ