Re: pg_dump - how to force to show timestamps in client log

2020-11-21 Thread Peter J. Holzer
ess=5 -v -Fd -f "$name.$$" $db 2>&1 | ts > log/"$name".$(isodate).log ts is available here: https://github.com/hjp/simple/tree/master/ts hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h..

Re: Set COLLATE on a session level

2020-12-11 Thread Peter J. Holzer
ion parameter. It is language-specific and therefore user-specific if you have international users. (I acknowledge the potential performance problems, but they are the same with an explicit collation clause). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: System (and DB) upgrade problem., "part 2"

2021-01-18 Thread Peter J. Holzer
ge contains a script pg_upgradecluster which knows about the distribution-specific directory layout. You would normally use that script instead pg_upgrade directly. Maybe the Fedora package has something similar? hp -- _ | Peter J. Holzer| Story must make more sense th

Re: Do we need a way to moderate mailing lists?

2021-01-18 Thread Peter J. Holzer
obably because most MUAs displayed only one message at a time. The first MUA I've seen that displayed an entire thread at once was Gmail. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Char

Re: Do we need a way to moderate mailing lists?

2021-01-18 Thread Peter J. Holzer
re is. My rule od thumb is that it should be short enough to read as part of the message. Of course this is very subjective and may even depend on my mood (Sometimes I find a 20 line SQL query too long, sometimes I'm happy to dig through 200 lines of Perl code ...). It also depends very much on

Re: Do we need a way to moderate mailing lists?

2021-01-18 Thread Peter J. Holzer
d prefer to not get an extra copy directly. (but I can live with that). Of course the mailing list server can't filter mails it never sees. Mutt adds a header to indicate the preferences of the sender, but I think that is only recognized by mutt, so it's not a general solution.

Re: Do we need a way to moderate mailing lists?

2021-01-18 Thread Peter J. Holzer
really an image to show a problem, it can be put on > some server and the link could be posted, like this one showing a PANIC > of a system http://www.unixarea.de/fbsd-panic-20210110.jpg That has the disadvantage of not being archived. hp -- _ | Peter J. Holzer| Story must

Re: ransomware

2021-02-02 Thread Peter J. Holzer
appen pretty quickly on a busy database. The question is: Does that help you? At that point the data is already gone (at least partially), and you can only restore it from backup. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: vacuumdb not letting me connect to db

2021-02-07 Thread Peter J. Holzer
s finished. FInally among those where the performance was acceptable choose the value which was fastest. (Note: If you do this on the same database, subsequent runs will benefit from work already done, so the take the results with a grain of salt). hp -- _ | Peter J. Holzer

Re: SV: Insertion time is very high for inserting data in postgres

2021-02-11 Thread Peter J. Holzer
investigate what went wrong than to blindly make some changes to the code. As a first measure I would at least turn on statement logging and/or pg_stat_statements to see which statements are slow, and then investigate the slow statements further. auto_explain might also be useful

Re: Which partition scheme makes sense for my time based IoT-datagrams?

2021-02-11 Thread Peter J. Holzer
andom sample (if devices report at random times) or empty (if they all report at midnight and it isn't just after midnight). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles

Re: Slow index creation

2021-02-19 Thread Peter J. Holzer
that you can probably afford a few messages, even if each function invocation only takes a few milliseconds. So definitely try that if you need to know where your functions spend their time. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Slow while inserting and retrieval (compared to SQL Server)

2021-02-19 Thread Peter J. Holzer
take this much > time. How much time is "this much time"? Are we talking a few milliseconds here? Less? More? Much more? It's hard to give advice if you don't tell us more than "slower than SQL server". Please be specific. Use actual numbers. hp --

Re: checkpointer and other server processes crashing

2021-02-19 Thread Peter J. Holzer
t did not exist before. Or just more of them. I could imagine that switching from Python/Gunicorn to Go increased the number of queries that could be in-flight at the same time. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | |

Re: checkpointer and other server processes crashing

2021-02-19 Thread Peter J. Holzer
API pretty much guarantuees the existence of a connection pool). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challen

Re: PostgreSQL Replication

2021-02-19 Thread Peter J. Holzer
that's a function of load in general, not the number of applications. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | c

Re: Order by not working

2021-02-19 Thread Peter J. Holzer
ill be able to use it. In reality that doesn't help non-programmers much (it's still a formal language with precise semantics and the computer will do what you say, not what you mean), but makes it harder for programmers. hp -- _ | Peter J. Holzer

