Re: index unique

2021-06-12 Thread Peter J. Holzer
hat index will be used, and it will be used every time you update, insert, or delete a row - by the logical replication system which has to identify the affected row(s) on the secondary system. hp -- _ | Peter J. Holzer| Story must make more sense tha

Re: Notify When Streaming Replication Failover Occurred (slave promoted to master).

2021-06-13 Thread Peter J. Holzer
ny other action. 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: Notify When Streaming Replication Failover Occurred (slave promoted to master).

2021-06-16 Thread Peter J. Holzer
periodically, AFAIK. 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: clear cache in postgresql

2021-06-16 Thread Peter J. Holzer
f a given operation takes 2 seconds 95 % of the time but 30 seconds 5 % of the time that makes for a poor user experience, expecially if its seemingly at random (because it depends on what other users have done recently). So you may want to investigate those cases, too. hp -- _ |

Re: How to hash a large amount of data within Postgres?

2021-06-23 Thread Peter J. Holzer
oose a convenient chunk size (a few MB is probably ok), read the large object in chunks of this size, computing the hash for each. Concatenate all the hashes and compute the hash of that. Add intermediate levels if the the concatenated hashes are still too large to fit in memory. hp --

Re: Psql wants to use IP6 when connecting to self using tcp...

2021-06-23 Thread Peter J. Holzer
IPv6 address (and then add that to pg_hba.conf). If the address isn't in DNS, check your /etc/hosts. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative wri

Re: Psql wants to use IP6 when connecting to self using tcp...

