Re: Document NULL

2025-03-12 Thread Álvaro Herrera
On 2025-Mar-12, David G. Johnston wrote: > I’m not accepting this line of work as part of this patch. Please limit > this to the merits of choosing \N as the particular value for \pset null on > this page. You can start a new thread regarding a policy change for > marking up null values in the w

Re: Document NULL

2025-03-12 Thread David G. Johnston
On Wednesday, March 12, 2025, Marcos Pegoraro wrote: > Em ter., 11 de mar. de 2025 às 17:43, Tom Lane > escreveu: > >> I think that idea (changing all the docs) is a complete nonstarter >> because people would not understand why the results they get don't >> look like what it says in the docs.

Re: Document NULL

2025-03-12 Thread Marcos Pegoraro
Em ter., 11 de mar. de 2025 às 17:43, Tom Lane escreveu: > I think that idea (changing all the docs) is a complete nonstarter > because people would not understand why the results they get don't > look like what it says in the docs. Of course, we could fix that > by changing the factory default

Re: Document NULL

2025-03-11 Thread Tom Lane
"David G. Johnston" writes: > On Tue, Mar 11, 2025 at 1:19 PM Marcos Pegoraro wrote: >> I understand that this page we have more NULL values than everywhere else >> combined, but it's a good opportunity to set a standard for all >> documentation > If someone writes a patch to make everywhere an

Re: Document NULL

2025-03-11 Thread David G. Johnston
On Tue, Mar 11, 2025 at 1:19 PM Marcos Pegoraro wrote: > Em ter., 11 de mar. de 2025 às 16:47, David G. Johnston < > david.g.johns...@gmail.com> escreveu: > >> Since COPY uses \N I figured it was a decent choice. or >>> came to mind too, but there were long compared to 1, 2, and 4 that appear >

Re: Document NULL

2025-03-11 Thread Marcos Pegoraro
Em ter., 11 de mar. de 2025 às 16:47, David G. Johnston < david.g.johns...@gmail.com> escreveu: > Since COPY uses \N I figured it was a decent choice. or came >> to mind too, but there were long compared to 1, 2, and 4 that appear along >> side it. >> > Well, I would use , it doesn't need any ex

Re: Document NULL

2025-03-11 Thread David G. Johnston
On Tue, Mar 11, 2025 at 12:44 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tue, Mar 11, 2025 at 12:39 PM Marcos Pegoraro > wrote: > >> Em ter., 11 de mar. de 2025 às 12:52, David G. Johnston < >> david.g.johns...@gmail.com> escreveu: >> >>> The markup surrounding the examples is

Re: Document NULL

2025-03-11 Thread David G. Johnston
On Tue, Mar 11, 2025 at 12:39 PM Marcos Pegoraro wrote: > Em ter., 11 de mar. de 2025 às 12:52, David G. Johnston < > david.g.johns...@gmail.com> escreveu: > >> The markup surrounding the examples is correct now and I decided \N was >> the most useful representation of NULL given that the query d

Re: Document NULL

2025-03-11 Thread Marcos Pegoraro
Em ter., 11 de mar. de 2025 às 12:52, David G. Johnston < david.g.johns...@gmail.com> escreveu: > The markup surrounding the examples is correct now and I decided \N was > the most useful representation of NULL given that the query data is single > digit numbers. I really hate the non-readability

Re: Document NULL

2025-02-06 Thread David G. Johnston
On Thursday, February 6, 2025, jian he wrote: > On Fri, Jan 17, 2025 at 6:41 AM David G. Johnston > wrote: > > > > Yeah, I did spell check but not a grammar check. These weren't spelling > errors though. Anyway, good point running the resultant web page through > chatgpt or grammar-aware progr

Re: Document NULL

2025-02-06 Thread jian he
On Fri, Jan 17, 2025 at 6:41 AM David G. Johnston wrote: > > Yeah, I did spell check but not a grammar check. These weren't spelling > errors though. Anyway, good point running the resultant web page through > chatgpt or grammar-aware program. > > I still need to put together the example chang

Re: Document NULL