Re: Please help to improve SELECT JOIN performance, EXPLAIN ANALYZE attached

2021-02-20 Thread Peter J. Holzer
quite small by default so you might want to increase it. The usual recommendation is to start with 25% of the memory (that would be 16 GB in your case) and then see if it gets better if decrease or increase it. hp -- _ | Peter J. Holzer| Story must make more sense than rea

Re: Please help to improve SELECT JOIN performance, EXPLAIN ANALYZE attached

2021-02-20 Thread Peter J. Holzer
photo, ...) try to cache that in the application. That probably doesn't change very often and doesn't have to be retrieved from the database every time. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.a

Re: Please help to improve SELECT JOIN performance, EXPLAIN ANALYZE attached

2021-02-20 Thread Peter J. Holzer
ave experience with trying this in a real-world workload? (I was never brave enough) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http:

Re: Please help to improve SELECT JOIN performance, EXPLAIN ANALYZE attached

2021-02-21 Thread Peter J. Holzer
On 2021-02-21 10:14:04 -0700, Michael Lewis wrote: > No issues for us. We have used a low sample rate of 1% or so and gotten some > very useful data. Oh, somehow I never noticed the auto_explain.sample_rate parameter in the docs. Good to know. hp -- _ | Peter J. Holzer|

Re: Streaming replication between different OS

2021-02-22 Thread Peter J. Holzer
trings, though, Especially if they are known to cause trouble. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Streaming replication between different OS

2021-02-22 Thread Peter J. Holzer
poken in Germany ("DE"). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Leading comments and client applications

2022-03-25 Thread Peter J. Holzer
foo('x*'); ╔═╗ ║ foo ║ ╟─╢ ║ x* ║ ╚═╝ (1 row) Time: 1.296 ms hjp=> \q So like others I suspect that SQLAlchemy is doing something weird here. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: support for DIN SPEC 91379 encoding

2022-03-27 Thread Peter J. Holzer
might have additional reasons not to be in compliance. I don't > read German unfortunately. It defines minimal character set that IT systems which process personal and company names in the EU must accept. Basically Latin, Greek and Cyrillic letters, digits and some symbols and interpunc

Re: psql -f and PAGER

2022-03-29 Thread Peter J. Holzer
(echo 'select * from pg_class;') < /dev/null psql -f <(echo 'select * from pg_class;') > /dev/null But psql -f <(echo 'select * from pg_class;') does, since both stdin and stdout are a terminal. hp -- _ | Peter J. Holzer|

Re: Select .... where id not in (....) returns 0 incorrectly

2022-04-05 Thread Peter J. Holzer
dexes in Oracle don't store NULL values (bitmap indexes do store NULL values, though - are they still an enterprise feature?). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stros

Re: Resources on modeling ordered hierachies?

2022-04-07 Thread Peter J. Holzer
und that by using float8 or even numeric instead of int. Chances are that there is a free number between you numbers. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "C

Re: Help with large delete

2022-04-16 Thread Peter J. Holzer
is the execution plan? * How long does it take? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Replication with Patroni not working after killing secondary and starting again

2022-04-27 Thread Peter J. Holzer
nformation, so I could be wrong) that you haven't configured a replication slot and you haven't enough WAL segments to last through the downtime naturally. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || |

Re: Replication with Patroni not working after killing secondary and starting again

2022-04-29 Thread Peter J. Holzer
93 EDT [14755] STATEMENT:  START_REPLICATION SLOT > "xyzd3riardb05" 0/700 TIMELINE 18 ... > and after some time such errors stop to appear. So the replication slot is probably created after some time and then replication starts to work. I think that replication slot is managed

Re: External psql editor

2022-05-02 Thread Peter J. Holzer
ties by > installing rlwrap and performing the following command: While rlwrap is useful sometimes, I suggest reading the manual for libedit might be a better option. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: Replication with Patroni not working after killing secondary and starting again

