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: 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: pg_advisory_unlock(null)

2022-07-15 Thread David G. Johnston
On Thu, Jul 14, 2022 at 6:36 AM PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/12/functions-admin.html > Description: > > Hello! > There is no information in documentation about pg_advisory_unlock with

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 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

Re: CREATE TABLE AS, section IF NOT EXISTS should clarify what happens to the data

2022-07-14 Thread David G. Johnston
On Thu, Jul 14, 2022 at 6:08 PM Bruce Momjian wrote: > On Wed, Feb 9, 2022 at 01:02:51PM +, PG Doc comments form wrote: > > The following documentation comment has been logged on the website: > > > > Page: https://www.postgresql.org/docs/14/sql-createtableas.html > > Description: > > > > If

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: Clarify the ordering guarantees in combining queries (or lack thereof)

2022-07-14 Thread David G. Johnston
On Thursday, July 14, 2022, Shay Rojansky wrote: > > If there's a guarantee that UNION ALL preserves ordering - as Tom seems to > indicate in the thread quoted above - then the above works. If there's no > such guarantee, then AFAIK the above can't be rewritten; putting the ORDER > BY outside -

Re: Seems to be impossible to set a NULL search_path

2022-07-13 Thread David G. Johnston
On Wed, Jul 13, 2022 at 10:02 PM Bryn Llewellyn wrote: > > > > * The owner name | The *identifier* for the owner > name +- Joe > | "Joe"* > > This is what I've been banging on about all the time. It seems that I'm > the only person in the

Re: Seems to be impossible to set a NULL search_path

2022-07-13 Thread David G. Johnston
On Wed, Jul 13, 2022 at 4:33 PM Bryn Llewellyn wrote: > > > > > > * role_name - Bllewell Exotic Me "Exotic Me" "Bllewell"* > > Of course I understand why I see both Exotic Me with no quotes and "Exotic > Me" with double quotes: I asked for it. But why do I see both Bllewell with >

Re: Clarify the ordering guarantees in combining queries (or lack thereof)

2022-07-13 Thread David G. Johnston
On Wed, Jul 13, 2022 at 5:08 PM Shay Rojansky wrote: > Greetings. > > I was trying to understand what - if any - are the guarantees with regards > to ordering for combining queries (UNION/UNION ALL/...). From this > message[1], it seems that UNION ALL does preserve the ordering of the > operand

Re: Issues with upserts

2022-07-13 Thread David G. Johnston
On Wed, Jul 13, 2022 at 7:58 AM André Hänsel wrote: > > SELECT last_value FROM t_id_seq; > > > > This will yield “8”, showing that new sequence numbers have been generated > for each attempt. > Yep, an entire able-to-be-inserted tuple is formed every time. That requires evaluating defaults so

Re: Issues with upserts

2022-07-13 Thread David G. Johnston
On Wednesday, July 13, 2022, André Hänsel wrote: > The wiki entry https://wiki.postgresql.org/wiki/UPSERT kind of suggests > that with the introduction of ON CONFLICT DO UPDATE the problem of upserts > is solved. But is it? > > > > A common use case for upserts is to keep a table up to date from

Re: "Getting Started" guide is missing a critical step?

2022-07-12 Thread David G. Johnston
On Tuesday, July 12, 2022, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/14/tutorial-createdb.html > Description: > > Hello, > > I'm new to postgres so following through the steps in "Chapter 1. Getting

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

2022-07-09 Thread David G. Johnston
On Sat, Jul 9, 2022, 08:16 Bruce Momjian wrote: > On Sat, Jul 9, 2022 at 08:06:21AM -0700, David G. Johnston wrote: > > Maybe invoke the wording from the libpq docs and say: > > > > The default database name is the same as the user connection parameter. > > > >

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

2022-07-09 Thread David G. Johnston
On Friday, July 8, 2022, Bruce Momjian wrote: > On Fri, Jul 8, 2022 at 10:17:11PM -0400, Tom Lane wrote: > > Bruce Momjian writes: > > > On Tue, Jul 5, 2022 at 08:20:25PM -0400, Tom Lane wrote: > > >> I agree this phrasing needs some work, but "resolved" doesn't seem > > >> helpful, since

Re: range with infinity bound data type disallow extra empty white space.

2022-07-09 Thread David G. Johnston
On Friday, July 8, 2022, jian he wrote: > Hi, there. > > Not sure this is a bug, or intentional. > select '[1, )'::int8range; --fail. > select '[1,)'::int8range; --ok. > > tested on pg14.4, pg15.1 > > It is documented so I’d say intentional. “Whitespace is allowed before and after the

