inconsistent use of SearchSysCacheCopy

2024-12-06 Thread Jeff Davis
When modifying catalog contents, some callers use SearchSysCacheN() and some use SearchSysCacheCopyN(). for instance, these callers use SearchSysCacheN(): - AggregateCreate() - ProcedureCreate() while these callers that use SearchSysCacheCopyN(): - OperatorCreate() - TypeCreate() I gen

Re: Inconsistent use of relpages = -1

2024-10-25 Thread Jeff Davis
On Thu, 2024-10-24 at 05:01 +0300, Laurenz Albe wrote: > What you write above indicates that "relpages" = 0 and "reltuples" > > 0 > would also be acceptable. As Tom pointed out, that creates a risk that it's interpreted as infinite tuple denisity. The only functional change in my patch is to crea

Re: Inconsistent use of relpages = -1

2024-10-24 Thread Laurenz Albe
On Thu, 2024-10-24 at 08:03 -0700, Jeff Davis wrote: > On Thu, 2024-10-24 at 05:01 +0300, Laurenz Albe wrote: > > What you write above indicates that "relpages" = 0 and "reltuples" > > > 0 > > would also be acceptable. > > As Tom pointed out, that creates a risk that it's interpreted as > infinite

Re: Inconsistent use of relpages = -1

2024-10-24 Thread Laurenz Albe
On Wed, 2024-10-23 at 10:05 -0700, Jeff Davis wrote: > On Wed, 2024-10-23 at 04:47 +0200, Laurenz Albe wrote: > > On Tue, 2024-10-22 at 10:41 -0700, Jeff Davis wrote: > > > I attached a patch that creates partitioned tables with relpages=- > > > 1, > > > and updates the docs. > > > > Does this nee

Re: Inconsistent use of relpages = -1

2024-10-23 Thread Tom Lane
Jeff Davis writes: > It bothers me somewhat that views still have relpages=0, because they > also don't have storage. Thoughts? I think it's fine, because they also have reltuples=0. The combination of those two zeroes indicates ignorance as to the rel's contents. If either field is not zero, t

Re: Inconsistent use of relpages = -1

2024-10-23 Thread Jeff Davis
On Wed, 2024-10-23 at 04:47 +0200, Laurenz Albe wrote: > On Tue, 2024-10-22 at 10:41 -0700, Jeff Davis wrote: > > I attached a patch that creates partitioned tables with relpages=- > > 1, > > and updates the docs. > > Does this need any changes for pg_upgrade? pg_upgrade would go through the same

Re: Inconsistent use of relpages = -1

2024-10-22 Thread Laurenz Albe
On Tue, 2024-10-22 at 10:41 -0700, Jeff Davis wrote: > I attached a patch that creates partitioned tables with relpages=-1, > and updates the docs. Does this need any changes for pg_upgrade? Yours, Laurenz Albe

Re: Inconsistent use of relpages = -1

2024-10-22 Thread Jeff Davis
On Fri, 2024-10-18 at 15:14 -0400, Tom Lane wrote: > If we are going to put data into reltuples but not relpages, > I think I agree with setting relpages to -1 to signify > "unknown" (analogously to -1 for reltuples).  Otherwise it > looks like the table has infinite tuple density, which is > likel

Re: Inconsistent use of relpages = -1

2024-10-18 Thread Tom Lane
Jeff Davis writes: > As Corey discovered, and I re-discovered later, partitioned tables can > have relpages=-1: > ... > Another problem is that it's inconsistent: sometimes it's 0 (before > analyze) and sometimes -1. Views also don't have any storage, but > relpages are always 0. > ... > I don't s

Inconsistent use of relpages = -1

2024-10-18 Thread Jeff Davis
As Corey discovered, and I re-discovered later, partitioned tables can have relpages=-1: https://www.postgresql.org/message-id/f4a0cf7975f1ad42a20fcc91be9e938a4f71259d.ca...@j-davis.com One problem is that the code (analyze.c:680) is a bit unclear because it implicitly casts back and forth betwee

Re: Inconsistent use of "volatile" when accessing shared memory?

2023-11-04 Thread Jeff Davis
On Fri, 2023-11-03 at 18:36 -0700, Andres Freund wrote: > All that is happening here is that clang can prove that nothing ever > could > change the variable ... > See https://godbolt.org/z/EaM77E8jK > > We don't gain anything from preventing the compiler from making such > conclusions afaict.

Re: Inconsistent use of "volatile" when accessing shared memory?