2025-01-16 Thread David G. Johnston
81410b39c7ca3e0b641006cd4b3946a Mon Sep 17 00:00:00 2001 From: "David G. Johnston" Date: Mon, 9 Dec 2024 09:41:07 -0700 Subject: [PATCH] v6 Document NULL --- doc/src/sgml/datatype.sgml |2 +- doc/src/sgml/ddl.sgml |2 + doc/src/sgml/filelist.sgml |

Re: Document NULL

2024-12-28 Thread jian he
hi. "SQL specification" should be "SQL standard"? + another null vale and unequal to all other values. typo. should be "another null value" other places using subsection, many places in doc/src/sgml/nullvalues.sgml using "sub-section". + Notice two important behaviors: first, even though we

Re: Document NULL

2024-12-28 Thread Marcos Pegoraro
The word below is commonly used on DOCs, but I didn't find it as a link. Wouldn't it be better to write what you are linking to, instead of the word below ? (See Null-Valued Operands for more explanation.) instead of (See below for more explanation.) Multi-Element Comparisons. instead of noted be

Re: Document NULL

2024-12-23 Thread David G. Johnston
On Mon, Dec 23, 2024 at 11:39 AM Marcos Pegoraro wrote: > Em dom., 22 de dez. de 2024 às 15:07, David G. Johnston < > david.g.johns...@gmail.com> escreveu: > > On section Null-Valued Settings is not easy to understand that "show > example.string" will result in an "ERROR: unrecognized...", that B

Re: Document NULL

2024-12-23 Thread Marcos Pegoraro
Em dom., 22 de dez. de 2024 às 15:07, David G. Johnston < david.g.johns...@gmail.com> escreveu: On section Null-Valued Settings is not easy to understand that "show example.string" will result in an "ERROR: unrecognized...", that BEGIN or ROLLBACK does not return anything. So, what do you think ab

Re: Document NULL

2024-12-22 Thread David G. Johnston
On Sun, Dec 22, 2024 at 9:45 AM Marcos Pegoraro wrote: > Em dom., 22 de dez. de 2024 às 12:02, David G. Johnston < > david.g.johns...@gmail.com> escreveu: > > You have detailed IS NULL and IS NOT NULL predicates but not mention their > counterparts ISNULL and NOTNULL, wouldn't it be good to expla

Re: Document NULL

2024-12-22 Thread Marcos Pegoraro
Em dom., 22 de dez. de 2024 às 12:02, David G. Johnston < david.g.johns...@gmail.com> escreveu: You have detailed IS NULL and IS NOT NULL predicates but not mention their counterparts ISNULL and NOTNULL, wouldn't it be good to explain that too ? Maybe pointing to its page "functions-comparison" r

Re: Document NULL

2024-12-22 Thread David G. Johnston
On Sun, Dec 22, 2024 at 7:27 AM jian he wrote: > On Wed, Dec 11, 2024 at 7:00 AM David G. Johnston > wrote: > > > > v5 Attached, v5-0001 is just v4-0001 rebased; v5-0002 is the rework over > v4-0001. There is no formatting-only patch this round. > > > > Wiki tracker: > https://wiki.postgresql.o

Re: Document NULL

2024-12-12 Thread David G. Johnston
On Wed, Dec 11, 2024 at 8:09 AM Marcos Pegoraro wrote: > Em ter., 10 de dez. de 2024 às 20:00, David G. Johnston < > david.g.johns...@gmail.com> escreveu: > > >> When I finalize the examples I'm probably going to \pset null . >> > Yes, much better than an empty space in the examples, but you need

Re: Document NULL

2024-12-12 Thread David G. Johnston
On Wed, Dec 11, 2024 at 11:46 AM Marcos Pegoraro wrote: > Em ter., 10 de dez. de 2024 às 20:00, David G. Johnston < >> david.g.johns...@gmail.com> escreveu: >> > > Section nullvalues-filtering you are showing filtering with equal and not > equal. Wouldn't it be better if you show just one of them

Re: Document NULL