Re: Seems to be impossible to set a NULL search_path

2022-07-06 Thread David G. Johnston
On Wed, Jul 6, 2022 at 1:47 PM Bryn Llewellyn wrote: > > It seems that the wording is wrong here: > > « The value for search_path must be a comma-separated list of schema > names. » > > It's schema identifiers—and not schema names. Yes? > > To add further clarity (or confusion) there is also

Re: Seems to be impossible to set a NULL search_path

2022-07-06 Thread David G. Johnston
On Wed, Jul 6, 2022 at 1:13 PM Bryn Llewellyn wrote: > *david.g.johns...@gmail.com wrote:* > > At the level of discussion you want to have when you encounter unfamiliar > syntax please read the syntax chapter for the related concept (expression > identifiers). > > >

Re: Seems to be impossible to set a NULL search_path

2022-07-06 Thread David G. Johnston
On Wed, Jul 6, 2022 at 11:50 AM Bryn Llewellyn wrote: > > It succeeded. And the \d metacommand showed me that I now have a table > pg_temp_3.x. Using a different database, it ends up in "pg_temp_1. What's > going on here? Is "pg_temp" a kind of generic nickname for ANY "pg_temp_N"? > > I hate to

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: Seems to be impossible to set a NULL search_path

2022-07-06 Thread David G. Johnston
On Wed, Jul 6, 2022 at 10:03 AM Christophe Pettus wrote: > > > > On Jul 6, 2022, at 09:48, Bryn Llewellyn wrote: > > Neither causes an error. The "show", in each case, prints the bare value > with no quotes. It never struck me try try double quotes around the > timezone argument. I'm shocked

Re: Seems to be impossible to set a NULL search_path

2022-07-06 Thread David G. Johnston
On Wed, Jul 6, 2022 at 9:49 AM Bryn Llewellyn wrote: > adrian.kla...@aklaver.com wrote: > > Not sure what your point is? > > > Try these two: > > > > > > > *set timezone = 'America/New_York';show timezone;set timezone = > "America/New_York";show timezone;* > Neither causes an error. The "show",

Re: Seems to be impossible to set a NULL search_path

2022-07-06 Thread David G. Johnston
On Tue, Jul 5, 2022 at 11:12 AM Bryn Llewellyn wrote: > The section "Writing SECURITY DEFINER Functions Safely": > > > https://www.postgresql.org/docs/current/sql-createfunction.html#id-1.9.3.67.10.2 > > explains the risk brought if a bad actor creates an object that preemps > what the developer

Re: Seems to be impossible to set a NULL search_path

2022-07-05 Thread David G. Johnston
On Tue, Jul 5, 2022 at 12:13 PM Tom Lane wrote: > Bryn Llewellyn writes: > > Thanks, all, for your replies. I'd assumed that the arguments of "set > search_path" had to be SQL names. so I tried "". But that caused an error. > I didn't try the ordinary empty string because I'd assumed that, as

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

2022-07-05 Thread David G. Johnston
On Tue, Jul 5, 2022 at 5:20 PM Tom Lane wrote: > "David G. Johnston" writes: > > In passing, the authentication error examples use the phrase > > "database user name" in a couple of locations. The word > > database in b

Re: How to upgrade postgres version 8 to 13

2022-07-05 Thread David G. Johnston
On Tue, Jul 5, 2022 at 11:05 AM Adrian Klaver wrote: > On 7/5/22 10:56 AM, shashidhar Reddy wrote: > > Down time 10 to 15 hrs > > Hardware specs are also not sure for now as it is client machine. > > This is going to be a difficult task for the following reasons: > > In other words there is

Re: Getting data from a record variable dynamically

2022-07-04 Thread David G. Johnston
On Mon, Jul 4, 2022 at 4:03 PM Rhys A.D. Stewart wrote: > > I have a trigger that is attached to several different tables. In the > trigger function I retrieve a single row and I want the info from a > specific column. This column is dependent on the table in question. > > The only workaround I

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

2022-07-01 Thread David G. Johnston
On Fri, Jul 1, 2022 at 7:58 AM Peter Geoghegan wrote: > On Fri, Jul 1, 2022 at 6:01 AM Robert Haas wrote: > > What would probably help more is adding something like this to the > > error message: > > > > HINT: column "b" could refer to any of these relations: "foo", "excluded" > > > > That

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