2022-05-04 Thread Peter J. Holzer
On 2022-05-04 10:21:56 +0200, Zb B wrote: > Apparently there is something wrong with my cluster. How to debug i?. > Do I need to configure anything so the replication is synchronous? Does https://patroni.readthedocs.io/en/latest/replication_modes.html help? hp -- _ | P

Re: PLPGSQL - extra column existence in trigger

2022-05-10 Thread Peter J. Holzer
;t you update both at the same time? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: newbie db design question

2022-06-11 Thread Peter J. Holzer
simpler: create table products ( product_id serial primary key, description text, supplier_id integer references supplier ); (You need to create supplier before doing that, of course.) hp PS: I noticed that "products" is plural and "s

ISBN (was: '{"x": 42, "y": null}'::jsonb != '{"x": 42}'::jsonb ... Really?)

2022-06-17 Thread Peter J. Holzer
book. For example, "Mastering PostgreSQL 9.6" has the ISBN 978-1-78355-535-2. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://ww

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

2022-06-17 Thread Peter J. Holzer
│ (∅) ║ ╚═╧══╝ (4 rows) Now, if title actually had a type which didn't include a null value, this wouldn't be possible. Either the database would have to lie (declare the column with a type but store a value which is impossible in

Re:

2022-06-18 Thread Peter J. Holzer
s itself. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Tuning a query with ORDER BY and LIMIT

2022-06-22 Thread Peter J. Holzer
the table. That should be faster since the index contains only 4 of 28 (if I counted correctly) columns and should be quite a bit smaller. It's possible that Oracle does this. But I'm not sure whether you could tell that from the execution plan. hp -- _ | Peter J. Holzer|

Re: Tuning a query with ORDER BY and LIMIT

2022-06-22 Thread Peter J. Holzer
compared to single values. So the you can just jump to the first matching index and then get the next 50 entries. > Is Postgres unable to optimize the query similar to Oracle? Is it possible > this is possible but we are running on too old of a version? PostgreSQL 10 is quite old, so t

Re: Tuning a query with ORDER BY and LIMIT

2022-06-22 Thread Peter J. Holzer
On 2022-06-22 23:48:37 +0200, Peter J. Holzer wrote: > On 2022-06-22 19:39:33 +, Dirschel, Steve wrote: > > Posrgres version 10.11 > > > > Here is the DDL for the index the query is using: > > > > create index workflow_execution_initial_ui_tabs > >

Re: Tuning a query with ORDER BY and LIMIT

2022-06-22 Thread Peter J. Holzer
On 2022-06-23 00:19:19 +0200, Peter J. Holzer wrote: > On 2022-06-22 23:48:37 +0200, Peter J. Holzer wrote: > > The index cannot be used for sorting, since the column used for sorting > > isn't in the first position in the index. > > compared to a single value ^

Re: Tuning a query with ORDER BY and LIMIT

2022-06-25 Thread Peter J. Holzer
On 2022-06-22 23:10:25 -0400, Jeff Janes wrote: > On Wed, Jun 22, 2022 at 6:19 PM Peter J. Holzer wrote: > >That's just how btree indexes work and Oracle will have the same > >limitation. What would be possible is to use an index only scan > >(returning

Re: lifetime of the old CTID

2022-07-06 Thread Peter J. Holzer
t isn't unique it is *not* a key. If your tables don't have a primary key you should seriously rethink the data model. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, &qu

Re: Seems to be impossible to set a NULL search_path

2022-07-08 Thread Peter J. Holzer
is wrong you would have to point at something within the PostgreSQL documentation (ideally an entry in the glossary) or some really wide-spread convention and the absence of a local definition. > Questions show many programmers are confused about the difference. Which might be a hint that no wid

Re: About revoking large number of privileges; And the PUBLIC role.

2022-07-08 Thread Peter J. Holzer
inconvenient if that wasn't possible. Do you have an example on where a grant prevents dropping an object? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Cre

Re: - operator overloading not giving expected result

2022-07-08 Thread Peter J. Holzer
ex: 19).  But in Postgres > the > same query returns result as "19 days". Which PostgreSQL version is this? I get 19 with PostgreSQL 11.16 and 14.0. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@h

Re: postgresql generate ddl returns FK with `()` in it

2022-07-08 Thread Peter J. Holzer
er". (Please include relevant details when you ask a question here - don't expect people to look at a stack overflow question). > How can I fix that `();` issue? Is this documented behavior? My guess is that's a bug in DBeaver. hp --