2024-12-11 Thread Marcos Pegoraro
> > Em ter., 10 de dez. de 2024 às 20:00, David G. Johnston < > david.g.johns...@gmail.com> escreveu: > Section nullvalues-filtering you are showing filtering with equal and not equal. Wouldn't it be better if you show just one of them and the other using DISTINCT FROM, which would get different r

Re: Document NULL

2024-12-11 Thread Marcos Pegoraro
Em ter., 10 de dez. de 2024 às 20:00, David G. Johnston < david.g.johns...@gmail.com> escreveu: > I got rid of the row counts on the examples. > Cool, I would love to get rid all of them, like I proposed on [1]. > When I finalize the examples I'm probably going to \pset null . > Yes, much better

Re: Document NULL

2024-12-10 Thread David G. Johnston
v5 Attached, v5-0001 is just v4-0001 rebased; v5-0002 is the rework over v4-0001. There is no formatting-only patch this round. Wiki tracker: https://wiki.postgresql.org/wiki/Documenting_NULL#ToDo_Note On Tue, Dec 10, 2024 at 11:52 AM Jeff Davis wrote: > On Mon, 2024-12-09 at 15:27 -0700, Davi

Re: Document NULL

2024-12-10 Thread Jeff Davis
On Mon, 2024-12-09 at 15:27 -0700, David G. Johnston wrote: > I have not done this.  This is already a large patch and this kind of > example doesn't seem like our norm.  I'm not opposed to more content > like this but for now would leave considering it as something an > interested party can propos

Re: Document NULL

2024-12-09 Thread David G. Johnston
Thank you for the review. Changes noted below will be part of v5. On Fri, Nov 22, 2024 at 12:00 PM Jeff Davis wrote: > > One idea is to have a brief guidance section to help users know how to > use nulls in their data model effectively. For instance, if you allow > nulls for middle_name to mean

Re: Document NULL

2024-12-09 Thread David G. Johnston
On Wed, Nov 20, 2024 at 7:24 PM jian he wrote: > > attached image.png for > 5.2.7.2. Array Elements and IN Bag Members > the example is too overwhelming, one or two should be enough? > Agreed, fixed in the upcoming v5. The four outputs are actually two equivalent pairs so I framed them up as s

Re: Document NULL

2024-12-09 Thread Marcos Pegoraro
Em seg., 9 de dez. de 2024 às 13:31, David G. Johnston < david.g.johns...@gmail.com> escreveu: > I'm OK with adding more cross-references (links or just brief comparative > verbiage like the above) to non-SQL null value treatment but this document, > for this patch, is going to focus solely on SQL

Re: Document NULL

2024-12-09 Thread David G. Johnston
On Thu, Nov 21, 2024 at 8:03 AM Marcos Pegoraro wrote: > Em qui., 21 de nov. de 2024 às 11:42, David G. Johnston < > david.g.johns...@gmail.com> escreveu: > >> >> I'm not following your train of thought here. Since null == null in >> json-land there isn't a need for or concept of "is distinct fr

Re: Document NULL

2024-12-09 Thread David G. Johnston
On Mon, Dec 2, 2024 at 12:18 AM jian he wrote: > >> > >> typo: > >> There are none. During initializion all settings are assigned a > non-null value. > >> 5.2.16. Null Values in Partiton Keys > >> As noted in the synatx chapter, a null value literal is written using > >> the NULL keyword. Its typ

Re: Document NULL

2024-12-09 Thread David G. Johnston
On Sat, Nov 23, 2024 at 5:30 AM Marcos Pegoraro wrote: > Em qui., 21 de nov. de 2024 às 12:04, David G. Johnston < > david.g.johns...@gmail.com> escreveu: > > Typo in NuLl, mixed upper and lower case. > > SELECT > NULL AS "Literal Null Value", > pg_typeof(null) AS "Type of Null", > pg

Re: Document NULL

2024-12-01 Thread jian he
>> >> typo: >> There are none. During initializion all settings are assigned a non-null >> value. >> 5.2.16. Null Values in Partiton Keys >> As noted in the synatx chapter, a null value literal is written using >> the NULL keyword. Its type is the pseudo-type unknown but can be cast >> to any conc

Re: Document NULL