2022-06-30 Thread David G. Johnston
On Thu, Jun 30, 2022 at 2:31 PM Peter Geoghegan wrote: > On Thu, Jun 30, 2022 at 2:07 PM David G. Johnston > wrote: > > Current: > > "The SET and WHERE clauses in ON CONFLICT DO UPDATE have access to the > > existing row using the table's name (or an a

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: Fatel: unsupported frientend protocol error

2022-06-30 Thread David G. Johnston
On Thursday, June 30, 2022, Laurenz Albe wrote: > On Thu, 2022-06-30 at 16:40 +0530, eswar reddy wrote: > > Hi sir, I am getting below error for the past 3 month's plz can suggest > how to resolve this issue. > > > > PostgreSQL 9.6 version and Linux redhat 7.2 efm 4.1 plz > > > > Fatel:

Re: User's responsibility when using a chain of "immutable" functions?

2022-06-29 Thread David G. Johnston
On Wed, Jun 29, 2022 at 5:03 PM Bryn Llewellyn wrote: > > *Meanwhile. I'll appeal for some pointers to what I should read:* > I *had* understood that the SQL that a user-created subprogram issues (at > least for "language sql" and "language plpgsql") is implicitly prepared. > But I've no idea

Re: User's responsibility when using a chain of "immutable" functions?

2022-06-29 Thread David G. Johnston
On Wednesday, June 29, 2022, Bryn Llewellyn wrote: > > When I drop the first link, f1() in the chain of "immutable" functions, I > see that I cannot invoke f(2) because it now complains that f1() doesn't > exist. This surprises me because, after all, the result of f2() is now > cached (at least

Re: User's responsibility when using a chain of "immutable" functions?

2022-06-28 Thread David G. Johnston
On Tuesday, June 28, 2022, Bryn Llewellyn wrote: > > DISCARD PLANS is unsafe in a multi-user concurrent scenario. The doc says > explicitly that its scope is just the single session. And it's easy to show > the danger by using my testcase manually, step by appropriate step, with > two concurrent

Re: User's responsibility when using a chain of "immutable" functions?

2022-06-28 Thread David G. Johnston
On Tue, Jun 28, 2022 at 7:03 PM Christophe Pettus wrote: > > > > On Jun 28, 2022, at 18:41, Bryn Llewellyn wrote: > > Should I simply understand that when I have such a dynamic dependency > chain of "immutable" functions, and should I drop and re-create the > function at the start of the chain,

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: Differences in Escaped bytea's when creating a plain pg_dump

2022-06-27 Thread David G. Johnston
On Sunday, June 26, 2022, WR wrote: > > I made some test with pgadmin. Pgadmin (5.2) also reports this error now. > And it doesn't matter if standard_conforming_strings is on or off. > > > SET standard_conforming_strings = off; > > INSERT INTO public.oned_figures VALUES (1, 'Figure_Wolle1', 476,

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: Hardening PostgreSQL via (optional) ban on local file system access

2022-06-24 Thread David G. Johnston
On Friday, June 24, 2022, Gurjeet Singh wrote: > On Fri, Jun 24, 2022 at 4:13 PM Andres Freund wrote: > > On 2022-06-25 00:08:13 +0200, Hannu Krosing wrote: > > > > 3) should this be back-patched (we can provide batches for all > > > supported PgSQL versions) > > > > Err, what? > > Translation:

Re: Hardening PostgreSQL via (optional) ban on local file system access

2022-06-24 Thread David G. Johnston
On Fri, Jun 24, 2022 at 4:13 PM Andres Freund wrote: > Hi, > > On 2022-06-25 00:08:13 +0200, Hannu Krosing wrote: > > Currently the file system access is controlled via being a SUPREUSER > > or having the pg_read_server_files, pg_write_server_files and > > pg_execute_server_program roles. The

Re: Hardening PostgreSQL via (optional) ban on local file system access

2022-06-24 Thread David G. Johnston
On Fri, Jun 24, 2022 at 3:08 PM Hannu Krosing wrote: > > 1) would it be enough to just disable WRITING to the filesystem (COPY > ... TO ..., COPY TO ... PROGRAM ...) or are some reading functions > also potentially exploitable or at least making attackers life easier > ? > I would protect read

Re: pg_auth_members.grantor is bunk

2022-06-24 Thread David G. Johnston
On Fri, Jun 24, 2022 at 1:19 PM Robert Haas wrote: > On Mon, Jun 6, 2022 at 7:41 PM Stephen Frost wrote: > > > > In terms of how that's then used, yeah, it's during REVOKE because a > > REVOKE is only able to 'find' role authorization descriptors which match > > the triple of role revoked,

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: 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: 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: doc: Bring mention of unique index forced transaction wait behavior outside of the internal section