2023-11-03 Thread Andres Freund
Hi, On 2023-11-03 17:44:44 -0700, Jeff Davis wrote: > On Fri, 2023-11-03 at 15:59 -0700, Andres Freund wrote: > > I don't think so. We used to use volatile for most shared memory > > accesses, but > > volatile doesn't provide particularly useful semantics - and > > generates > > *vastly* slower co

Re: Inconsistent use of "volatile" when accessing shared memory?

2023-11-03 Thread Jeff Davis
On Fri, 2023-11-03 at 15:59 -0700, Andres Freund wrote: > I don't think so. We used to use volatile for most shared memory > accesses, but > volatile doesn't provide particularly useful semantics - and > generates > *vastly* slower code in a lot of circumstances. Most of that usage > predates > spi

Re: Inconsistent use of "volatile" when accessing shared memory?

2023-11-03 Thread Andres Freund
Hi, On 2023-11-02 23:19:03 -0700, Jeff Davis wrote: > I noticed that we occasionally use "volatile" to access shared memory, > but usually not; and I'm not clear on the rules for doing so. For > instance, AdvanceXLInsertBuffer() writes to XLogCtl->xlblocks[nextidx] > through a volatile pointer; bu

Inconsistent use of "volatile" when accessing shared memory?

2023-11-02 Thread Jeff Davis
I noticed that we occasionally use "volatile" to access shared memory, but usually not; and I'm not clear on the rules for doing so. For instance, AdvanceXLInsertBuffer() writes to XLogCtl->xlblocks[nextidx] through a volatile pointer; but then immediately writes to XLogCtl- >InitializedUpTo with

Re: Inconsistent "" use

2021-01-10 Thread Tatsuo Ishii
> I'm with Noah: small caps are *not* an improvement, they're just > distractingly fussy. I note that the authors of the stylesheets > we use seem to agree, because AFAICS is not rendered > specially in either HTML or PDF output. > > Given this docbook.org advice, I'd be inclined to just remove

Re: Inconsistent "" use

2021-01-10 Thread Tom Lane
Bruce Momjian writes: > On Sun, Jan 10, 2021 at 01:11:07PM -0800, Noah Misch wrote: >> https://tdg.docbook.org/tdg/5.2/acronym.html suggests docbook formatters >> either ignore that or use it as a signal to substitute small caps. >> I don't consider small caps an improvement for "SQL", so I'd pre

Re: Inconsistent "" use

2021-01-10 Thread Bruce Momjian
On Sun, Jan 10, 2021 at 01:11:07PM -0800, Noah Misch wrote: > On Sun, Jan 10, 2021 at 08:22:42PM +0900, Tatsuo Ishii wrote: > > In doc/src/sgml/func.sgml description of SHOW command use > > "SQL", while SET command description the same > > section does not use "". Shouldn't the description of SET u

Re: Inconsistent "" use

2021-01-10 Thread Noah Misch
On Sun, Jan 10, 2021 at 08:22:42PM +0900, Tatsuo Ishii wrote: > In doc/src/sgml/func.sgml description of SHOW command use > "SQL", while SET command description the same > section does not use "". Shouldn't the description of SET use > "" for "SQL" as well? Patch attached. https://tdg.docbook.org/

Inconsistent "" use

2021-01-10 Thread Tatsuo Ishii
In doc/src/sgml/func.sgml description of SHOW command use "SQL", while SET command description the same section does not use "". Shouldn't the description of SET use "" for "SQL" as well? Patch attached. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.ph

Re: BUG #15623: Inconsistent use of default for updatable view

2019-02-28 Thread Dean Rasheed
On Thu, 28 Feb 2019 at 07:47, Amit Langote wrote: > > +if (attrno == 0) > +elog(ERROR, "Cannot set value in column %d to > DEFAULT", i); > > Maybe: s/Cannot/cannot/g > Ah yes, you're right. That is the convention. > +Assert(list_length(sublist) == num

Re: BUG #15623: Inconsistent use of default for updatable view

2019-02-27 Thread Amit Langote
On 2019/02/27 18:37, Dean Rasheed wrote: > On Tue, 12 Feb 2019 at 10:33, Dean Rasheed wrote: >> Here's an updated patch ... > > So I pushed that. However, ... > > Playing around with it some more, I realised that whilst this appeared > to fix the reported problem, it exposes another issue which

Re: BUG #15623: Inconsistent use of default for updatable view

2019-02-27 Thread Dean Rasheed
On Tue, 12 Feb 2019 at 10:33, Dean Rasheed wrote: > Here's an updated patch ... So I pushed that. However, ... Playing around with it some more, I realised that whilst this appeared to fix the reported problem, it exposes another issue which is down to the interaction between rewriteTargetListIU