Re: equivalent thing of mtr in mysql

2022-07-12 Thread Peter J. Holzer
e changes also result in an atomic disk write seems to be both pointless and impossible (that might be many gigabytes of data). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charle

Re: equivalent thing of mtr in mysql

2022-07-12 Thread Peter J. Holzer
On 2022-07-12 13:07:41 -0600, Rob Sargent wrote: > I thought OP was hinting at WAL stuff defn here So did I. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative

Re: Was my question inappropriate for postgres?

2022-07-28 Thread Peter J. Holzer
r to connect to an oracle database that's too old or too new (or you may be able to connect and then get weird errors - BTDT). PostgreSQL is in my experience rather tolerant of client/server mismatches, but I wouldn't be surprised if some stuff wouldn't work if the versions are too diff

Re: Copying records from TABLE_A to TABLE_B (in the same database)

2022-08-02 Thread Peter J. Holzer
r is quite a bit faster that copying into the database (and therefore also copying out AND copying in). hp [1] https://github.com/hjp/dbbench/blob/master/import_pg_comparison/results/akran.2019-12-15/results.png -- _ | Peter J. Holzer| Story must make more sense than re

Re: PostgreSQL 14.4 ERROR: out of memory issues

2022-08-06 Thread Peter J. Holzer
aster, as last time I looked (it's been some time) the optimizer wasn't especially good at handlung DISTINCT FROM (probably because it's so rarely used). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@h

Re: How to choose new master from slaves.?

2022-08-06 Thread Peter J. Holzer
ght. Otherwise: For the same reason I would prefer B, I would prefer the one with the most up-to-date data. But there might be other considerations, e.g. the network connections (bandwidth and delays) between the surviving members and the clients. hp -- _ | Pete

Re: How to choose new master from slaves.?

2022-08-06 Thread Peter J. Holzer
On 2022-08-06 15:06:06 -0500, Ron wrote: > On 8/6/22 03:40, Peter J. Holzer wrote: > > Using sync replication on an unstable link is probably not a good idea. > > Every time the link goes down, A freezes. Is this what you want? > > I had to fight my end users about how to r

Re: index row size 2720 exceeds btree version 4

2022-08-10 Thread Peter J. Holzer
nd an fqdn at most 255 bytes. So without the scan id we are at 285 bytes. maybe a bit more due to overhead. That leaves about 2400 bytes for the scan id. I don't know what a scanid is, but 2000+ bytes for an id seems excessive. hp -- _ | Peter J. Holzer| Story

Re: Can I get the number of results plus the results with a single query?

2022-08-15 Thread Peter J. Holzer
valuated) followed by a very quick count up (while the result is transmitted to the client). Probably not what you want. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Cr

Re: Can I get the number of results plus the results with a single query?

2022-08-16 Thread Peter J. Holzer
seconds, the progress indicator is useless. You are stuffing the whole result into an array and THEN counting the number of elements. So when you get to the count all of the work (except sending the result to the client) is already done, so there is little point in displaying a progress indicator.

Re: Can I get the number of results plus the results with a single query?

2022-08-17 Thread Peter J. Holzer
On 2022-08-16 14:42:48 -0700, Bryn Llewellyn wrote: > hjp-pg...@hjp.at wrote: > The OP wants some kind of progress indicator. To be useful, such > an indicator should be approximately linear in time. I.e. if your [...] > > > I see, Peter. You’d read the OP’s mi

Re: With Recursive / Recursive View question

2022-08-21 Thread Peter J. Holzer
ursive query. That's theoretically possible but I would be surprised if it actually did this. (It didn't in my tests, but my test data set was too small to get it to even use indexes with normal queries). hp -- _ | Peter J. Holzer| Story must make more sense

Re: Support for dates before 4713 BC

2022-08-21 Thread Peter J. Holzer
ed int to an int halves the positive range. But it seems that this is already capped at 2**31 days (5874897 AD), so that wouldn't be a problem here. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp

Re: Support for dates before 4713 BC

2022-08-23 Thread Peter J. Holzer
uncertainty of +/- 50 years? I guess to really store "what do I know about when something happened" you would have to be able to store a number of constraints (like "between year x and y", "at least d years after event e", "between month m and n", etc.)