2022-06-21 Thread David G. Johnston
On Tue, Jun 21, 2022 at 6:49 AM Aleksander Alekseev < aleksan...@timescale.com> wrote: > Hi David, > > > It's basically a glorified cross-reference. I didn't dislike directing > the reader to the internals section enough to try and establish a better > location for the main content. > > One

Re: doc: array_length produces null instead of 0

2022-06-21 Thread David G. Johnston
On Tue, Jun 21, 2022 at 6:33 AM Aleksander Alekseev < aleksan...@timescale.com> wrote: > Hi David, > > > Per discussion here: > > > > > https://www.postgresql.org/message-id/163636931138.8076.5140809232053731248%40wrigleys.postgresql.org > > > > We can now easily document the array_length

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

Re: Outer joins and NULLs (old subject "ERROR: failed to find conversion function from key_vals_nn to record[]")

2022-06-19 Thread David G. Johnston
On Sun, Jun 19, 2022 at 2:31 PM Bryn Llewellyn wrote: > It would be foolish, therefore, to define the target table for > "insert-select" using "CTAS where false". > SQL is a strongly typed language where the structure of the query output is determined without any consideration of whether said

Re: Index creation

2022-06-19 Thread David G. Johnston
On Sun, Jun 19, 2022 at 12:06 PM Дмитрий Иванов wrote: > Good afternoon. > I have a query parser question. If there are two kinds of queries using an > indexed field. In this case, one view is limited to this field, the second > one uses a number of fields included in the index by the include

Re: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-16 Thread David G. Johnston
On Thu, Jun 16, 2022 at 8:28 PM Bryn Llewellyn wrote: > > *Back to NULLs...* > > Your code examples ran without error and produced the results that you > described. I do understand the fact that, on its face, the NULLs in the > two cases arise for different reasons. But this (still) seems to me

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: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-16 Thread David G. Johnston
On Wed, Jun 15, 2022 at 11:07 PM Bryn Llewellyn wrote: > This is what the doc promises. But how can you see it as anything but a > bug? The subquery evaluates to "null", and only then is the attempt made to > create a new row which self-evidently violates the domain's constraint. How > is it any

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-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: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-15 Thread David G. Johnston
On Wednesday, June 15, 2022, Bryn Llewellyn wrote: > I’ve copied a self-contained testcase below. Is the error that the "as > intended" test causes due to a known limitation—or even a semantic dilemma > that I'm failing to spot? Or might it be due to a bug? > I read the note in create domain as

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: Missed query planner optimization: `n in (select q)` -> `n in (q)`

2022-06-12 Thread David G. Johnston
On Sun, Jun 12, 2022 at 2:47 PM Josh wrote: > > This was only possible because I was dealing with arrays though, and an > operation such as `in (select unnest...)` can be easily converted to `= > any(...)`. However for the general case, In the general case you don't have subqueries inside join

Re: COPY FROM

2022-06-10 Thread David G. Johnston
On Fri, Jun 10, 2022 at 3:40 AM PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/14/sql-copy.html > Description: > > When copying a csv file into a table, ifthere is a string missing a double > quote in

Re: How to get response message

2022-06-10 Thread David G. Johnston
On Fri, Jun 10, 2022 at 9:38 AM Rama Krishnan wrote: > I am want to delete old records using function so my senior has function > like below but I want to get response of this particular inside query > wheter it is successful or failure > If it doesn't error, it was successful. That is

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

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

Re: correction

2022-06-09 Thread David G. Johnston
On Tue, Jun 7, 2022 at 5:26 PM Bruce Momjian wrote: > On Tue, Jun 7, 2022 at 08:00:16PM -0400, Tom Lane wrote: > > Bruce Momjian writes: > > > +not occur at certain isolation levels; > higher > > > > The docs toolchain is not gonna like that. > > You are correct. I should have tested,

Re: Row level security insert policy does not validate update new values/content?

2022-06-09 Thread David G. Johnston
On Tue, May 17, 2022 at 4:57 AM alias wrote: > > My thought process: > >> update = delete + insert. >> so * create policy emp_upd on emp for update to public using (true); *should >> be ok for updating every row, let insert policy handle new row >> *. * >> since there is only one

Re: cast to domain with default collation issue.