2021-06-24 Thread Peter J. Holzer
name mymachines (wrapped for readability) So glibc first looks in /etc/hosts, then does an MDNS (Avahi) lookup, then asks systemd-resolved, and only then gets around to do a traditional DNS lookup. (And systemd-resolved does do some magic for the local hostname, so that might indeed

Re: Obsolete or dead serverconnections after reboot

2021-08-03 Thread Peter J. Holzer
quot; is a lie. If this is activated, the system isn't shut down, it just hibernates. So the reason you are seeing connections from "before the shutdown" is that there never really was a shutdown. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: pg_restore (fromuser -> touser)

2021-08-03 Thread Peter J. Holzer
also replace e.g. " schema_a5" with " schema_b.". This is easily fixed (just add a backslash), but more importantly, it will replace that string everywhere, regardless of context. This might lead to syntax errors or data corruption. hp --

Re: use fopen unknown resource

2021-08-28 Thread Peter J. Holzer
t I'm going to say it is filename as described > here: The use of PHP suggests that this is a web application. So most likely the user is supposed to upload the file via an HTML form. I would suggest to the OP to learn how to process file uploads in PHP. Once they've figured that out

Re: Can't locate Ora2Pg.pm while executing export_schema.sh

2021-08-31 Thread Peter J. Holzer
hat's a pretty good indication that either the module wasn't installed properly in the first place or that something changed which makes a reinstall highly advisable (e.g. a perl upgrade). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: update non-indexed value is slow if some non-related index/fk are enabled

2021-09-09 Thread Peter J. Holzer
pros and cons to both approaches. Personally, I had less problems with PostgreSQL's approach than with Oracle's. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creati

Re: The tragedy of SQL

2021-09-14 Thread Peter J. Holzer
s semantics that people struggle with. hp PS: COBOL is still in use. -- _ | 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: The tragedy of SQL

2021-09-14 Thread Peter J. Holzer
On 2021-09-14 16:51:39 -0400, Mladen Gogala wrote: > As software engineers, we are very much opposed to poetry, especially > those among us using Perl. When I learned Perl, Perl poetry was a real thing! hp -- _ | Peter J. Holzer| Story must make more sense than r

Re: Azure Postgresql High connection establishment time

2021-09-20 Thread Peter J. Holzer
stance take over hundred milliseconds, so I wouldn't be surprised if that was the culprit. hp PS: a local connection (ident) takes about 3.5 ms on my (not very fast) laptop. -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@h

Re: Re: Timestamp with vs without time zone.

2021-09-21 Thread Peter J. Holzer
So for a date in e.g. 2025 we simply don't know what the timezone offset will be. 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: Re: Timestamp with vs without time zone.

2021-09-21 Thread Peter J. Holzer
mezone" is - how do I put this? - more than just weird. "timestamp without timezone" should be called "local timestamp with unspecified timezone" and "timestamp with timezone" should be called "global timestamp without timezone". However, those aren'

Re: Re: Timestamp with vs without time zone.

2021-09-21 Thread Peter J. Holzer
On 2021-09-21 13:34:21 -0400, Dave Cramer wrote: > On Tue, 21 Sept 2021 at 13:20, Peter J. Holzer wrote: > On 2021-09-21 20:50:44 +1200, Tim Uckun wrote: > > It's just that the phrase "timestamp with time zone" would seem to > > indicate the time

Re: Re: Timestamp with vs without time zone.

2021-09-21 Thread Peter J. Holzer
On 2021-09-21 13:43:46 -0400, Dave Cramer wrote: > > > On Tue, 21 Sept 2021 at 13:40, Peter J. Holzer wrote: > > On 2021-09-21 13:34:21 -0400, Dave Cramer wrote: > > On Tue, 21 Sept 2021 at 13:20, Peter J. Holzer wrote: > >     On 2021-09-21 20:5

Re: Timestamp with vs without time zone.

2021-09-21 Thread Peter J. Holzer
2021, 4:15 am, America/Chicago Now it's a single time, equivalent to 2021-03-01T10:15:00Z. However, if you don't have to store the timezone if you have some other way to unambiguously specify the time, e.g. by always using UTC or by storing seconds since an epoch. hp --

Re: Timestamp with vs without time zone.

2021-09-21 Thread Peter J. Holzer
On 2021-09-21 12:37:49 -0700, Adrian Klaver wrote: > On 9/21/21 11:45 AM, Peter J. Holzer wrote: > > On 2021-09-21 13:43:46 -0400, Dave Cramer wrote: > > > On Tue, 21 Sept 2021 at 13:40, Peter J. Holzer wrote: > > > On 2021-09-21 13:34:21 -0400, Dave Cramer wrot

Re: Timestamp with vs without time zone.

2021-09-21 Thread Peter J. Holzer
On 2021-09-21 12:58:13 -0700, David G. Johnston wrote: > On Tuesday, September 21, 2021, Peter J. Holzer wrote: > These two values are completely indistinguishable. That's good for a > timestamp (they are the same time after all). But they are not a > "timestam

Using a single sequence for all tables

2021-09-29 Thread Peter J. Holzer
ut if in doubt, measure! * Doesn't work with IDENTIY - those columns always use implicit sequences. * currval() is pretty useless with a global sequence. But I basically never use that anyway. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: Using a single sequence for all tables

2021-09-29 Thread Peter J. Holzer
u use 64 bit (do the latter if in doubt). * You only have to monitor a single sequence to see if you are close to an overflow, not dozens of them. * You will probably be more aware that this might be a problem. hp -- _ | Peter J. Holzer| Story must make more sense than reality.

Re: Using a single sequence for all tables

2021-09-30 Thread Peter J. Holzer
fore I retire (even without global ids). One of my databases now has ids in the range of 500E6, and I guess it might reach 2E9 over the next decade or so. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at

Re: Misplaced double quotes in error message

2021-10-07 Thread Peter J. Holzer
t exist Hint: Perhaps you meant to reference the column “t.someColumn”. But that's optically not very different (depends on your font, of course) and your terminal has to support Unicode (or at least a subset which includes those quotes). hp -- _ | Peter J. Holzer| Stor

Re: Duplicate key in UUID primary key index...

2021-10-14 Thread Peter J. Holzer
insert, but when I SELECT the uuid, nothing is returned. Are you perhaps trying to insert the same uuid twice in the same transaction? In this case the second insert would fail causing the whole transaction to fail and you would never see that uuid in another session. hp -- _ | Pet

Re: Wrong sorting on docker image

2021-10-16 Thread Peter J. Holzer
y the glibc maintainers. PostgreSQL can also use the ICU locales instead of those provided by the OS. Have you tried that? 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: Looking for a doc section that presents the overload selection rules

2021-10-22 Thread Peter J. Holzer
gits after the decimal point so I got them. hjp=> select to_char(34567::int, '999.999'); ╔══╗ ║ to_char ║ ╟──╢ ║ ###.### ║ ╚══╝ (1 row) 34567 doesn't fit into the 3 digits before the point I asked for, so I just get hashes. hp -- _ | P

Re: Incremental backup

2021-10-29 Thread Peter J. Holzer
l incremental backups hard. Both Oracle > and DB2 have database level incremental backups and both have cluster wide WAL > (redo or logs). I was not aware that Oracle even has something equivalent to a Postgres cluster. hp -- _ | Peter J. Holzer| S

Re: Incremental backup

2021-10-29 Thread Peter J. Holzer
On 2021-10-29 08:38:47 -0400, Mladen Gogala wrote: > On 10/29/21 03:30, Peter J. Holzer wrote: > > I was not aware that Oracle even has something equivalent to a Postgres > > cluster. > > It's called "Oracle instance". I don't think that's equiv

Re: Incremental backup

2021-10-29 Thread Peter J. Holzer
On 2021-10-29 09:03:04 -0400, Mladen Gogala wrote: > On 10/29/21 08:49, Peter J. Holzer wrote: > > I don't think that's equivalent. An Oracle instance is a runtime concept > > (the collection of server processes on a single machine serving a single > > database (the

Re: Question: Is it possible to get the new xlog position after query execution?

2021-10-31 Thread Peter J. Holzer
s ...) commit; begin; update counter set c = c + 1 returning c; -- save this as c_current commit; Select c from counter on the replica in a loop until c >= c_current. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_)

Re: Question: Is it possible to get the new xlog position after query execution?

2021-11-06 Thread Peter J. Holzer
On 2021-11-01 00:36:16 -0400, Oleg Serov wrote: > On Sun, Oct 31, 2021 at 4:29 PM Peter J. Holzer wrote: > > On 2021-10-29 13:22:56 -0400, Oleg Serov wrote: > > We are using a master/slave replication system where we perform > > writes on master and use replica

Re: historical log of data records

2021-11-16 Thread Peter J. Holzer
th work, one or the other may be slightly more convenient depending on the use case. Since you mentioned that the purpose is auditing, I'd probably lean towards separate tables in your case. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: Match 2 words and more

2021-11-28 Thread Peter J. Holzer
ble. You want some alphabetic characters followed by a space. So this becomes select name FROM a_table where "STREET_NAME" ~ '^([[:alpha:]]+ )+[[:alpha:]]+$'; hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: Match 2 words and more

2021-11-28 Thread Peter J. Holzer
On 2021-11-28 00:27:34 +, Shaozhong SHI wrote: > It appears that regex is not robust. It does reliably what you tell it to do. I would agree that after almost 50 years of extending it, the syntax has become a bit of a mess. hp -- _ | Peter J. Holzer| Story must make m

Re: Working with fixed-point calculations in C

2021-12-08 Thread Peter J. Holzer
digit mantissa stored in a variable length format. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signat

Re: performance expectations for table(s) with 2B recs

2021-12-08 Thread Peter J. Holzer
seems to be no good solution. 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: Detecting repeated phrase in a string

2021-12-09 Thread Peter J. Holzer
s repeated in "wikiwiki". bayes=> select regexp_match('fo wikiwi bar', '(.+)\1'); ╔══╗ ║ regexp_match ║ ╟──╢ ║ (∅) ║ ╚══╝ (1 row) nothing is repeated. Adjust the expression within parentheses if you want to match somethig more specific

Re: Detecting repeated phrase in a string

2021-12-09 Thread Peter J. Holzer
-matching.html#POSIX-CONSTRAINT-ESCAPES-TABLE 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: [EXTERNAL] Re: performance expectations for table(s) with 2B recs

2021-12-10 Thread Peter J. Holzer
;s perspective may really be a whole family of related queries - and PostgreSQL will try to find the optimal plan for each of them. Which is generally a good thing, but it adds opportunities to mess up. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: Difference in execution plans pg12 vs pg14

2021-12-11 Thread Peter J. Holzer
look realistic for a completely cold database on a slow rotating hard disk. If this happened only once I suspect that something else interfered (maybe another I/O intensive process, if this is on a VM maybe even on another guest). If it is repeatable, something very weird is going on. hp --

Re: Regular Expression For Duplicate Words

2022-02-03 Thread Peter J. Holzer
gether: select * from t where t ~ '[[:<:]]([[:alpha:]]+)[[:>:]]\W[[:<:]]\1[[:>:]]'; hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-10 Thread Peter J. Holzer
re you really interested in a lower-level interface or do you just want it in-process? I suspect that just adding in-process capability would require a major overhaul. 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: Can we go beyond the standard to make Postgres radically better?

2022-02-10 Thread Peter J. Holzer
On 2022-02-10 18:22:29 +0100, Peter J. Holzer wrote: > On 2022-02-09 21:14:39 -0800, Guyren Howe wrote: > > • SELECT * - b.a_id from a natural join b > > □ let me describe a select list by removing fields from a relation. In > > the example, I get all fields i

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-10 Thread Peter J. Holzer
eries valid which are invalid according to the standard) is an extension. Not sure if this is true for all of Guyren's proposals, although no counter-examples immediatly pop into mind. hp -- _ | Peter J. Holzer| Story must make more sense than reality.

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-11 Thread Peter J. Holzer
On 2022-02-10 16:13:33 -0500, Bruce Momjian wrote: > On Thu, Feb 10, 2022 at 06:25:45PM +0100, Peter J. Holzer wrote: > > On 2022-02-10 18:22:29 +0100, Peter J. Holzer wrote: > > > On 2022-02-09 21:14:39 -0800, Guyren Howe wrote: > > > > • SELECT * - b.a_id from a

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-12 Thread Peter J. Holzer
On 2022-02-12 01:18:04 +0100, Andreas 'ads' Scherbaum wrote: > On 10/02/2022 18:22, Peter J. Holzer wrote: > > On 2022-02-09 21:14:39 -0800, Guyren Howe wrote: > > > Examples of small things Postgres could have: > > > > > >• SELECT * - b.a_id

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-12 Thread Peter J. Holzer
On 2022-02-12 20:50:57 +0100, Peter J. Holzer wrote: > On 2022-02-12 01:18:04 +0100, Andreas 'ads' Scherbaum wrote: > > On 10/02/2022 18:22, Peter J. Holzer wrote: > > > On 2022-02-09 21:14:39 -0800, Guyren Howe wrote: > > > > Exam

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-12 Thread Peter J. Holzer
On 2022-02-12 22:09:25 +0100, Andreas 'ads' Scherbaum wrote: > On 12/02/2022 20:50, Peter J. Holzer wrote: > > On 2022-02-12 01:18:04 +0100, Andreas 'ads' Scherbaum wrote: > > > On 10/02/2022 18:22, Peter J. Holzer wrote: > > > > On 2022-02-09 21:

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-12 Thread Peter J. Holzer
On 2022-02-12 13:23:39 -0800, Adrian Klaver wrote: > On 2/12/22 13:17, Peter J. Holzer wrote: > > A shell could also provide an "expand select list" function using > > explain. > > > > In fact, you can sort of do that manually: > > > > 1) Prefix

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-13 Thread Peter J. Holzer
On 2022-02-13 01:11:16 +0100, Andreas 'ads' Scherbaum wrote: > On 12/02/2022 22:34, Peter J. Holzer wrote: > > On 2022-02-12 22:09:25 +0100, Andreas 'ads' Scherbaum wrote: > > > On 12/02/2022 20:50, Peter J. Holzer wrote: > > > > On 2022-0

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-13 Thread Peter J. Holzer
csr.description (no output again after a failed query) > Basically, it's like doing \d on a cursor. Unfortunately, it's not > interactive, > one has to do some pythong programming in order do to that. Unfortunately, it > is not possible to just "describe the cu