Re: Setting up a server with previous day data

2022-08-23 Thread Peter J. Holzer
ve your problem. Isn't that what logical replication basically does? I also think I've seen other tools parsing the WAL stream and doing something useful with the results. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: How to make PostreSQL utilities honor home directories?

2022-09-01 Thread Peter J. Holzer
. If I run % sudo -u postgres -H /usr/lib/postgresql/13/bin/psql (which is not a symlink) I get the same behaviour. So it seems that psql changes to its basedir and then can't change back again. And sure enough, strace shows: chdir("/usr/lib/postgresql/13/bin") = 0 chdir("/h

Re: Missing query plan for auto_explain.

2022-09-02 Thread Peter J. Holzer
this affects auto_explain. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: How to make PostreSQL utilities honor home directories?

2022-09-02 Thread Peter J. Holzer
PG-USERNAME localusers rootpostgres Then root can invoke `psql -U postgres ...`, but other users can't. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: How to make PostreSQL utilities honor home directories?

2022-09-02 Thread Peter J. Holzer
On 2022-09-01 20:49:56 -0400, Jeffrey Walton wrote: > On Thu, Sep 1, 2022 at 8:23 PM Peter J. Holzer wrote: > > > > On 2022-09-01 18:16:14 -0400, Tom Lane wrote: > > > Jeffrey Walton writes: > > > > We are having a heck of a time getting PostreSQL utilities to

Re: Query Performance