2024-11-23 Thread Marcos Pegoraro
Em qui., 21 de nov. de 2024 às 12:04, David G. Johnston < david.g.johns...@gmail.com> escreveu: Typo in NuLl, mixed upper and lower case. SELECT NULL AS "Literal Null Value", pg_typeof(null) AS "Type of Null", pg_typeof(NuLl::text) AS "Type of Cast null", cast(null as text) AS "Ca

Re: Document NULL

2024-11-22 Thread Jeff Davis
On Fri, 2024-06-28 at 13:39 -0700, David G. Johnston wrote: > The attached are complete and ready for review.  I did some file > structure reformatting at the end and left that as the second patch.  > The first contains all of the content. I read through v4-0001. Thank you for working on this! I

Re: Document NULL

2024-11-21 Thread Marcos Pegoraro
Em qui., 21 de nov. de 2024 às 12:02, Marcos Pegoraro escreveu: Well, all comparisons with JSONs runs differently with null values, so maybe an example would help select f1 = f2 "JS Object Equal - Right", f1->'a' = f2->'a' "JS Value Equal - Right", f1->>'a' = f2->>'a' "Text Equal -

Re: Document NULL

2024-11-21 Thread David G. Johnston
On Fri, Jun 28, 2024 at 1:39 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > The attached are complete and ready for review. I did some file structure > reformatting at the end and left that as the second patch. The first > contains all of the content. > To help manage this fairly l

Re: Document NULL

2024-11-21 Thread David G. Johnston
On Thu, Nov 21, 2024 at 6:50 AM Marcos Pegoraro wrote: > About JSONB_PATH, you said that "JSON null value is considered equal to > other JSON null values", but didn't say anything about IS DISTINCT FROM > at jsonb_path level. Wouldn't be good to mention something about it ? > > select '{1,2}'::in

Re: Document NULL

2024-11-21 Thread Marcos Pegoraro
Em qui., 21 de nov. de 2024 às 11:42, David G. Johnston < david.g.johns...@gmail.com> escreveu: > > I'm not following your train of thought here. Since null == null in > json-land there isn't a need for or concept of "is distinct from". We tend > to not expend space on pointing out things that d

Re: Document NULL

2024-11-21 Thread David G. Johnston
On Wed, Nov 20, 2024 at 7:24 PM jian he wrote: > On Wed, Nov 20, 2024 at 11:57 PM David G. Johnston > wrote: > > > >> - > >> in doc/src/sgml/nullvalues.sgml > >> see the attached for one example output > >> > >> in doc/src/sgml/nullval

Re: Document NULL