Re: Strange results when casting string to double

2022-02-17 Thread Peter J. Holzer
system - I'd just clone the production system again to create a new test system and see if the problem happens there, too. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stros

Re: Strange results when casting string to double

2022-02-18 Thread Peter J. Holzer
d in the master to affect the worker processes as consistently as you are seeing. I don't know if it is even possible for a non-standard rounding mode to persist for any length of time, but if it is it would certainly account for weird rounding errors. hp -- _ | Peter J. Holzer

Re: pg_upgrade from Postgresql-12 to Postgresql-13 fails with "Creating dump of database schemas postgres *failure*"

2022-02-23 Thread Peter J. Holzer
quot; (sometimes withe process id attached). You can then use a debugger to inspect this file and investigate the cause of the crash. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, &

Plan for update ... where a is not distinct from b

2017-11-28 Thread Peter J. Holzer
Scan on facttable_imf_ifs_pkey (cost=0.00..2.07 rows=1 width=0) ║ Index Cond: (macrobondtimeseries IS NULL) ╚═══════╝ hp -- _ | Peter J. Holzer

Re: Plan for update ... where a is not distinct from b

2017-11-28 Thread Peter J. Holzer
On 2017-11-28 09:35:33 -0500, Tom Lane wrote: > "Peter J. Holzer" writes: > > I noticed that an update was taking a long time and found this: > > [ crappy plan for join on IS NOT DISTINCT ] > > Yeah, there's no optimization smarts at all for IS [NOT] DIST