2022-09-17 Thread Peter J. Holzer
eld4`: I have no idea what this is supposed to do, so it's hard to tell if there is a better way. Using `a` to refer to 3 different things doesn't help either. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.a

Re: Limiting the operations that client-side code can perform upon its database backend's artifacts

2022-09-27 Thread Peter J. Holzer
efense. The database frequently won't be accessible from the open internet (or even the company network) directly. Only a middle tier of application servers running vetted client code will connect directly. Even those servers may not be accessible directly to end users. There may be a layer of proxy s

Re: Limiting the operations that client-side code can perform upon its database backend's artifacts

2022-09-28 Thread Peter J. Holzer
t; users. There may be a layer of proxy servers above them. Each of these > > > layers may implement additional checks, rate limits and monitoring. > > If no one has direct SQL access to the database, then there's no problem with > a > role being able to pg_terminate_backe

Re: Limiting the operations that client-side code can perform upon its database backend's artifacts

2022-09-28 Thread Peter J. Holzer
ons ...) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Limiting the operations that client-side code can perform upon its database backend's artifacts

2022-09-30 Thread Peter J. Holzer
On 2022-09-29 20:24:59 -0700, Bryn Llewellyn wrote: > Paraphrasing Peter, the design of the application's RDBMS backend has to > implement its own notions of roles and privileges as a new layer on top of > whatever the native RDBMS mechanisms provide. Some RDBMSs have native > pri

Re: Limiting the operations that client-side code can perform upon its database backend's artifacts

2022-10-01 Thread Peter J. Holzer
On 2022-09-30 17:59:01 -0700, Bryn Llewellyn wrote: > hjp-pg...@hjp.at wrote: > b...@yugabyte.com wrote: > Paraphrasing Peter, the design of the application's RDBMS backend has > to implement its own notions of roles and privileges as a new layer on

Names of run-time configuration parameters (was: Limiting the operations that client-side code can perform upon its database backend's artifacts)

2022-10-01 Thread Peter J. Holzer
s of course assumes that the behaviour is intentional and not a bug.) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Example code Re: Singleton SELECT inside cursor loop

2022-10-01 Thread Peter J. Holzer
itches to a generic plan if it thinks that the generic plan isn't worse than the specialized plans. If the plan suddenly gets worse after 5 executions, you've probably run into a case where the generic plan is worse although the cost computed by the planner isn't. hp -- _

Re: Names of run-time configuration parameters (was: Limiting the operations that client-side code can perform upon its database backend's artifacts)

2022-10-01 Thread Peter J. Holzer
On 2022-10-01 20:24:21 +0800, Julien Rouhaud wrote: > On Sat, Oct 01, 2022 at 02:05:53PM +0200, Peter J. Holzer wrote: > > On 2022-09-30 17:59:01 -0700, Bryn Llewellyn wrote: > > > set rls.tenant_id=42; > > > > This works because there is a "." in the name.

Re: Exponentiation confusion

2022-10-13 Thread Peter J. Holzer
║ ╟──╢ ║ 0.000100 ║ ╚══╝ (1 row) So the number of decimals by default isn't sufficient to represent 10^-18. You have to explicitely increase it. hp -- _ | Peter J. Holzer| Story must

Re: Explain returns different number of rows

2022-10-22 Thread Peter J. Holzer
imate in the first tuple changes without any actual data change (although the only reason I can think of right now would be an ANALYZE (in another session or by autovacuum)). But the actual rows definitely shouldn't change. hp -- _ | Peter J. Holzer

Re: PostgreSql Service different path

2022-10-24 Thread Peter J. Holzer
nd when I check it says  [doesn't use /home/dmartuser/pgsql/14/data] > > How can I point the service to read the new path ( /home/dmartuser/pgsql/14/ > data )?  Check the systemd configuration file for this service. hp -- _ | Peter J. Holzer| Story must

Re: Index corruption revealed after upgrade to 11.17, could date back to at least 11.12

2022-10-27 Thread Peter J. Holzer
initions the same? (Just trying to rule other other possible error sources.) > I do apologize, but I do not understand the value of doing that select > juggling. I think Allan may have misread your mail. hp -- _ | Peter J. Holzer| Story must make more sens

Re: Index corruption revealed after upgrade to 11.17, could date back to at least 11.12

2022-10-27 Thread Peter J. Holzer
On 2022-10-27 15:07:06 +0300, Kristjan Mustkivi wrote: > On Thu, Oct 27, 2022 at 12:18 PM Peter J. Holzer wrote: > > On 2022-10-27 10:55:31 +0300, Kristjan Mustkivi wrote: > > > We use dockerized postgres. > > > > So that means you aren't just replaci

Re: Index corruption revealed after upgrade to 11.17, could date back to at least 11.12

2022-10-28 Thread Peter J. Holzer
t at that time or does it just issue a notice and continue to rebuild the other indexes? In the latter case it migh be easy to miss a problem. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |--

Re: access method xxx does not exist

2022-10-29 Thread Peter J. Holzer
dex, but why would you?) > I do like this. I add oid in pg_am.dat and pg_proc.dat for my index. > And I add codes in contrib and backend/access/myindex_name, is there > any other places I need to add some infos? What? Why are you doing these things? hp -- _ | Peter J. Ho

Re: "peer" authentication: cannot make "pg_ident.conf" work as I believe that the doc says that it should

2022-10-30 Thread Peter J. Holzer
/s user is > logging > in using their own name as the requested login role. I think that's not quite correct. The -U option affects which user name psql uses to connect to the server. It is psql which defaults to the OS user name in the absence of the -U option (or the PGUSER environment

Re: "peer" authentication: cannot make "pg_ident.conf" work as I believe that the doc says that it should

2022-10-30 Thread Peter J. Holzer
arted: "su mary". > > 2. Then I want to start a session (I use "psql" here an an example) like > this: > "psql -d postgres". > > 3. Then, at the "psql" prompt, I want "select session_user" to show "bob". Set the PGUSER=

Re: "peer" authentication: cannot make "pg_ident.conf" work as I believe that the doc says that it should

2022-10-30 Thread Peter J. Holzer
AICS your test users aren't supposed to be that. > uid=1001(postgres) gid=1001(postgres) groups=1001(postgres),27(sudo),114 > (ssl-cert) And is there a reason for posgres to be in group sudo? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: CASE CLOSED... Re: "peer" authentication: cannot make "pg_ident.conf" work as I believe that the doc says that it should

2022-10-31 Thread Peter J. Holzer
nant:~ 22:46 :-) 1016# su - 'mac$crooge' mac@trintignant:~$ id uid=1002(mac$crooge) gid=1003(mac$crooge) groups=1003(mac$crooge) mac@trintignant:~$ I'm not saying that doing this is a good idea ... hp -- _ | Peter J. Holzer| Sto

Re: Delete a table automatic?

2022-11-01 Thread Peter J. Holzer
t; select * from b; ╔╤═══╤══╗ ║ id │ a │ t ║ ╟┼───┼──╢ ║ 1 │ 1 │ foo1 ║ ║ 2 │ 1 │ foo2 ║ ║ 3 │ 2 │ bar1 ║ ╚╧═══╧══╝ (3 rows) And the data in the table is also unchanged. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: SSL/TLS encryption without

2022-11-01 Thread Peter J. Holzer
nd even those that do need only one key, so it is sufficient that only the server has a certificate. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | h

Re: Putting the O/S user for "local" "peer" authentication in the "postgres" group vs chmod'ing the "pg*.conf" files to be readable by "all"

2022-11-03 Thread Peter J. Holzer
sudo vi /etc/postgresql/14/main/pg_hba.conf > [sudo] password for aklaver: > > which opens pg_hba.conf for editing. Well, yes. Root can edit the file, too. But root can edit anything[1]. hp [1] Except ... lots of stuff, actually. -- _ | Peter J.

Re: copy file from a client app to remote postgres isntance

2022-11-09 Thread Peter J. Holzer
s the latter, your programming language's postgresql library probably has a method for invoking copy. > Has anything changed in the last ten years? Or, is there a > better way to copy file contents in a remote database? COPY is the fastest way to load data. hp -- _

Re: copy file from a client app to remote postgres isntance

2022-11-09 Thread Peter J. Holzer
you use copy_from() you don't have to parse it (but then why use Python at all?) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: copy file from a client app to remote postgres isntance

2022-11-09 Thread Peter J. Holzer
On 2022-11-09 12:57:23 -0600, Ron wrote: > On 11/9/22 10:17, Peter J. Holzer wrote: > > On 2022-11-07 14:40:40 -0600, Ron wrote: > > > On 11/7/22 10:57, Вадим Самохин wrote: > > > I have an application that must copy a local file in csv format to a > > >

Re: Table : Bloat grow high

2022-11-12 Thread Peter J. Holzer
pdates, so again some may be HOT updated and some not. If you are updating the same tupel several times, you may get a few HOT updates first, then a non-HOT update, then HOT updates again. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: Seeking practice recommendation: is there ever a use case to have two or more superusers?

2022-11-18 Thread Peter J. Holzer
an appropriately configured role with > "nosuperuser". One important task that can AFAIK only be performed by superusers is the creation of functions in untrusted languages like plpython3u and plperlu. If your application uses functions in those languages you ne

Lots of read activity on index only scan

2022-11-18 Thread Peter J. Holzer
h sounds reasonable) while the other reads 9995216 buffers (or almost one full buffer per row). Why? The entries should be dense in the index in both cases and since it's an index only scan (and explain says there were 0 heap fetches) I would not expect extra accesses. Where do these buffer reads

Re: Lots of read activity on index only scan

2022-11-18 Thread Peter J. Holzer
On 2022-11-18 15:59:46 -0500, Tom Lane wrote: > "Peter J. Holzer" writes: > > Both do a parallel index only scan. Both perform 0 heap fetches. > > But one reads 27336 buffers (or about 22 bytes per index entry, which > > sounds reasonable) while the other reads

Re: Lots of read activity on index only scan

2022-11-18 Thread Peter J. Holzer
On 2022-11-18 13:09:16 -0800, Peter Geoghegan wrote: > On Fri, Nov 18, 2022 at 12:46 PM Peter J. Holzer wrote: > > Both do a parallel index only scan. Both perform 0 heap fetches. > > But one reads 27336 buffers (or about 22 bytes per index entry, which > > sounds reason

Re: Seeking practice recommendation: is there ever a use case to have two or more superusers?

2022-11-18 Thread Peter J. Holzer
y superusers is > the creation of functions in untrusted languages like plpython3u > and plperlu. If your application uses functions in those languages you > need > a superuser to install or upgrade it. > > > Thanks, Peter. I experimented with the notion of restric

Re: Seeking practice recommendation: is there ever a use case to have two or more superusers?

2022-11-19 Thread Peter J. Holzer
On 2022-11-18 16:21:18 -0600, Ron wrote: > On 11/18/22 16:13, Peter J. Holzer wrote: > > So you can give these credentials to you developers or devops folks > > (whom you trust not attack the system - > > They like to "fix" things without documenting what they

<    1   2   3   4   5   6   7   8   9   10   >