2024-11-21 Thread Marcos Pegoraro
About JSONB_PATH, you said that "JSON null value is considered equal to other JSON null values", but didn't say anything about IS DISTINCT FROM at jsonb_path level. Wouldn't be good to mention something about it ? select '{1,2}'::integer[] is distinct from null::integer[] select jsonb_path_exists(

Re: Document NULL

2024-11-20 Thread David G. Johnston
Thank you for taking the time to look this over. On Wed, Nov 20, 2024 at 3:19 AM jian he wrote: > On Sat, Jun 29, 2024 at 4:40 AM David G. Johnston > wrote: > > > > The attached are complete and ready for review. I did some file > structure reformatting at the end and left that as the second p

Re: Document NULL

2024-06-26 Thread Yugo NAGATA
On Tue, 18 Jun 2024 23:02:14 -0700 "David G. Johnston" wrote: > On Tuesday, June 18, 2024, Tom Lane wrote: > > > Yugo NAGATA writes: > > > On Tue, 18 Jun 2024 20:56:58 -0700 > > > "David G. Johnston" wrote: > > >> But it is neither a keyword nor an identifier. > > > > The lexer would be quite

Re: Document NULL

2024-06-18 Thread David G. Johnston
On Tuesday, June 18, 2024, Tom Lane wrote: > Yugo NAGATA writes: > > On Tue, 18 Jun 2024 20:56:58 -0700 > > "David G. Johnston" wrote: > >> But it is neither a keyword nor an identifier. > > The lexer would be quite surprised by your claim that NULL isn't > a keyword. Per src/include/parser/kw

Re: Document NULL

2024-06-18 Thread Tom Lane
Yugo NAGATA writes: > On Tue, 18 Jun 2024 20:56:58 -0700 > "David G. Johnston" wrote: >> But it is neither a keyword nor an identifier. The lexer would be quite surprised by your claim that NULL isn't a keyword. Per src/include/parser/kwlist.h, NULL is a keyword, and a fully reserved one at tha

Re: Document NULL

2024-06-18 Thread Yugo NAGATA
On Tue, 18 Jun 2024 20:56:58 -0700 "David G. Johnston" wrote: > On Tue, Jun 18, 2024 at 8:34 PM Yugo NAGATA wrote: > > > > > It may be a trivial thing but I am not sure we need to mention case > > insensitivity > > here, because all keywords and unquoted identifiers are case-insensitive in > >

Re: Document NULL

2024-06-18 Thread David G. Johnston
On Tue, Jun 18, 2024 at 8:34 PM Yugo NAGATA wrote: > > It may be a trivial thing but I am not sure we need to mention case > insensitivity > here, because all keywords and unquoted identifiers are case-insensitive in > PostgreSQL and it is not specific to NULL. > But it is neither a keyword nor

Re: Document NULL

2024-06-18 Thread Yugo NAGATA
On Sat, 11 May 2024 08:33:27 -0700 "David G. Johnston" wrote: > On Fri, May 3, 2024 at 9:00 AM David G. Johnston > wrote: > > > On Fri, May 3, 2024 at 8:44 AM Tom Lane wrote: > > > >> Having said that, I reiterate my proposal that we make it a new > >> > > under DDL, before 5.2 Default Values

Re: Document NULL

2024-06-17 Thread David G. Johnston
On Sat, May 11, 2024 at 11:00 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > Though I haven’t settled on a phrasing I really like. But I’m trying to > avoid a parenthetical. > > Settled on this: The cardinal rule, a null value is neither equal nor unequal to any value, includi

Re: Document NULL

2024-05-11 Thread David G. Johnston
On Saturday, May 11, 2024, Thom Brown wrote: > > Sat, May 11, 2024, 16:34 David G. Johnston > wrote: > > My plan is to have a v4 out next week, without or without a review of this >> draft, but then the subsequent few weeks will probably be a bit quiet. >> > > + The cardinal rule, a given n

Re: Document NULL

2024-05-11 Thread Thom Brown
On Sat, May 11, 2024, 16:34 David G. Johnston wrote: > On Fri, May 3, 2024 at 9:00 AM David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Fri, May 3, 2024 at 8:44 AM Tom Lane wrote: >> >>> Having said that, I reiterate my proposal that we make it a new >>> >> under DDL, before 5.2

Re: Document NULL

2024-05-11 Thread David G. Johnston
k, without or without a review of this draft, but then the subsequent few weeks will probably be a bit quiet. David J. From bea784bd683f7e022dbfb3d72832d09fc7754913 Mon Sep 17 00:00:00 2001 From: "David G. Johnston" Date: Wed, 1 May 2024 07:45:48 -0700 Subject: [PATCH] Document NULL ---

Re: Document NULL

2024-05-03 Thread David G. Johnston
place for future bike-shedding. My next options to decide between are > the > > appendix or the lead chapter in Data Types. It really doesn't fit inside > > DDL IMO which is the only other suggestion I've seen (and an uncertain, > or > > at least unsubstantiated, o

Re: Document NULL

2024-05-03 Thread Tom Lane
pes. It really doesn't fit inside > DDL IMO which is the only other suggestion I've seen (and an uncertain, or > at least unsubstantiated, one) and a new chapter meets both criteria Tom > laid out, so long as this is framed as more than just having to document > null valu

Re: Document NULL

2024-05-03 Thread David G. Johnston
riteria Tom laid out, so long as this is framed as more than just having to document null values. > A stylistic note: "null" is an adjective. You can talk about a "null > value" or a value "is null". > Will do. David J.

Re: Document NULL

2024-05-03 Thread Peter Eisentraut
On 02.05.24 17:23, David G. Johnston wrote: Version 2 attached.  Still a draft, focused on topic picking and overall structure.  Examples and links planned plus the usual semantic markup stuff. I chose to add a new sect1 in the user guide (The SQL Language) chapter, "Data". Please, let's not

Re: Document NULL

2024-05-03 Thread David G. Johnston
On Fri, May 3, 2024 at 1:14 AM jian he wrote: > On Fri, May 3, 2024 at 2:47 PM Laurenz Albe > wrote: > > > > On Thu, 2024-05-02 at 08:23 -0700, David G. Johnston wrote: > > > Version 2 attached. Still a draft, focused on topic picking and > overall structure. > > > > I'm fine with most of the m

Re: Document NULL

2024-05-03 Thread jian he
On Fri, May 3, 2024 at 2:47 PM Laurenz Albe wrote: > > On Thu, 2024-05-02 at 08:23 -0700, David G. Johnston wrote: > > Version 2 attached. Still a draft, focused on topic picking and overall > > structure. > > I'm fine with most of the material (ignoring ellipses and typos), except this: > > +

Re: Document NULL

2024-05-02 Thread Laurenz Albe
On Thu, 2024-05-02 at 08:23 -0700, David G. Johnston wrote: > Version 2 attached.  Still a draft, focused on topic picking and overall > structure. I'm fine with most of the material (ignoring ellipses and typos), except this: +The NOT NULL column constraint is largely syntax sugar for the

Re: Document NULL

2024-05-02 Thread Kashif Zeeshan
Hi David I reviewed the documentation and it's very detailed. Thanks Kashif Zeeshan Bitnine Global On Thu, May 2, 2024 at 8:24 PM David G. Johnston wrote: > On Wed, May 1, 2024 at 9:47 PM Tom Lane wrote: > >> David Rowley writes: >> > Let's bash it into shape a bit more before going any furt

Re: Document NULL

2024-05-02 Thread David G. Johnston
2001 From: "David G. Johnston" Date: Wed, 1 May 2024 07:45:48 -0700 Subject: [PATCH] Document NULL --- doc/src/sgml/data.sgml | 169 + doc/src/sgml/filelist.sgml | 1 + doc/src/sgml/postgres.sgml | 1 + 3 files changed, 171 insertions(+) create m

Re: Document NULL

2024-05-01 Thread Tom Lane
David Rowley writes: > Let's bash it into shape a bit more before going any further on actual > wording. FWIW, I want to push back on the idea of making it a tutorial section. I too considered that, but in the end I think it's a better idea to put it into the "main" docs, for two reasons: 1. I

Re: Document NULL

2024-05-01 Thread David Rowley
On Thu, 2 May 2024 at 03:12, David G. Johnston wrote: > Attached is a very rough draft attempting this, based on my own thoughts and > those expressed by Tom in [1], which largely align with mine. Thanks for picking this up. I agree that we should have something to improve this. It would be goo

Re: Document NULL

2024-05-01 Thread Kashif Zeeshan
On Wed, May 1, 2024 at 8:12 PM David G. Johnston wrote: > Hi, > > Over in [1] it was rediscovered that our documentation assumes the reader > is familiar with NULL. It seems worthwhile to provide both an introduction > to the topic and an overview of how this special value gets handled > through

Re: Document NULL

2024-05-01 Thread Thom Brown
On Wed, May 1, 2024, 16:13 David G. Johnston wrote: > Hi, > > Over in [1] it was rediscovered that our documentation assumes the reader > is familiar with NULL. It seems worthwhile to provide both an introduction > to the topic and an overview of how this special value gets handled > throughout

Document NULL

2024-05-01 Thread David G. Johnston
entire new section in its own file. David J. [1] https://www.postgresql.org/message-id/1859814.1714532025%40sss.pgh.pa.us From a068247e92e620455a925a0ae746adc225ae1339 Mon Sep 17 00:00:00 2001 From: "David G. Johnston" Date: Wed, 1 May 2024 07:45:48 -0700 Subject: [PATCH] Document NU