Re: Plan for update ... where a is not distinct from b

2017-11-28 Thread Peter J. Holzer
On 2017-11-28 20:48:24 +0100, Laurenz Albe wrote: > Peter J. Holzer wrote: > > I noticed that an update was taking a long time and found this: > > > > UPDATE public.facttable_imf_ifs p > > SET [...lots of columns...] > > FROM cleansin

Re: large numbers of inserts out of memory strategy

2017-11-30 Thread Peter J. Holzer
inserts within a DO block or > wrapping each 'thing' insert in it's own DO block? I would suggest getting rid of the do block entirely if that is possible. Just create lots of insert statements. You can get the current value of a sequence with currval('sequence_name').

Re: large numbers of inserts out of memory strategy

2017-11-30 Thread Peter J. Holzer
On 2017-11-30 08:43:32 -0600, Ted Toth wrote: > Date: Thu, 30 Nov 2017 08:43:32 -0600 > From: Ted Toth > To: "Peter J. Holzer" > Cc: pgsql-general@lists.postgresql.org > Subject: Re: large numbers of inserts out of memory strategy > > On Thu, Nov 30, 2017 at

Re: large numbers of inserts out of memory strategy

2017-12-03 Thread Peter J. Holzer
On 2017-11-30 14:27:58 -0600, Ted Toth wrote: > On Thu, Nov 30, 2017 at 11:40 AM, Peter J. Holzer wrote: > > On 2017-11-30 08:43:32 -0600, Ted Toth wrote: > >> One thing that is unclear to me is when commits occur while using psql > >> would you know where in the doc

