Re: Making the subquery alias optional in the FROM clause

2022-06-27 Thread David G. Johnston
On Mon, Jun 27, 2022 at 11:25 AM Dean Rasheed wrote: > On Mon, 27 Jun 2022 at 16:12, Julien Rouhaud wrote: > > > > It doesn't play that well if you have something called subquery though: > > > > [example that changes a user-provided alias] > > > > While the output is a valid query, it's not

Re: doc: Clarify Savepoint Behavior

2022-06-26 Thread David G. Johnston
Thank you for the review. On Thu, Jun 23, 2022 at 5:35 AM Simon Riggs wrote: > On Thu, 9 Jun 2022 at 16:41, David G. Johnston > wrote: > > "The name to give to the new savepoint. The name may already exist, > + in which case a rollback or release to th

Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT

2022-06-30 Thread David G. Johnston
On Thu, Jun 30, 2022 at 1:43 PM Robert Haas wrote: > On Thu, Jun 9, 2022 at 11:40 AM David G. Johnston > wrote: > > As one cannot place excluded in a FROM clause (subquery) in the > > ON CONFLICT clause referring to it as a table, ... > > Well, it would be

Re: doc: Move enum storage commentary to top of section

2022-07-06 Thread David G. Johnston
On Wed, Jul 6, 2022 at 10:24 AM Matthias van de Meent < boekewurm+postg...@gmail.com> wrote: > On Thu, 9 Jun 2022 at 18:12, David G. Johnston > wrote: > > > > Per suggestion over on -docs: > > > > > https://www.postgresql.org/message-id/bl0pr06mb4978

Re: SYSTEM_USER reserved word implementation