2022-06-09 Thread David G. Johnston
On Tue, May 24, 2022 at 7:42 AM Tom Lane wrote: > I wrote: > > Perhaps this should be documented more clearly, but it's not obviously > > wrong. If the domain declaration doesn't include an explicit COLLATE > > then casting to the domain doesn't create an explicit collation > > requirement.

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

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: 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: 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

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 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

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.

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.

Re: correction

2022-06-07 Thread David G. Johnston
On Tue, Jun 7, 2022 at 4:51 PM Bruce Momjian wrote: > On Tue, Jun 7, 2022 at 02:40:41PM -0700, David G. Johnston wrote: > > On Tue, Jun 7, 2022 at 2:07 PM Bruce Momjian wrote: > > > > > > > > How is this, attached? > > > > > > > >

Re: correction

2022-06-07 Thread David G. Johnston
On Tue, Jun 7, 2022 at 2:07 PM Bruce Momjian wrote: > > > How is this, attached? > > Works for me. Capital "S" in Standard as a proper name? (mind grepping this to see how consistent we are one way or the other, I'm not setup for that at the moment) David J.

Re: Mention RETURNING ... INTO target

2022-06-07 Thread David G. Johnston
n Tue, Jun 7, 2022 at 1:30 PM PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/14/sql-insert.html > Description: > > It looks like INSERT INTO ... RETURNING allows defining a target for the > returned

Re: Why password authentication failed for user "postgres"?

2022-06-05 Thread David G. Johnston
On Sun, Jun 5, 2022 at 4:06 PM Frank Finner wrote: > If you use -U with psql, the connection must not try to use method "peer" > (which means "use the system user with this name", but also means "You must > be logged in with the system user corresponding to the postgresql user"), > but some kind

Re: Window function?

2022-06-04 Thread David G. Johnston
On Sat, Jun 4, 2022 at 7:50 AM Tom Lane wrote: > Robert Stanford writes: > > Can anyone suggest an elegant way to coalesce consecutive rows so only > the > > first start time and last end time for each group of events (by input) is > > returned. > > Window functions don't change the number of

Re: '{"x": 42, "y": null}'::jsonb != '{"x": 42}'::jsonb ... Really?

2022-06-03 Thread David G. Johnston
On Fri, Jun 3, 2022 at 6:41 PM Bryn Llewellyn wrote: > > > > > *declare j1 constant jsonb not null := '{"x": 42, "y": > null}'; j2 constant jsonb not null := '{"x": 42 }';* > > *(j1->>'y' is null) * > This produces a JSON Null which when asked for as a text

Re: pg_stat_database view column xact_commit description should be more descriptive?

2022-06-03 Thread David G. Johnston
On Thursday, June 2, 2022, jian he wrote: > > https://www.postgresql.org/docs/current/monitoring-stats. > html#MONITORING-PG-STAT-DATABASE-VIEW > >> xact_commit bigint >> >> Number of transactions in this database that have been committed >> > In

Re: Assorted small doc patches

2022-06-01 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

Re: Assorted small doc patches

2022-05-31 Thread David G. Johnston
ipped even with the couple of bad bugs being worked on. Thank you! David J. On Fri, Apr 29, 2022 at 6:52 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > Updated status of the set. > > On Wed, Apr 20, 2022 at 5:59 PM David G. Johnston < > david.g.johns...@gmail.com

REINDEXdb performance degrading gradually PG13.4

2022-05-31 Thread David G. Johnston
On Tuesday, May 31, 2022, Praneel Devisetty wrote: > > Initially it was processing 1000 tables per minute. Performance is >> gradually dropping and now after 24 hr it was processing 90 tables per >> minute. >> > That seems like a fairly problematic metric given the general vast disparities in

Re: CREATE EXTENSION not adding extension on second SCHEMA

2022-05-31 Thread David G. Johnston
On Tuesday, May 31, 2022, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/14/sql-createextension.html > Description: > > I'm trying to add an extension to two schemas that I have in my DB. > > steps: > >

Re: postgres and initdb not working inside docker

2022-05-28 Thread David G. Johnston
On Sat, May 28, 2022 at 9:35 AM Roffild wrote: > Docker is now the DevOps standard. It's easier to build an image for > Docker and run the site with one command. > > But the volume mount has a limitation with chmod 755. I don't want to > write the database directly to the container. > > The

Re: Determine if range list contains specified integer

2022-05-27 Thread David G. Johnston
On Fri, May 27, 2022 at 9:19 AM Andrus wrote: > Product type table contains product types. Some ids may missing : > > > create table artliik (liiginrlki char(3) primary key); > As an aside, don't use the "character" data type:

Re: existing row not found by SELECT ... WHERE CTID = ?

2022-05-26 Thread David G. Johnston
On Thursday, May 26, 2022, Matthias Apitz wrote: > > Is there any way to get with the old CTID to the row, for example with > the old CTID to the new one which the row now has after the update of the > row? > > No, there is no link between old and new in the main table. David J.

Re: Automatic PK values not added to new rows

2022-05-25 Thread David G. Johnston
On Wednesday, May 25, 2022, Rich Shepard wrote: > > I'm trying to insert 15 new rows to that table by inserting all columns > except the first one.. That… > > person_nbr 683 is not in any row to be inserted. Implies that. > > I was under the impression that the person_nbr for the new

Re: "Join Postgres on Slack" ?

2022-05-25 Thread David G. Johnston
On Wednesday, May 25, 2022, Bryn Llewellyn wrote: > Forgive me if this is the wrong address. > > I went to https://postgresteam.slack.com/join/signup but found that my > email address has an unknown domain. It says "Don’t have an email address > from one of those domains? Contact the workspace

Re: Connect to specific cluster on command line

2022-05-25 Thread David G. Johnston
On Wednesday, May 25, 2022, Carsten Klein wrote: > > >> pg_lsclusters is not part of core Postgres, and neither is this >> --cluster option you mention. I'm vaguely aware that some packager >> (Debian I think) has added an overlay of that sort; but you'd need >> to consult the package-level

Re: connect permission based on database name

2022-05-25 Thread David G. Johnston
On Wednesday, May 25, 2022, Rob Sargent wrote: > On 5/25/22 08:20, Tom Lane wrote: > > Rob Sargent writes: > > Just wondering if I've bumped into some security issue. > I'm somewhat surprised that "grant connect to database to > " appears to be stored "by name"? > > I think you are

Re: Invalid memory alloc request size for repeat()

2022-05-25 Thread David G. Johnston
On Wednesday, May 25, 2022, Japin Li wrote: > > Hi, > > Today, I try to use repeat() to generate 1GB text, and it occurs invalid > memory > alloc request size [1]. It is a limit from palloc(), then I try to reduce > it, > it still complains out of memory which comes from enlargeStringInfo() >

Re: cast to domain with default collation issue.

2022-05-25 Thread David G. Johnston
On Wednesday, May 25, 2022, jian he wrote: > > I personally feel wording *non-default* may not be that correct. Because > if the column is text then it automatically at least has default collation. > Non-default means “a value that is not the default value”. David J.

Re: cast to domain with default collation issue.

2022-05-25 Thread David G. Johnston
Please don’t top-post. On Tuesday, May 24, 2022, jian he wrote: > > Otherwise, all input expressions must have the same implicit collation >> derivation or the default collation. If any non-default collation is >> present, that is the result of the collation combination. Otherwise, the >>

Re: cast to domain with default collation issue.

2022-05-23 Thread David G. Johnston
On Monday, May 23, 2022, jian he wrote: > CREATE DOMAIN testdomain AS text; > > --asume the default collation is as per show LC_COLLATE; > > – on my pc, it is C.UTF-8. > > --So the testdomain will be collation "C.UTF-8" > > > => \d collate_test1 > > Table

Re: postgres_fdw has insufficient support for large object

2022-05-22 Thread David G. Johnston
On Sunday, May 22, 2022, Saladin wrote: > > The output i expected: > pg_largeobject_metadata and pg_largeobject in both database A and database > B should have rows.Shouldn't only in database A.So, i can use large object > functions > to operate large_objectin remote table or foreign table. >

Re: Casting a collation in an ORDER BY ... COLLATE

2022-05-21 Thread David G. Johnston
On Sat, May 21, 2022 at 4:38 PM Kip Cole wrote: > I’m trying to cast a string value to a collation name without success. My > suspicion is this isn’t possible > based upon the error message. You cannot cast between a token that interpreted as a literal and one that is interpreted as a name.

Re: check for null value before looking up the hash function

2022-05-21 Thread David G. Johnston
On Sat, May 21, 2022 at 10:04 AM Ranier Vilela wrote: > Em sáb., 21 de mai. de 2022 às 13:13, Tom Lane > escreveu: > >> Ranier Vilela writes: >> > Em sáb., 21 de mai. de 2022 às 12:05, Tomas Vondra < >> > tomas.von...@enterprisedb.com> escreveu: >> >> That's a quite bold claim, and yet you

<    5   6   7   8   9   10   11   12   13   14   >