Re: ERROR: could not load library libperl.so, PostgreSQL trying to CREATE EXTENSION plperlu

2017-12-03 Thread Peter J. Holzer
ular OS. https://www.postgresql.org/download/linux/suse/? > Or run a supported OS; that one looks pretty old. SLES 12 is the current version of SLES. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated |

Infinite replication loop with pglogical

2017-12-07 Thread Peter J. Holzer
this? (Maybe with a different pglogical.conflict_resolution setting, but if it was a conflict, I should see something in the logs, right?) hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | m

Re: Infinite replication loop with pglogical

2017-12-07 Thread Peter J. Holzer
On 2017-12-07 14:41:31 +0100, Peter J. Holzer wrote: > We are testing bidirectional replication with pglogical: [...] > We have configured bidirectional replication on several tables. In > general that seems to work fine. When a row is inserted/updated/ > deleted on one node, it is r

Re: Re: PostgreSQL needs percentage function

2017-12-18 Thread Peter J. Holzer
of 100 involved? (Is should be, because that's what "cent" means, but it's missing in percent_rank()). If such a function existed, I would avoid it. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we hav

Re: Re: PostgreSQL needs percentage function

2017-12-18 Thread Peter J. Holzer
e whole is 1, it's not a percentage (and yes, percent_rank() is misnamed). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www

Re: Array of foreign key

2017-12-23 Thread Peter J. Holzer
sn't prevent you from removing a row from the target table. The only way I can think of is with an intersection table. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | |

Re: Array of foreign key

2017-12-23 Thread Peter J. Holzer
On 2017-12-23 12:24:07 -0500, Melvin Davidson wrote: > On Sat, Dec 23, 2017 at 12:09 PM, Peter J. Holzer wrote: > >...Is there a way to > >enforce foreign key constraints on the members of an array? > >At insert time you can check with a trigger of course, and maybe there &g

Re: Array of foreign key

2017-12-23 Thread Peter J. Holzer
included into Postgres! > > Actually, I think the op may be referring to a MULTI COLUMN FK array I see no reason to assume that. He explicitely asked about an array of foreign keys, and there is no array here. hp -- _ | Peter J. Holzer| we build much bigger, better dis

Re: Array of foreign key

2017-12-24 Thread Peter J. Holzer
On 2017-12-23 14:40:13 -0500, Melvin Davidson wrote: > On Sat, Dec 23, 2017 at 2:27 PM, Peter J. Holzer wrote: > >If you do not understand something, please ask. > > Your response is inappropriate and offensive. I apologize for my tone. I should have calmed down before repl