2022-06-22 Thread David G. Johnston
On Wed, Jun 22, 2022 at 9:28 AM Tom Lane wrote: > Joe Conway writes: > > On 6/22/22 11:52, Tom Lane wrote: > >> I think a case could be made for ONLY returning non-null when authn_id > >> represents some externally-verified identifier (OS user ID gotten via > >> peer identification, Kerberos

Re: explain analyze rows=%.0f

2022-06-22 Thread David G. Johnston
On Wed, Jun 22, 2022 at 12:11 PM Ibrar Ahmed wrote: > On Thu, Jun 23, 2022 at 12:01 AM Tom Lane wrote: > >> Robert Haas writes: >> > On Jun 2, 2009, at 9:41 AM, Simon Riggs wrote: >> >> You're right that the number of significant digits already exceeds the >> >> true accuracy of the

Re: [PoC] Let libpq reject unexpected authentication requests

2022-06-22 Thread David G. Johnston
On Thu, Jun 9, 2022 at 4:30 PM Jacob Champion wrote: > On Wed, Jun 8, 2022 at 9:58 PM Michael Paquier > wrote: > > > One > > interesting case comes down to stuff like channel_binding=require > > require_auth="md5,scram-sha-256", where I think that we should still > > fail even if the server

Re: invoker function security issues

2022-06-08 Thread David G. Johnston
On Wed, Jun 8, 2022 at 7:29 AM Virender Singla wrote: > but I still expect Postgres to save us from such data inconsistencies > issues by using early binding for functional Indexes. > Well, if the functions you are writing are "black boxes" to PostgreSQL this expectation seems unreasonable.

doc: Bring mention of unique index forced transaction wait behavior outside of the internal section

2022-06-09 Thread David G. Johnston
Hi. The fact that one transaction will wait on another if they are trying to claim the same unique value is presently relegated to a subchapter of the documentation where the typical reader will not even understand (rightly so) the main chapter's title. This has prompted a number of questions

doc: array_length produces null instead of 0

2022-06-09 Thread David G. Johnston
Hi, Per discussion here: https://www.postgresql.org/message-id/163636931138.8076.5140809232053731248%40wrigleys.postgresql.org We can now easily document the array_length behavior of returning null instead of zero for an empty array/dimension. I added an example to the json_array_length

Re: Modest proposal to extend TableAM API for controlling cluster commands

2022-06-15 Thread David G. Johnston
On Wed, Jun 15, 2022 at 8:18 PM Andres Freund wrote: > > If a simple callback like > > relation_supports_cluster(Relation rel) is too simplistic > Seems like it should be called: relation_supports_compaction[_by_removal_of_interspersed_dead_tuples] Basically, if the user tells the table to

Re: Extending USING [heap | mytam | yourtam] grammar and behavior

2022-06-15 Thread David G. Johnston
On Wed, Jun 15, 2022 at 8:51 PM Michael Paquier wrote: > On top of that > default_table_access_method is user-settable. > > FWIW this proposal acknowledges that and basically leverages it to the hilt, turning it into something like search_path. I strongly dislike the idea of any workflow that

Re: Modest proposal to extend TableAM API for controlling cluster commands

2022-06-16 Thread David G. Johnston
On Wed, Jun 15, 2022 at 11:23 PM Mark Dilger wrote: > > > On Jun 15, 2022, at 8:50 PM, David G. Johnston < > david.g.johns...@gmail.com> wrote: > > > > On Wed, Jun 15, 2022 at 8:18 PM Andres Freund > wrote: > > > If a simple callback like > >

Re: Assorted small doc patches

2022-06-20 Thread David G. Johnston
On Wed, Jun 1, 2022 at 7:05 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 31.05.22 22:12, David G. Johnston wrote: > > Anything I should be doing differently here to get a bit of > > reviewer/committer time on these? I'll add them to the commitfe

doc: Clarify Savepoint Behavior

2022-06-09 Thread David G. Johnston
Hi, Reposting this on its own thread. https://www.postgresql.org/message-id/flat/CAKFQuwby1aMsJDMeibaBaohgoaZhivAo4WcqHC1%3D9-GDZ3TSng%40mail.gmail.com Presently, the open item seems to be whether my novelty regarding the reworked example is too much. David J.

doc: Clarify what "excluded" represents for INSERT ON CONFLICT

2022-06-09 Thread David G. Johnston
Hi, Reposting this on its own thread. https://www.postgresql.org/message-id/flat/CAKFQuwby1aMsJDMeibaBaohgoaZhivAo4WcqHC1%3D9-GDZ3TSng%40mail.gmail.com As one cannot place excluded in a FROM clause (subquery) in the ON CONFLICT clause referring to it as a table, with plural rows

Re: doc: Clarify Savepoint Behavior

2022-06-09 Thread David G. Johnston
On Thu, Jun 9, 2022 at 8:36 AM David G. Johnston wrote: > Hi, > > Reposting this on its own thread. > > > https://www.postgresql.org/message-id/flat/CAKFQuwby1aMsJDMeibaBaohgoaZhivAo4WcqHC1%3D9-GDZ3TSng%40mail.gmail.com > > Presently, the open item seems to be whet

doc: Clarify Routines and Extension Membership

2022-06-09 Thread David G. Johnston
Hi. Reposting this on its own thread. https://www.postgresql.org/message-id/flat/CAKFQuwby1aMsJDMeibaBaohgoaZhivAo4WcqHC1%3D9-GDZ3TSng%40mail.gmail.com Per discussion on -general the documentation for the ALTER ROUTINE ... DEPENDS ON EXTENSION and DROP EXTENSION doesn't clearly

doc: Fix description of how the default user name is chosen

2022-06-09 Thread David G. Johnston
Hi. Reposting this on its own thread. https://www.postgresql.org/message-id/flat/CAKFQuwby1aMsJDMeibaBaohgoaZhivAo4WcqHC1%3D9-GDZ3TSng%40mail.gmail.com The default database name is just the user name, not the operating-system user name. In passing, the authentication error examples

doc: Make selectivity example match wording

2022-06-09 Thread David G. Johnston
Hi, Reposting this to its own thread. https://www.postgresql.org/message-id/flat/CAKFQuwby1aMsJDMeibaBaohgoaZhivAo4WcqHC1%3D9-GDZ3TSng%40mail.gmail.com doc: make unique non-null join selectivity example match the prose The description of the computation for the unique, non-null,

doc: Move enum storage commentary to top of section

2022-06-09 Thread David G. Johnston
Per suggestion over on -docs: https://www.postgresql.org/message-id/bl0pr06mb4978f6c0b69f3f03aebed0fbb3...@bl0pr06mb4978.namprd06.prod.outlook.com David J. 0001-doc-Move-enum-storage-size-to-top-of-section.patch Description: Binary data

Re: replacing role-level NOINHERIT with a grant-level option

2022-06-13 Thread David G. Johnston
On Mon, Jun 13, 2022 at 11:01 AM Robert Haas wrote: > Some > syntax would be a bit different on the new releases and that would > unlock some new options we don't currently have, but there's no > behavior that you can get today which you wouldn't be able to get any > more under this proposal. >

Re: MERGE and parsing with prepared statements

2022-07-15 Thread David G. Johnston
On Fri, Jul 15, 2022 at 12:40 PM Justin Pryzby wrote: > > That appears to be copied from the INSERT page. > What does that mean, if not that data types will be resolved as needed ? > Yep, and the system needs to resolve the type at a point where there is no contextual information and so it

Re: Select Reference Page - Make Join Syntax More Prominent

2022-07-15 Thread David G. Johnston
On Thu, Jul 7, 2022 at 2:33 PM Tom Lane wrote: > "David G. Johnston" writes: > > Looking again at the SELECT Reference page while helping a novice user I > > was once again annoyed but how the most common query syntax form for the > > FROM clause is buried wit

Re: MERGE and parsing with prepared statements

2022-07-15 Thread David G. Johnston
On Fri, Jul 15, 2022 at 12:40 PM Justin Pryzby wrote: > On Fri, Jul 15, 2022 at 12:17:51PM -0700, David G. Johnston wrote: > > On Fri, Jul 15, 2022 at 11:40 AM Alvaro Herrera > wrote: > > > On 2022-Jul-15, Justin Pryzby wrote: > > > > > > > It seems a

Re: Move Section 9.27.7 (Data Object Management Functions) to System Information Chapter

2022-07-15 Thread David G. Johnston
On Thu, Jul 14, 2022 at 3:57 PM Tom Lane wrote: > Bruce Momjian writes: > > On Mon, Apr 25, 2022 at 08:33:47AM -0700, David G. Johnston wrote: > >> Both the location and name of the linked to section make no sense to me: > >> https://www.postgresql.org/docs/c

Re: MERGE and parsing with prepared statements

2022-07-15 Thread David G. Johnston
On Fri, Jul 15, 2022 at 11:40 AM Alvaro Herrera wrote: > On 2022-Jul-15, Justin Pryzby wrote: > > > It seems a bit odd that it's impossible to use merge with prepared > statements > > without specifically casting the source types (which I did now to > continue my > > experiment). > > I have no

Re: doc: Bring mention of unique index forced transaction wait behavior outside of the internal section

2022-07-15 Thread David G. Johnston
On Thu, Jul 14, 2022 at 12:18 PM Bruce Momjian wrote: > On Mon, Jul 11, 2022 at 05:22:41PM +0300, Aleksander Alekseev wrote: > > Hi Bruce, > > > > > I was not happy with putting this in the Transaction Isolation section. > > > I rewrote it and put it in the INSERT secion, right before ON

Re: [PATCH] Introduce array_shuffle() and array_sample()

2022-07-18 Thread David G. Johnston
On Mon, Jul 18, 2022 at 3:18 PM Tom Lane wrote: > > Independently of the dimensionality question --- I'd imagined that > array_sample would select a random subset of the array elements > but keep their order intact. If you want the behavior shown > above, you can do

Re: Doc about how to set max_wal_senders when setting minimal wal_level

2022-07-18 Thread David G. Johnston
On Mon, Jul 18, 2022 at 6:27 PM Japin Li wrote: > > On Tue, 19 Jul 2022 at 03:58, Bruce Momjian wrote: > > On Fri, Jul 15, 2022 at 09:29:20PM +0800, Japin Li wrote: > >> > >> On Fri, 15 Jul 2022 at 08:49, Bruce Momjian wrote: > >> > On Tue, Jul 5, 2022 at 08:02:33PM -0400, Tom Lane wrote: >

Re: Doc about how to set max_wal_senders when setting minimal wal_level

2022-07-18 Thread David G. Johnston
On Mon, Jul 18, 2022 at 8:16 PM Bruce Momjian wrote: > On Mon, Jul 18, 2022 at 07:39:55PM -0700, David G. Johnston wrote: > > On Mon, Jul 18, 2022 at 6:27 PM Japin Li wrote: > > > > > > +0.90 > > > > Consider changing: > > > >

Re: doc: New cumulative stats subsystem obsoletes comment in maintenance.sgml

2022-07-18 Thread David G. Johnston
On Thu, Jul 14, 2022 at 4:31 PM Andres Freund wrote: > Hi, > > I had missed David's original email on this topic... > > On 2022-07-14 18:58:09 -0400, Bruce Momjian wrote: > > On Wed, Apr 20, 2022 at 04:40:44PM -0700, David G. Johnston wrote: > > > The new cumulative

Re: Proposal to introduce a shuffle function to intarray extension

2022-07-16 Thread David G. Johnston
On Sat, Jul 16, 2022 at 7:25 PM Martin Kalcher < martin.kalc...@aboutsource.net> wrote: > > - I added a second function sample(), because it is a lot faster to take >some elements from an array than to shuffle the whole array and >slice it. This function can be removed if it is not

Re: Proposal to introduce a shuffle function to intarray extension

2022-07-16 Thread David G. Johnston
On Sat, Jul 16, 2022 at 8:18 PM Tom Lane wrote: > Martin Kalcher writes: > > > - I added a second function sample(), because it is a lot faster to take > >some elements from an array than to shuffle the whole array and > >slice it. This function can be removed if it is not wanted. > > I

Re: doc: Make selectivity example match wording

2022-07-16 Thread David G. Johnston
On Sat, Jul 2, 2022 at 12:42 PM Dian M Fay wrote: > On Thu Jun 9, 2022 at 11:57 AM EDT, David G. Johnston wrote: > > Reposting this to its own thread. > > > > > https://www.postgresql.org/message-id/flat/CAKFQuwby1aMsJDMeibaBaohgoaZhivAo4WcqHC1%3D9-GDZ3TSng%40mail.gmail.c

Re: Move Section 9.27.7 (Data Object Management Functions) to System Information Chapter

2022-07-16 Thread David G. Johnston
On Fri, Jul 15, 2022 at 12:36 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > > I would ask that we at least rename it to: > > Disk Usage Functions > > Nevermind...I identified the scope of that header incorrectly and the rename wouldn't be appropri

Re: doc: Clarify Routines and Extension Membership

2022-07-14 Thread David G. Johnston
On Thu, Jul 14, 2022 at 2:41 PM Bruce Momjian wrote: > On Fri, Jul 8, 2022 at 10:55:55PM -0400, Bruce Momjian wrote: > > > The/that inconsistency ... choose one. Or actually, the "an ... the" > > > combination you used elsewhere doesn't grate on the ear either. > > > > > > + For each

Re: predefined role(s) for VACUUM and ANALYZE

2022-07-26 Thread David G. Johnston
On Tue, Jul 26, 2022 at 10:37 AM Robert Haas wrote: > On Mon, Jul 25, 2022 at 9:47 PM Kyotaro Horiguchi > wrote: > > One arguable point would be whether we will need to put restriction > > the target relations that Bob can vacuum/analyze. > > But for a command with a target, you really ought

Re: pg_auth_members.grantor is bunk

2022-07-28 Thread David G. Johnston
On Thu, Jul 28, 2022 at 12:09 PM Robert Haas wrote: > On Tue, Jul 26, 2022 at 12:46 PM Robert Haas > wrote: > > I believe that these patches are mostly complete, but I think that > > dumpRoleMembership() probably needs some more work. I don't know what > > exactly, but there's nothing to cause

Undocumented Order By vs Target List Volatile Function Behavior

2022-07-21 Thread David G. Johnston
Hey, This came up today on twitter as a claimed POLA violation: postgres=# select random(), random() order by random(); random| random -+- 0.08176638503720679 | 0.08176638503720679 (1 row) Which was explained long ago by Tom as:

Re: let's disallow ALTER ROLE bootstrap_superuser NOSUPERUSER

2022-07-21 Thread David G. Johnston
On Thu, Jul 21, 2022 at 9:28 AM Tom Lane wrote: > Robert Haas writes: > > Currently, it's possible to remove the rolissuper bit from the > > bootstrap superuser, but this leaves that user - and the system in > > general - in an odd state. The bootstrap user continues to own all of > > the

Re: explain_regress, explain(MACHINE), and default to explain(BUFFERS) (was: BUFFERS enabled by default in EXPLAIN (ANALYZE))

2022-07-26 Thread David G. Johnston
On Mon, Jan 24, 2022 at 9:54 AM Justin Pryzby wrote: > I'm renaming this thread for better visibility, since buffers is a small, > optional part of the patches I sent. > > I made a CF entry here. > https://commitfest.postgresql.org/36/3409/ > > On Wed, Dec 01, 2021 at 06:58:20PM -0600, Justin

Re: Question about ExplainOneQuery_hook

2022-07-26 Thread David G. Johnston
On Tue, Jul 26, 2022 at 1:54 PM Zhihong Yu wrote: > Hi, > I was looking at ExplainOneQuery() where ExplainOneQuery_hook is called. > > Currently the call to the hook is in if block and normal processing is in > else block. > > What if the hook doesn't want to duplicate the whole code printing >

Re: Expand palloc/pg_malloc API

2022-07-26 Thread David G. Johnston
On Tue, Jul 26, 2022 at 2:32 PM Tom Lane wrote: > > 2. I don't like the "palloc_ptrtype" name at all. I see that you > borrowed that name from talloc, but I doubt that's a precedent that > very many people are familiar with. > To me it sounds like it might > allocate something that's the

Official Windows Installer and Documentation

2022-07-27 Thread David G. Johnston
Hey, Just interacted with a frustrated user on Slack trying to upgrade from v13 to v14 on Windows. Our official download page for the Windows installer claims the core documentation as its official reference - can someone responsible for this area please suggest and test some changes to make

Re: Proposal: add a debug message about using geqo

2022-07-27 Thread David G. Johnston
On Fri, Jul 22, 2022 at 1:20 PM Jacob Champion wrote: > On Wed, Jun 1, 2022 at 11:09 PM KAWAMOTO Masaya > wrote: > > That sounds a nice idea. But I don't think that postgres shows in the > > EXPLAIN output why the plan is selected. Would it be appropriate to > > show that GEQO is used in

Re: doc: Clarify Savepoint Behavior

2022-07-26 Thread David G. Johnston
On Thu, Jul 14, 2022 at 12:44 PM Bruce Momjian wrote: > On Sat, Jul 9, 2022 at 12:59:23PM -0400, Bruce Momjian wrote: > > On Sun, Jun 26, 2022 at 09:14:56AM -0700, David G. Johnston wrote: > > > So leave the "release" behavior implied from the rollback behavior?

Re: Official Windows Installer and Documentation

2022-07-27 Thread David G. Johnston
On Wed, Jul 27, 2022 at 6:42 PM Julien Rouhaud wrote: > Hi, > > On Wed, Jul 27, 2022 at 11:36:11PM +0200, Thomas Kellerer wrote: > > David G. Johnston schrieb am 27.07.2022 um 21:21: > > > And then there is the issue of file ownership. > > > > >

Re: Official Windows Installer and Documentation

2022-07-27 Thread David G. Johnston
On Wednesday, July 27, 2022, Julien Rouhaud wrote: > On Wed, Jul 27, 2022 at 07:02:51PM -0700, David G. Johnston wrote: > > > > In the end the problem is ours and cannot be simply assigned to a > > third-party. So let's resolve it here (on this list, whatever th

Re: Official Windows Installer and Documentation

2022-07-27 Thread David G. Johnston
On Wed, Jul 27, 2022 at 8:22 PM Tom Lane wrote: > I wrote: > > If EDB isn't adequately filling in the documentation for the behavior > > of their packaging, that's on them. > > Having now looked more closely at the pg_upgrade documentation, > I don't think this is exactly EDB's fault; it's text

Re: Doc about how to set max_wal_senders when setting minimal wal_level

2022-07-15 Thread David G. Johnston
On Fri, Jul 15, 2022 at 6:27 AM Japin Li wrote: > > > > > +servers. If setting max_wal_senders to > > +0 consider also reducing the amount of WAL > produced > > +by changing wal_level to > minimal. > > > > I don't think this is great advice. It will encourage people to

Interpretation of docs for \copy ... from stdin inaccurate when using -c

2022-07-22 Thread David G. Johnston
This works: vagrant@vagrant:/usr/local/pgsql/bin$ echo 'value1' | ./psql -d postgres -c '\copy csvimport from stdin;' COPY 1 However: For \copy ... from stdin, data rows are read from the same source that issued the command and When either -c or -f is specified, psql does not read commands

Re: ERROR: type of parameter 1 (fruit2) does not match that when preparing the plan (fruit1)

2022-05-01 Thread David G. Johnston
Moving discussion to -hackers On Sun, May 1, 2022 at 12:46 PM Tom Lane wrote: > "David G. Johnston" writes: > > On Sun, May 1, 2022 at 10:08 AM Tom Lane wrote: > >> Maybe we could improve this situation by treating a "record" parameter > >> a

Re: fix cost subqueryscan wrong parallel cost

2022-04-29 Thread David G. Johnston
On Fri, Apr 29, 2022 at 12:31 PM Tom Lane wrote: > "David G. Johnston" writes: > > The fact that (baserel.rows > path->subpath->rows) here seems like a > > straight bug: there are no filters involved in this case but in the > > presence of filters baser

Re: Improving the "Routine Vacuuming" docs

2022-04-13 Thread David G. Johnston
On Wed, Apr 13, 2022 at 2:19 PM Peter Geoghegan wrote: > On Wed, Apr 13, 2022 at 1:25 PM Robert Haas wrote: > > On Wed, Apr 13, 2022 at 12:34 PM Peter Geoghegan wrote: > > > What do you think of the idea of relating freezing to removing tuples > > > by VACUUM at this point? This would be a

Re: shared-memory based stats collector - v70

2022-04-13 Thread David G. Johnston
On Tue, Apr 5, 2022 at 8:00 PM Andres Freund wrote: > Here comes v70: > > One thing I just noticed while peeking at pg_stat_slru: The stats_reset column for my newly initdb'd cluster is showing me "2000-01-01 00:00:00" (v15). I was expecting null, though a non-null value restriction does make

Re: shared-memory based stats collector - v70

2022-04-13 Thread David G. Johnston
On Wed, Apr 13, 2022 at 4:34 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tue, Apr 5, 2022 at 8:00 PM Andres Freund wrote: > >> Here comes v70: >> >> > One thing I just noticed while peeking at pg_stat_slru: > > The stats_reset column for

VPath Build Errors

2022-04-13 Thread David G. Johnston
Hey, I've been building in the git repo just fine but wanted to use vpath builds so I could keep both "maked" v14 and v15 binaries around, ready to be installed. The attached log is result of (while in the versioned directory, a sibling of the git repo) `../postgresql/configure` `make` `tree`

Re: VPath Build Errors

2022-04-13 Thread David G. Johnston
On Wed, Apr 13, 2022 at 5:44 PM Tom Lane wrote: > "David G. Johnston" writes: > > The attached log is result of (while in the versioned directory, a > sibling > > of the git repo) > > `../postgresql/configure` > > `make` > > `tree` > > The VPA

Re: Dump/Restore of non-default PKs

2022-04-18 Thread David G. Johnston
On Mon, Apr 18, 2022 at 1:00 PM Simon Riggs wrote: > At the moment you cannot create a unique index other than a btree. (As > discussed on other threads, I am pursuing unique hash indexes for > PostgreSQL, one step at a time). > You get "ERROR index foo_idx is not a btree" > > According to

Did we intend to change whether PUBLIC can create tables in the public schema by default?

2022-05-04 Thread David G. Johnston
Hey, For the following sequence of commands, on a newly initdb v15devel and mostly clean v13 I get a failure and a created table respectively. Showing v15devel: postgres=# create database testdb; CREATE DATABASE postgres=# create role testrole; CREATE ROLE postgres=# \c testdb You are now

Re: Did we intend to change whether PUBLIC can create tables in the public schema by default?

2022-05-04 Thread David G. Johnston
On Wed, May 4, 2022 at 12:42 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > Hey, > > For the following sequence of commands, on a newly initdb v15devel and > mostly clean v13 I get a failure and a created table respectively. > > Apparently I didn't search co

Re: JSON Functions and Operators Docs for v15

2022-05-04 Thread David G. Johnston
On Wed, May 4, 2022 at 8:39 AM Tom Lane wrote: > "David G. Johnston" writes: > > Is there a thread I'm not finding where the upcoming JSON function > > documentation is being made reasonably usable after doubling its size > with > > all the new JSON Table feat

Re: SQL/JSON: FOR ORDINALITY bug

2022-05-04 Thread David G. Johnston
On Wed, May 4, 2022 at 1:09 PM Erik Rijkers wrote: > Op 04-05-2022 om 21:12 schreef Andrew Dunstan: > > > > I don't see how rowseq can be anything but 1. Each invocation of > >> > >> > >> After some further experimentation, I now think you must be right, > David. > >> > >> Also,

Re: Re: fix cost subqueryscan wrong parallel cost

2022-04-28 Thread David G. Johnston
On Thu, Apr 28, 2022 at 9:53 AM Robert Haas wrote: > On Fri, Apr 22, 2022 at 11:55 AM David G. Johnston > wrote: > > On Wed, Apr 20, 2022 at 11:38 PM bu...@sohu.com wrote: > >> > >> > > for now fuction cost_subqueryscan always using *total* rows

Re: Assorted small doc patches

2022-04-29 Thread David G. Johnston
Updated status of the set. On Wed, Apr 20, 2022 at 5:59 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > > v0001-database-default-name (-bugs, with a related cleanup suggestion as > well) > > https://www.postgresql.org/message-id/flat/CAKFQuwZvHH1HVSOu

Re: fix cost subqueryscan wrong parallel cost

2022-04-29 Thread David G. Johnston
On Fri, Apr 29, 2022 at 7:02 AM Tom Lane wrote: > Richard Guo writes: > > Currently subquery scan is using rel->rows (if no parameterization), > > which I believe is not correct. That's not the size the subquery scan > > node in each worker needs to handle, as the rows have been divided > >

Re: fix cost subqueryscan wrong parallel cost

2022-04-29 Thread David G. Johnston
On Fri, Apr 29, 2022 at 11:09 AM Tom Lane wrote: > > In short, these SubqueryScans are being labeled as producing 6 rows > when their input only produces 25000 rows, which is surely insane. > > So: even though the SubqueryScan itself isn't parallel-aware, the number > of rows it processes

Re: strange slow query - lost lot of time somewhere

2022-05-02 Thread David G. Johnston
On Mon, May 2, 2022 at 7:13 PM David Rowley wrote: > On Tue, 3 May 2022 at 11:02, Tom Lane wrote: > > > > David Rowley writes: > > > On Mon, 2 May 2022 at 21:00, Pavel Stehule > wrote: > > >> I found a query that is significantly slower with more memory > > > > > If it was work_mem you

Re: strange slow query - lost lot of time somewhere

2022-05-02 Thread David G. Johnston
On Mon, May 2, 2022 at 7:30 PM David Rowley wrote: > On Tue, 3 May 2022 at 13:43, David G. Johnston > wrote: > > hit_ratio = (est_entries / ndistinct) - (ndistinct / calls) || clamp to > 0.0 > > I don't understand the adjustment factor ndistinct/calls > > I've attache

Re: strange slow query - lost lot of time somewhere

2022-05-02 Thread David G. Johnston
On Mon, May 2, 2022 at 4:02 PM Tom Lane wrote: > David Rowley writes: > > On Mon, 2 May 2022 at 21:00, Pavel Stehule > wrote: > >> I found a query that is significantly slower with more memory > > > If it was work_mem you increased, it seems strange that the plan would > > switch over to using

Re: SQL/JSON: FOR ORDINALITY bug

2022-05-03 Thread David G. Johnston
On Tue, May 3, 2022 at 5:27 PM Andrew Dunstan wrote: > > On 2022-05-03 Tu 11:19, Erik Rijkers wrote: > > Hi > > > > I've copied some statements from the .pdf called: > > "TECHNICAL REPORT ISO/IEC TR 19075-6 First edition 2017-03 > > Part SQL Notation support 6: (JSON) for JavaScript Object" >

Re: SQL/JSON: FOR ORDINALITY bug

2022-05-04 Thread David G. Johnston
On Wed, May 4, 2022 at 1:43 PM David G. Johnston wrote: > On Wed, May 4, 2022 at 1:09 PM Erik Rijkers wrote: > >> Op 04-05-2022 om 21:12 schreef Andrew Dunstan: >> > >> >>>> >> >>>> I don't see how rowseq can be anything but 1.

JSON Functions and Operators Docs for v15

2022-05-04 Thread David G. Johnston
Hey, Is there a thread I'm not finding where the upcoming JSON function documentation is being made reasonably usable after doubling its size with all the new JSON Table features that we've added? If nothing else, the table of contents at the top of the page needs to be greatly expanded to make

Re: strange slow query - lost lot of time somewhere

2022-05-05 Thread David G. Johnston
On Mon, May 2, 2022 at 10:02 PM Pavel Stehule wrote: > > > út 3. 5. 2022 v 6:57 odesílatel Tom Lane napsal: > >> Pavel Stehule writes: >> > there is really something strange (see attached file). Looks so this >> issue >> > is much more related to planning time than execution time >> >> You

Re: Question about "compound" queries.

2022-10-24 Thread David G. Johnston
On Mon, Oct 24, 2022 at 3:02 PM Anton A. Melnikov wrote: > Hello! > > Please, could somebody explain what the "compound" queries were created > for? > Maybe i'm calling them wrong. It's about queries like: > SELECT 1 + 2 \; SELECT 2.0 AS "float" \; SELECT 1; > > Such queries can neither be

Re: confused with name in the pic

2022-10-26 Thread David G. Johnston
On Wed, Oct 26, 2022 at 2:13 AM jack...@gmail.com wrote: > typedef struct A_Expr > > > > { > > > > pg_node_attr(custom_read_write) > > > > NodeTag type; > > > > A_Expr_Kind kind; /* see above */ > > > > List *name; /* possibly-qualified name of

Role Graph Viewing in Core (psql: \drr \dru \drg, system view: pg_role_graph, pg_role_relationship)

2022-09-12 Thread David G. Johnston
Hi, While looking at Robert's work to improve our handling of roles I found it helpful to be able to see not only the directly recorded membership information, which now includes grantor, but also to see what was reachable via SET ROLE. The attached patch puts that information at our users'

Re: pg_basebackup --create-slot-if-not-exists?

2022-09-21 Thread David G. Johnston
On Wednesday, September 21, 2022, Ashwin Agrawal wrote: > Currently, pg_basebackup has > --create-slot option to create slot if not already exists or > --slot to use existing slot > > Which means it needs knowledge on if the slot with the given name already > exists or not before invoking the

Re: use has_privs_of_role() for pg_hba.conf

2022-10-08 Thread David G. Johnston
On Sat, Oct 8, 2022 at 8:47 AM Robert Haas wrote: > On Sat, Oct 8, 2022 at 11:14 AM Tom Lane wrote: > > Joe Conway writes: > > > Thanks -- looks good to me. If there are no other comments or concerns, > > > I will commit/push by the end of the weekend. > > > > Robert seems to think that this

Re: doc: New cumulative stats subsystem obsoletes comment in maintenance.sgml

2022-08-12 Thread David G. Johnston
On Fri, Aug 12, 2022 at 12:48 PM Bruce Momjian wrote: > On Mon, Jul 18, 2022 at 08:04:12PM -0700, Andres Freund wrote: > > Hi, > > > > On 2022-07-18 19:47:39 -0700, David G. Johnston wrote: > > > On Thu, Jul 14, 2022 at 4:31 PM Andres Freund > wrote: > &g

Re: pg_auth_members.grantor is bunk

2022-07-31 Thread David G. Johnston
On Sun, Jul 31, 2022 at 11:18 AM Stephen Frost wrote: > Greetings, > > * Robert Haas (robertmh...@gmail.com) wrote: > > On Tue, Jul 26, 2022 at 12:46 PM Robert Haas > wrote: > > + } > + > + /* > +* Disallow attempts to grant ADMIN OPTION back to a user who > granted it > +

Re: Triggers should work in isolation, with a final conflict detection step

2022-08-01 Thread David G. Johnston
On Sunday, July 31, 2022, Gianluca Calcagni wrote: > > The real drawback is that such approach is forgoing the natural principle > of *"separation of concerns"*! I have been looking into using trigger > frameworks to solve this problem, but there is no trigger framework that is > able to meet my

Re: doc: Fix description of how the default user name is chosen

2022-11-01 Thread David G. Johnston
hing. +user name. David J. On Mon, Oct 31, 2022 at 6:41 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 09.07.22 17:52, David G. Johnston wrote: > > No. It is always the user parameter. It just so happens that parameter &g

Glossary and initdb definition work for "superuser" and database/cluster

2022-11-01 Thread David G. Johnston
Hey, Recent threads have pointed out some long-standing doc language in initdb that could be made more precise, especially in light of the relatively recent addition of a glossary. Toward this end I'm attaching a patch that defines three terms: "bootstrap superuser", "database superuser" and

Re: Glossary and initdb definition work for "superuser" and database/cluster

2022-11-01 Thread David G. Johnston
On Tue, Nov 1, 2022 at 5:20 PM Justin Pryzby wrote: > On Tue, Nov 01, 2022 at 03:47:15PM -0700, David G. Johnston wrote: > > > I think this is wrong: > > | https://www.postgresql.org/docs/devel/app-initdb.html > | -U username > | --username=username > | &g

Re: Resolve UNKNOWN type to relevant type instead of text type while bulk update using values

2023-01-04 Thread David G. Johnston
Please don’t top-post On Wednesday, January 4, 2023, Sayyid Ali Sajjad Rizavi wrote: > Breaking working queries for this is not acceptable. > > > Good point, let's exclude Option 2. > > >> This happens when possible so any remaining cases are not possible. Or, >> at least apparently not worth

Re: Resolve UNKNOWN type to relevant type instead of text type while bulk update using values

2023-01-04 Thread David G. Johnston
On Wednesday, January 4, 2023, Sayyid Ali Sajjad Rizavi wrote: > > > *Option 1:* Cast to the relevant column type in that position (to > `integer` in this case), whenever we have an unknown type. > This happens when possible so any remaining cases are not possible. Or, at least apparently not

Re: Named Operators

2023-01-12 Thread David G. Johnston
On Thu, Jan 12, 2023 at 3:59 AM Gurjeet Singh wrote: > On Thu, Jan 12, 2023 at 1:49 AM Matthias van de Meent > wrote: > > > I'm -1 on the chosen syntax; :name: shadows common variable > > substitution patterns including those of psql. > > I'll consider using one of the other special characters.

Re: pgsql: Add new GUC createrole_self_grant.

2023-01-12 Thread David G. Johnston
On Thu, Jan 12, 2023 at 8:11 AM Robert Haas wrote: > On Wed, Jan 11, 2023 at 7:53 PM David G. Johnston > wrote: > > Justed wanted to chime in and say Robert has eloquently put into words > much of what I have been thinking here, and that I concur that guiding the &g

Re: Named Operators

2023-01-12 Thread David G. Johnston
On Thu, Jan 12, 2023 at 10:14 AM Tom Lane wrote: > Isaac Morland writes: > > What about backticks (`)? They are allowed as operator characters but do > > not otherwise appear in the lexical syntax as far as I can tell: > > https://www.postgresql.org/docs/current/sql-syntax-lexical.html > >

Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode

2023-01-11 Thread David G. Johnston
On Wed, Jan 11, 2023 at 2:39 PM Andres Freund wrote: > Hi, > > On 2023-01-11 16:18:34 -0500, Tom Lane wrote: > > Peter Geoghegan writes: > > > On Wed, Jan 11, 2023 at 11:18 AM Andres Freund > wrote: > > >> I don't like that - it's also quite useful to disable use of > ringbuffers when > > >>

Re: pgsql: Add new GUC createrole_self_grant.

2023-01-11 Thread David G. Johnston
On Wed, Jan 11, 2023 at 2:16 PM Robert Haas wrote: > On Wed, Jan 11, 2023 at 4:00 PM Tom Lane wrote: > > Robert Haas writes: > > > If you want to make safe a SECURITY DEFINER function written using sql > > > or plpgsql, you either have to schema-qualify every single reference > > > or, more

Re: Optimize common expressions in projection evaluation

2022-12-04 Thread David G. Johnston
On Sun, Dec 4, 2022 at 9:00 PM Peifeng Qiu wrote: > > the need for this code seems not that great. But as to the code itself > I'm unable to properly judge. > A simplified version of my use case is like this: > CREATE FOREIGN TABLE ft(rawdata json); > INSERT INTO tbl SELECT

Re: Optimize common expressions in projection evaluation

2022-12-04 Thread David G. Johnston
On Sun, Dec 4, 2022 at 9:37 PM Pavel Stehule wrote: > > po 5. 12. 2022 v 5:28 odesílatel Tom Lane napsal: > >> Peifeng Qiu writes: >> >> the need for this code seems not that great. But as to the code >> itself I'm unable to properly judge. >> >> I mention this because trying to

Re: New docs chapter on Transaction Management and related changes

2022-11-30 Thread David G. Johnston
On Wed, Nov 30, 2022 at 8:02 AM Bruce Momjian wrote: > On Wed, Nov 30, 2022 at 07:10:35AM -0700, David G. Johnston wrote: > > On Wed, Nov 30, 2022 at 6:52 AM Bruce Momjian wrote: > > I'd maybe accept having it back-patched to v15 on that basis but not any > > further

Re: [DOCS] Stats views and functions not in order?

2022-12-07 Thread David G. Johnston
On Tue, Dec 6, 2022 at 7:57 PM David G. Johnston wrote: > On Tue, Dec 6, 2022 at 6:36 PM Peter Smith wrote: > >> I'd like to "fix" this but IIUC there is no consensus yet about what >> order is best for patch 0001, right? >> >> > I'm planning o

Re: Error-safe user functions

2022-12-07 Thread David G. Johnston
On Wed, Dec 7, 2022 at 10:34 AM Andres Freund wrote: > > +{ oid => '8053', > > + descr => 'get error message if string is not valid input for data > type', > > + proname => 'pg_input_invalid_message', provolatile => 's', > > + prorettype => 'text', proargtypes => 'text regtype int4', > > +

Re: Error-safe user functions

2022-12-07 Thread David G. Johnston
On Wed, Dec 7, 2022 at 9:59 AM Tom Lane wrote: > "David G. Johnston" writes: > > > Are you suggesting we should not go down the path that v8-0003 does in > the > > monitoring section cleanup thread? I find the usability of Chapter 54 > > System Views to be

Re: ANY_VALUE aggregate

2022-12-07 Thread David G. Johnston
On Wed, Dec 7, 2022 at 10:00 PM Vik Fearing wrote: > On 12/7/22 04:22, David G. Johnston wrote: > > On Mon, Dec 5, 2022 at 10:40 PM Vik Fearing > wrote: > > > >> On 12/6/22 05:57, David G. Johnston wrote: > >>> On Mon, Dec 5, 2022 at 9:48 PM Vik Fearing

<    3   4   5   6   7   8   9   10   11   >