Re: Mailing list archiver

2018-01-03 Thread Peter J. Holzer
which has an A record. So that might work on some platforms. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Ander

Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: data-checksums

2018-01-14 Thread Peter J. Holzer
#x27;s version draws attention to the fact that enabling CRCs may cause extra disk writes, which rings a much louder alarm bell for me. (When are those hint-bits set? Does this happen often when otherwise no write would have been necessary? I have no idea so I guess I'd better measure it!)

Re: String comparison problem in select - too many results

2018-01-14 Thread Peter J. Holzer
║ 18/0113 ║ ║ 18/0212 ║ ║ 180/2010 ║ ║ 23/4567 ║ ╚══╝ (4 rows) It might be possible to define a custom collation for that, but in a case like this I would either split this field into two integer fields or use a function-based index. hp -- _ | Peter J. Holzer| we build much

Re: String comparison problem in select - too many results

2018-01-14 Thread Peter J. Holzer
On 2018-01-14 13:20:05 +0100, Francisco Olarte wrote: > On Sun, Jan 14, 2018 at 12:14 PM, Peter J. Holzer wrote: > > On 2018-01-12 11:08:39 +0100, Francisco Olarte wrote: > >> C collation is like sorting raw bytes, it doesn't event sort > >> upper/lower case corre

Re: How to measure query time - with warm up and cached data

2018-01-21 Thread Peter J. Holzer
pecially between the 2nd and 3rd). But in your case it is just the opposite. > [cleardot] Sending Webbugs to a mailinglist? hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@

Re: postgres for production

2018-01-31 Thread Peter J. Holzer
, so a single client might use more than one core). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Ande

Re: Bulk Insert/Update Scenario

2018-01-31 Thread Peter J. Holzer
ql -c '\copy ...' hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>

Re: Information on savepoint requirement within transctions

2018-01-31 Thread Peter J. Holzer
tgreSQL model. If the programmer wants to tolerate and error, they have to handle it explicitely (with a savepoint or even a full transaction). I can't really think of a reason why the MSSQL behaviour might be useful, but I'm sure that they had a use-case in mind when they designed this

Re: Information on savepoint requirement within transctions

2018-01-31 Thread Peter J. Holzer
gt; > They allow to provide a try/catch behavior with the ability > > to continue to use a transaction after a failure. I agree. The goal isn't to ignore the error but to handle it. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) |

Re: I do not get the point of the information_schema

2018-02-13 Thread Peter J. Holzer
on both PostgreSQL and MariaDB to get a list of tables. (That said, it looks like both PostgreSQL and MariaDB include additional columns beyond those mandated by the standard - you can't rely on those, of course. And some databases like Oracle don't even have an information schema.)

Re: I do not get the point of the information_schema

2018-02-13 Thread Peter J. Holzer
On 2018-02-13 16:06:43 -0700, David G. Johnston wrote: > On Tue, Feb 13, 2018 at 3:57 PM, Peter J. Holzer wrote: > > (That said, it looks like both PostgreSQL and MariaDB include additional > columns beyond those mandated by the standard - you can't rely on those, >

Re: Repeatable Read Isolation Level "transaction start time"

2024-10-06 Thread Peter J. Holzer
On 2024-10-05 15:40:06 -0700, Adrian Klaver wrote: > On 10/5/24 15:25, Peter J. Holzer wrote: > > On 2024-10-05 17:03:08 -0400, Tom Lane wrote: > > > "Peter J. Holzer" writes: > > > > Again, I'm not arguing for such a change, but I'm wondering if

Re: Repeatable Read Isolation Level "transaction start time"

2024-10-05 Thread Peter J. Holzer
On 2024-10-05 09:59:00 -0700, Adrian Klaver wrote: > On 10/5/24 02:14, Peter J. Holzer wrote: > > On 2024-09-25 18:09:44 -0400, Tom Lane wrote: > > > "Peter J. Holzer" writes: > > > Admittedly, that would normally not be a very long interval if BEGIN > >

Re: Backup

2024-10-16 Thread Peter J. Holzer
t yourself (which you probably have to anyway because for me "so large it has to be streamed" implies "at least possibly larger than 1 GB"). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at

Re: What are best practices wrt passwords?

2024-10-16 Thread Peter J. Holzer
wn processes since a *very* long time ago. Possibly even before Ubuntu even existed. So I'm somewhat sceptical about that. Some other Unixes were more permissive. I don't know what camp MacOS falls into. hp -- _ | Peter J. Holzer| Story must make more sense than realit

Re: Query performance issue

2024-10-16 Thread Peter J. Holzer
7;t get mysql to work like postgresql, and any tips to speed up this query on postgresql (which is all you can expect on a postgresql mailing list) probably won't work on mysql. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || |

Re: Repeatable Read Isolation Level "transaction start time"

2024-10-05 Thread Peter J. Holzer
On 2024-09-25 18:09:44 -0400, Tom Lane wrote: > "Peter J. Holzer" writes: > > On 2024-09-25 13:53:30 -0700, Christophe Pettus wrote: > >> This might well be a failure of imagination on my part, but when would > >> it pragmatically matter that the snapshot is

Re: Request for Insights on ID Column Migration Approach

2024-10-05 Thread Peter J. Holzer
On 2024-09-27 18:37:35 -0400, Tom Lane wrote: > "Peter J. Holzer" writes: > > As you can see, adding the primary key takes just as much time as > > creating the unique index. So it doesn't look like PostgreSQL is able to > > take advantage of the existing ind

Re: Repeatable Read Isolation Level "transaction start time"

2024-10-05 Thread Peter J. Holzer
On 2024-10-05 17:03:08 -0400, Tom Lane wrote: > "Peter J. Holzer" writes: > > Again, I'm not arguing for such a change, but I'm wondering if recording > > transaction_timestamp just after the snapshot might be a safe change or > > whether that might b

Re: Questions about document "Concurrenry control" section

2024-10-12 Thread Peter J. Holzer
I'm using Thunderbird. If you have better software, tell me please. I'm using (neo)mutt, but these days the limitations of a text-only mailer can be quite noticeable. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | |

Re: Questions about document "Concurrenry control" section

2024-10-12 Thread Peter J. Holzer
possible. For me it's much better to get all the mails through the list (so I can use the List-ID header to filter them into the appropriate folder) and live with the extra copies in my inbox. I would prefer to not get those extra copies, but there is nothing the list can do about them, that'

Re: Used memory calculation in containers - docker stats and file cache

2024-11-04 Thread Peter J. Holzer
like this issue, or the parent one that everyone is linking to this. That seems to be just about the way it is reported, not the behaviour. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Char

Re: Used memory calculation in containers - docker stats and file cache

2024-11-01 Thread Peter J. Holzer
porary files, depending on your work_mem settings), but I wouldn't expect them to happen just before the configured limit is reached. So I'd double check the logs if there are any errors. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: How batch processing works

2024-09-22 Thread Peter J. Holzer
y usual distributions. It's now in both Debian and Ubuntu, so that will change. 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 batch processing works

2024-09-22 Thread Peter J. Holzer
On 2024-09-21 20:55:13 +0530, Lok P wrote: > On Sat, Sep 21, 2024 at 8:07 PM Peter J. Holzer wrote: [... lots of code elided. method2 used 1 insert per row, method3 1 insert for 50 rows ...] > On my laptop, method2 is about twice as fast as method3. But if I > connect to a da

Re: glibc updarte 2.31 to 2.38

2024-09-22 Thread Peter J. Holzer
cording to the rules of their language and C collation is in most cases very different. hp [1] I actually have LC_COLLATE=POSIX set in the shell. But I'm not normal. -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h.

Re: Clarify this MERGE warning? "Only columns from the target table that attempt to match data_source rows should appear in join_condition."

2024-09-21 Thread Peter J. Holzer
from the target table that attempt to match data_source` rows" for me sort of sounds like those columns have to have a counterpart in the data_source, which k1 hasn't. Also maybe the order is the wrong way around? "Match rows in the target to rows in the data_source" wo

Re: IO related waits

2024-09-21 Thread Peter J. Holzer
On 2024-09-21 15:06:45 +0530, veem v wrote: > On Sat, 21 Sept 2024 at 03:47, Peter J. Holzer wrote: > > On 2024-09-20 14:11:38 -0700, Adrian Klaver wrote: > > On 9/20/24 1:01 PM, veem v wrote: > > > Able to reproduce this deadlock graph as below.  Now my >

<    1   2   3   4   5   6   7   >