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

Re: copying json data and backslashes

2022-11-22 Thread Peter J. Holzer
╔═══╗ ║ ascii ║ ╟───╢ ║ 3 ║ ╚═══╝ (1 row) Same for the other ctrl characters. hp [1] There are usually four Ctrl-Characters which need only a single key: Ctrl-I (TAB), Ctrl-M (CR), Ctrl-[ (ESC) and Ctrl-H (BS) or Ctrl-? (DEL). (On Unix systems CR is

Re: Stored procedure code no longer stored in v14 and v15, changed behaviour

2022-12-02 Thread Peter J. Holzer
red by the server. So you can't simply tell whether the stored/used version corresponds to the code you installed. I don't know how reproducable that tokenization process is. Can you just do it again and compere the results? hp -- _ | Peter J. Holzer| Stor

Re: Regular expression for lower case to upper case.

2022-12-10 Thread Peter J. Holzer
are not what I want. Can you elaborate why you can't use those? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ |

Re: Regular expression to UPPER() a lower case string

2022-12-10 Thread Peter J. Holzer
that a reason why it should). > * your logic only works by accident for some languages (try to upcase > a `ß` or a `ı`) This is also true of upper() and lower() and SQL does provide those. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: Regular expression for lower case to upper case.

2022-12-10 Thread Peter J. Holzer
(x, '(.*_)(.*)(_.*)', '\2')) || regexp_replace(x, '(.*_)(.*)(_.*)', '\3') FROM test; ╔═╗ ║ ?column? ║ ╟─╢ ║ abc_DEF_ghi ║ ╚═╝ (1 row) 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: Regular expression to UPPER() a lower case string

2022-12-10 Thread Peter J. Holzer
On 2022-12-10 13:44:37 +, Gianni Ceccarelli wrote: > On 2022-12-10 "Peter J. Holzer" wrote: > > > * your logic only works by accident for some languages (try to > > > upcase a `ß` or a `ı`) > > > > This is also true of upper() and lo

Re: Regular expression to UPPER() a lower case string

2022-12-10 Thread Peter J. Holzer
. but that would be insane even for the 26 letters of the basic Latin alphabet, much less the myriad of accented letters (and other alphabets like Cyrillic or Greek ...). On second thought you could probably use NFD normalization to separate base letters from accents, uppercase the base letters an

Re: Regular expression to UPPER() a lower case string

2022-12-10 Thread Peter J. Holzer
'(.)(.)(.)', '\2')) || UPPER(REGEXP_REPLACE(x, '(.)(.)(.)', '\3')) FROM test; ╔═╤═╗ ║ x │ ?column? ║ ╟─┼─╢ ║ abc_def_ghi │ A_DEF_GHIB_DEF_GHIC_DEF_GHI ║ ╚══

Re: Regular expression to UPPER() a lower case string

2022-12-11 Thread Peter J. Holzer
On 2022-12-10 15:48:58 +0100, Peter J. Holzer wrote: > On second thought you could probably use NFD normalization to separate > base letters from accents, uppercase the base letters and then > (optionally) NFC normalize everything again. Of course I had to try that: wds=> select

Re: Regd. the Implementation of Wallet (in Oracle) config equivalent in postgreSQL whilst the database migration

2022-12-22 Thread Peter J. Holzer
e not on the same box. They are in a HSM. A dedicated piece of > tamper-proof hardware that stores secrets (keys). > The Oracle-server needs to talk to the HSM to get the keys. If the hacker has root access: What prevents them from talking to the HSM? hp -- _ | Peter J. Holze

Re: Regd. the Implementation of Wallet (in Oracle) config equivalent in postgreSQL whilst the database migration

2022-12-22 Thread Peter J. Holzer
On 2022-12-22 11:15:57 +0100, Rainer Duffner wrote: > > > Am 22.12.2022 um 10:46 schrieb Peter J. Holzer : > > If the hacker has root access: What prevents them from talking to the > HSM? > > > > I wasn’t involved in setting it up here, but AFAIK you

Re: best practice to patch a postgresql version?

2022-12-27 Thread Peter J. Holzer
with multiple active nodes running already. 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: REINDEX vs VACUUM

2023-01-05 Thread Peter J. Holzer
living room. Isn't that how you normally vacuum your living room? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ |

Re: REINDEX vs VACUUM

2023-01-05 Thread Peter J. Holzer
On 2023-01-05 12:34:08 +0100, Karsten Hilbert wrote: > > Von: "Peter J. Holzer" > > On 2023-01-04 09:34:42 -0600, Ron wrote: > > > I don't think VACUUM FULL (copy the table, create new indices and other > > > metadata all in one command) actually

Re: Purging few months old data and vacuuming in production

2023-01-07 Thread Peter J. Holzer
rate. I'd go for a middle ground: Instead of expiring once per day, use a shorter interval, maybe once per hour or once per minute. That will (probably) make each expire job really quick but still create much less load overall. hp -- _ | Peter J. Holzer| Story must make m

Re: Purging few months old data and vacuuming in production

2023-01-07 Thread Peter J. Holzer
On 2023-01-07 07:40:01 -0600, Ron wrote: > On 1/7/23 05:29, Peter J. Holzer wrote: > If I understood correctly, you have to delete about 3 million records > (worst case) from the main table each day. Including the other 8 tables > those are 27 million DELETE queries e

Re: Intervals and ISO 8601 duration

2023-01-13 Thread Peter J. Holzer
g like this to PostgreSQL would be worthwhile? 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

Dump (was: Intervals and ISO 8601 duration)

2023-01-13 Thread Peter J. Holzer
On 2023-01-14 06:32:03 +0100, Peter J. Holzer wrote: > Oracle has a function which returns the internal representation of a > value as a series of (decimal) byte values. Back in the days when I was > new to Oracle I used this to figure out how Oracle stores NUMBER, but > now I'

Re: does refreshing materialized view make the database bloat?

2023-01-14 Thread Peter J. Holzer
eted[1]. Whether that means that the space is "immediately" available again is up to the operating system. hp [1] Possibly delayed until commit. -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at

Re: timestamptz, local time in the future, and Don't do it wiki

2023-01-27 Thread Peter J. Holzer
ocal time + time zone, not timestamptz (the time zone can be implicit). 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: Sequence vs UUID

2023-02-02 Thread Peter J. Holzer
On 2023-02-02 10:22:09 -0500, Benedict Holland wrote: > Well... until two processes generate an identical UUID. That happened to me > several times. How did that happen? Pure software implementation with non-random seed? Hardware with insufficient entropy source? hp -- _ | P

Re: Question regarding UTF-8 data and "C" collation on definition of field of table

2023-02-06 Thread Peter J. Holzer
On 2023-02-05 18:57:13 -0600, Ron wrote: > Why are you specifying the collation to be "C" when the default db encoding > is UTF8, and UTF-8 has Greek, Chinese and English encodings? C is equally bad for Greek, Chinese and English ;-) hp -- _ | Peter J. Holzer|

Re: Sequence vs UUID

2023-02-06 Thread Peter J. Holzer
e may be negligible or huge. It really depends on your access patterns. hp [1] There was even a discussion about making that much faster on the LKML recently. -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.a

Re: PostgreSQL

2023-02-07 Thread Peter J. Holzer
les, schemas and databases and covered by the "usual" SQL privilege system. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http:

Re: Sequence vs UUID

2023-02-08 Thread Peter J. Holzer
so during migrations, restores from backups and other infrequent events. With random Ids you don't have to worry about this. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Str

Re: WHERE col = ANY($1) extended to 2 or more columns?

2023-02-11 Thread Peter J. Holzer
══╝ (10 rows) The latter is almost 1000 times faster. Saving 1.8 ms on planning time doesn't help you if you the

Re: WHERE col = ANY($1) extended to 2 or more columns?

2023-02-11 Thread Peter J. Holzer
On 2023-02-11 16:21:49 +0100, Peter J. Holzer wrote: > On 2023-02-09 18:35:42 +0100, Dominique Devienne wrote: > > Right. The goal is to (re)use a prepared statement (i.e. plan once), and > > bind > > the RHS (binary) array > > and do a single exec (single round-tri

Re: Query plan for "id IS NULL" on PK

2023-02-14 Thread Peter J. Holzer
nd should be fixed. OTOH it could also be argued that the optimizer should be able to perform the same simplifications as I did above and produce the same code for WHERE (("id" > ? OR "id" IS NULL)) AND (("id" <= ?)) as for WHERE (("id" > ?))

Re: Query plan for "id IS NULL" on PK

2023-02-14 Thread Peter J. Holzer
On 2023-02-14 15:36:32 -0700, Rob Sargent wrote: > But if the query is supposed to be generic and re-used in a situation where id > could be null, wouldn't the null id records be fetched every time?  No, they will never be fetched because of the AND (("id" <= ?)).

Re: Does Postgres 14 have a query cache?

2023-02-18 Thread Peter J. Holzer
e case (the exact same query is submitted repeatedly) is sufficiently rare that it isn't all that effective in practice. (The other techniques mentioned are of course also used by other databases.) hp -- _ | Peter J. Holzer| Story must make m

Re: Quit currently running query

2023-02-28 Thread Peter J. Holzer
n be a DNS or LDAP client). (And some programs are even server and client for the same protocol) 3) A machine intended for running server programs. You are thinking of the 3rd meaning. My guess is that Albert meant the first. hp -- _ | Peter J. Holzer| Story must make

Re: Dropping behavior for unique CONSTRAINTs

2023-03-04 Thread Peter J. Holzer
That doesn't work. A unique constraint can't exist without a (unique) index. Think about it: With a unique constraint PostgreSQL needs to check for every insert whether the value already exists in the table. Without an index this would mean a full table scan. hp -- _ | Peter

Re: Dropping behavior for unique CONSTRAINTs

2023-03-04 Thread Peter J. Holzer
n is pointing out that CONCURRENTLY cannot be used for that purpose. (I realize that your idea is not to create the constraint in the first place.) 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: Dropping behavior for unique CONSTRAINTs

2023-03-04 Thread Peter J. Holzer
On 2023-03-04 02:34:02 -0600, Ron wrote: > On 3/4/23 02:03, Peter J. Holzer wrote: > [snip] > > So your plan is to create a unique constraint (backed by a unique > > index) and then to drop the index and keep the constraint? > > > > That doesn't work. A uniq

Re: escape vs. bytea in config

2023-03-07 Thread Peter J. Holzer
oubles backslashes. Other | byte values are represented literally. So the byte 0x19 is converted to a single character U+0019 (EM) which is then displayed as '\x19', while bytes >= 0x80 are converted to four-character escape sequences. hp -- _ | Peter J. Holzer

Re: Properly handle OOM death?

2023-03-13 Thread Peter J. Holzer
roblems anyway, so it is questionable if one wants to enable external > # automatic restarts. > #Restart=on-failure So I'd try this despite the comment. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@h

Re: Properly handle OOM death?

2023-03-13 Thread Peter J. Holzer
On 2023-03-13 09:55:50 -0800, Israel Brewster wrote: > On Mar 13, 2023, at 9:43 AM, Peter J. Holzer wrote: > > On 2023-03-13 09:21:18 -0800, Israel Brewster wrote: > >> I’m running a postgresql 13 database on an Ubuntu 20.04 VM that is a bit > >> more > >>

Re: Uppercase version of ß desired

2023-03-13 Thread Peter J. Holzer
an alternate locale: hjp=> select upper('ß'); ╔═══╗ ║ upper ║ ╟───╢ ║ ß ║ ╚═══╝ (1 row) hjp=> select upper('ß' collate "de-AT-x-icu"); ╔═══╗ ║ upper ║ ╟───╢ ║ SS ║ ╚═══╝ (1 row) The challenge now is to find a

Re: Issues Scaling Postgres Concurrency

2023-03-14 Thread Peter J. Holzer
Or possibly counting stuff far more often than necessary. If an exact count is necessary more frequently than it changes it is probably a good idea to store that somewhere and update it in a trigger. (If the count doesn't have to be totally up-to-date, caching it in the

Re: Is the PL/pgSQL refcursor useful in a modern three-tier app?

2023-03-17 Thread Peter J. Holzer
OPY some time.) With COPYing the output of a SELECT I don't see any savings. On the contrary, it's an extra step. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles S

Re: EXTERNAL: Re: "No Free extents", table using all allocated space but no rows!

2023-03-17 Thread Peter J. Holzer
wards. The BSD file system and its descendants (like ext4) don't like getting completely full.) 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

Patroni, slots, and expiring WALs

2023-03-28 Thread Peter J. Holzer
se do I have to configure? (I know about wal_keep_size, but it was my understanding that this isn't needed when slots are used) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stros

Re: Cluster table based on grand parent?

2023-03-28 Thread Peter J. Holzer
hild(id) on delete cascade, grandparent int not null references parent(id) on delete cascade, name text not null, unique(grandparent, parent, name) ); 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: Patroni, slots, and expiring WALs

2023-03-28 Thread Peter J. Holzer
On 2023-03-28 11:07:04 -0400, Jeremy Smith wrote: > On Tue, Mar 28, 2023 at 10:55 AM Peter J. Holzer wrote: > > The configuration includes `use_slots: true` and I can see a slot in > pg_replication_slots on the leader. > > I was under the impression that this woul

Re: Patroni, slots, and expiring WALs

2023-03-28 Thread Peter J. Holzer
On 2023-03-28 17:08:38 +0200, Alexander Kukushkin wrote: > On Tue, 28 Mar 2023 at 16:55, Peter J. Holzer wrote: > > > However, when we took down one node for about two hours for some tests > recently (with some moderate traffic on the remaining node), the replica >

Re: Patroni, slots, and expiring WALs

2023-03-28 Thread Peter J. Holzer
On 2023-03-28 17:27:27 +0200, Peter J. Holzer wrote: > On 2023-03-28 17:08:38 +0200, Alexander Kukushkin wrote: > > The second option - you can put all member names into permanent slots > > configuration (using patronictl edit-config): > > slots: > >   nodena

Re: Using CTID system column as a "temporary" primary key

2023-03-29 Thread Peter J. Holzer
could just specific a zero to get a new > > generated serial, but seems this has never been considered with > > PostgreSQL. > > Yes it has: [...] > insert into seq_test values(default, 'test'); Default is not the same as zero. hp -- _ | Peter J.

Re: Using CTID system column as a "temporary" primary key

2023-03-30 Thread Peter J. Holzer
On 2023-03-29 12:15:09 -0700, Adrian Klaver wrote: > On 3/29/23 09:43, Peter J. Holzer wrote: > > On 2023-03-29 07:59:54 -0700, Adrian Klaver wrote: > > > On 3/29/23 07:19, Sebastien Flaesch wrote: > > > > INSERT statements must not use the serial column, so you have

Re: "PANIC: could not open critical system index 2662" - twice

2023-04-07 Thread Peter J. Holzer
I thought the Debian/Ubuntu packages enabled this by default. But that doesn't seem to be the case. -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writi

Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-10 Thread Peter J. Holzer
tribute of an entity which is unique for a given application may not be unique for other applications. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative

Re: JSON / ASP.NET AJAX Dates support in PostgreSQL

2023-04-14 Thread Peter J. Holzer
ion is strictly by convention between the sender and the receiver. > This looks like "milliseconds since the Unix epoch: > > $ date -d @1672692813.062 > Mon 02 Jan 2023 02:53:33 PM CST > > Thus: > select to_timestamp(cast(1672692813062 a

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread Peter J. Holzer
e it > should generate the same md5, as I understand it. That's not necessarily the case. There are quite a few data types where the input value is truncated, rounded or otherwise normalized. So I don't think you can generally expect to read back exactly the same value you inserted.

Re: JSON / ASP.NET AJAX Dates support in PostgreSQL

2023-04-15 Thread Peter J. Holzer
On 2023-04-14 10:44:08 -0700, Adrian Klaver wrote: > On 4/14/23 9:31 AM, Peter J. Holzer wrote: > > On 2023-04-13 10:07:09 -0500, Ron wrote: > > > On 4/13/23 09:44, Sebastien Flaesch wrote: > > > Is there an easy way to convert JSON data containing ASP.NET AJAX

Re: JSON / ASP.NET AJAX Dates support in PostgreSQL

2023-04-15 Thread Peter J. Holzer
On 2023-04-15 09:12:41 -0700, Adrian Klaver wrote: > On 4/15/23 03:46, Peter J. Holzer wrote: > > On 2023-04-14 10:44:08 -0700, Adrian Klaver wrote: > > > On 4/14/23 9:31 AM, Peter J. Holzer wrote: > > > > On 2023-04-13 10:07:09 -0500, Ron wrote: > > > > &

Re: Fwd: Log file

2018-11-11 Thread Peter J. Holzer
edded in the log message. 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/> signature.asc Description: PGP signature

Re: Ipv6 address stored differently while using Inet type

2018-12-27 Thread Peter J. Holzer
sent the same one being inserted? Yes. > Is this a known bug resolved in later versions of Postgres? No. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | ma

Re: In which session context is a trigger run?

2018-12-30 Thread Peter J. Holzer
he temporary table in session A. But since the transaction in session B hasn't yet committed, it wouldn't see the data that the insert statement has just inserted. Since the point of an after insert trigger is usually to do something with this new data, that would make the trigger use

Re: In which session context is a trigger run?

2018-12-31 Thread Peter J. Holzer
On 2018-12-30 08:56:13 -0800, Adrian Klaver wrote: > On 12/30/18 3:08 AM, Peter J. Holzer wrote: > > If I understood Mitar correctly he wants the trigger to execute in the > > session where it was declared, not in the sessio where the statement was > > executed that

Re: Is there something wrong with my test case?

2019-01-06 Thread Peter J. Holzer
far. Is it possible that your subjective impression wasn't based on the executions you posted but on others? Caching and load spikes can cause quite large variations in run time, so running the same query again may not take the same time (usually the second time is faster - sometimes much faster

Re: Oracke BLOB to Postgres BYTEA using ora2pg

2019-01-18 Thread Peter J. Holzer
ely a red herring - that's just for the benefit of humans, but humans can't read binary data directly. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at

Re: Query help

2019-01-27 Thread Peter J. Holzer
ept select ombcase_fkey from statuschange where insdatetime >= now()::date - xx; gives you all ombcase ids which did /not/ have a status change in the last xx days. Another way would be to use a CTE (https://www.postgresql.org/docs/10/queries-with.html) to extract the last status change for e

Re: Size estimation of postgres core files

2019-02-24 Thread Peter J. Holzer
ated (and possibly useless) core dump. For similar reasons I'm not convinced that omitting the shared memory is a good idea. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | |

Re: why not using a mountpoint as PGDATA?

2019-02-27 Thread Peter J. Holzer
nge that. Maybe it's a potential problem with other layouts. 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 A

Re: why not using a mountpoint as PGDATA?

2019-02-27 Thread Peter J. Holzer
saw the specified data directory was empty. > So, rather than failing like a properly paranoid DBA would wish, it > ran initdb and then started the postmaster. Ouch. I wonder though why that directory was writable by the postgres user. But maybe the helpful start script chown'ed it to fix th

Re: Camel case identifiers and folding

2019-03-16 Thread Peter J. Holzer
reference books) these differences are critical. A web page? Rarely, at least for the human readable parts. Medicine? I don't know. There may be names for different substances which differ only in case. But those are parts of a formal language, and as programmers

Re: Camel case identifiers and folding

2019-03-16 Thread Peter J. Holzer
t;the English language". Everybody else will see it as an obvious typo and won't assume that this refers to some "rob Sargent" who is a different person than "Rob Sargent". 2) I don't think the OP was talking about spell-checking. And in any case spell-checking is m

Re: Facing issue in using special characters

2019-03-18 Thread Peter J. Holzer
set which is "very common in Mobile phones", even in a relatively poor country like Myanmar. Does ZawGyi actually include characters which aren't in Unicode are are they just encoded differently? hp -- _ | Peter J. Holzer| we build much bigger, better disasters now

Re: Performance of ByteA: ascii vs binary

2019-03-19 Thread Peter J. Holzer
ea script (https://github.com/hjp/blob-bench) to restrict the byte values to printable ASCII (32 .. 126). There was absolutely no difference, as the attached graph shows. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || becau

Re: Performance of ByteA: ascii vs binary

2019-03-21 Thread Peter J. Holzer
On 2019-03-20 13:20:57 +0100, Thomas Güttler wrote: > > > Am 19.03.19 um 20:37 schrieb Peter J. Holzer: > > On 2019-03-18 15:33:17 +0100, Thomas Güttler wrote: > > > I did some benchmarking and in my setup there was major > > > performance difference. >

Re: Script which shows performance of ByteA: ascii vs binary

2019-03-22 Thread Peter J. Holzer
bytes. Not very meaningful. Another difference I noticed between our benchmarks is that I used a plain bytes object while he used a psycopg2.Binary object. Those might be serialized differently, but since the speed difference is adequately explained by the (lack of) randomness

Re: When to store data that could be derived

2019-03-24 Thread Peter J. Holzer
ndex scans on those columns. But this is not that easy to see, and I don't know whether the optimizer can do it. Rewriting the condition as (a.tran_type = 'ar_rec' and y.posted = 1) or (a.tran_type = 'cb_rec' and w.posted = 1) might make it easier for the optimizer

Re: Key encryption and relational integrity

2019-03-28 Thread Peter J. Holzer
ble to join patients and their medications. So at some level that has to be possible. If you assume a break-in into the server, there will always be a level of penetration at which the attacker will be able to access any data an authorized user can access. hp -- _ | Peter J.

Re: Key encryption and relational integrity

2019-03-28 Thread Peter J. Holzer
at an intruder would get access to the database but not the application. 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

Re: Key encryption and relational integrity

2019-03-29 Thread Peter J. Holzer
On 2019-03-29 17:01:07 +0100, Moreno Andreo wrote: > Il 28/03/2019 23:29, Peter J. Holzer ha scritto: > > On 2019-03-28 18:36:40 +0100, Moreno Andreo wrote: > > > it's just "separation" (that was OK with the last privacy act, but not > > > with GDPR

Re: Key encryption and relational integrity

2019-03-29 Thread Peter J. Holzer
On 2019-03-29 17:05:41 +0100, Moreno Andreo wrote: > Il 28/03/2019 23:50, Peter J. Holzer ha scritto: > > On 2019-03-28 15:29:50 +0100, Moreno Andreo wrote: > > > here I'm trying to find a way so nobody can, without the use of the > > > application, match a patient

Re: Gigantic load average spikes

2019-03-31 Thread Peter J. Holzer
Runnable (R)? Uninterruptible sleep (D)? Both? Something else? hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hj

Re: Recommendation to run vacuum FULL in parallel

2019-04-03 Thread Peter J. Holzer
ere are (at least) pg_repack and pg_squeeze. It would be nice to have that in the core, though. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ |

Re: Recommendation to run vacuum FULL in parallel

2019-04-03 Thread Peter J. Holzer
dates is much greater than the number of > inserts, the unused zombie space gradually creeps up. Not if autovacuum has a chance to run between updates. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more

Re: Recommendation to run vacuum FULL in parallel

2019-04-05 Thread Peter J. Holzer
first issued an update on the first column, checked that the result looked plausible, then issued an update on the second column, and so on. The result was of course massive bloat). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) ||

Re: Trigger when user logs in

2019-04-14 Thread Peter J. Holzer
ck off" doesn't have to be really instantly, you could also monitor pg_stat_activity every second or so and terminate any suspicious session. But note that this rather insecure: A session which lasts for much less than a second has a good chance of flying under the radar. hp -- _

Re: PostgreSQL ping/pong to client

2019-04-19 Thread Peter J. Holzer
ity or the peer machine being turned off). 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 &l

Re: TCP Resets when closing connection opened via SSL

2019-04-27 Thread Peter J. Holzer
ecessary delay. > This is an issue because we have a lot of connections being initiated and > closed. And this creates a lot of TCP resets. Why are those resets a problem? (If the answer is "our monitoring software complains about them" then the question beco

Re: PG version recommendation

2019-05-11 Thread Peter J. Holzer
which the OP hasn't said. If there is a wider varietyl of distributions to choose from, my preference would be Debian or Ubuntu (in that order). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophistica

Re: bigint out of range

2019-05-18 Thread Peter J. Holzer
ds seems odd. I guess the schema was copied from Oracle. In Oracle, all numbers are really 38 digit decimal floating point numbers and the limit for varchar2 is 4000. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) ||

Re: bigint out of range

2019-05-18 Thread Peter J. Holzer
On 2019-05-18 10:49:53 -0700, David G. Johnston wrote: > On Saturday, May 18, 2019, Peter J. Holzer wrote: > > On 2019-05-16 08:48:51 -0700, David G. Johnston wrote: > > On Thu, May 16, 2019 at 8:31 AM Daulat Ram > wrote: > > > > >

Re: bigint out of range

2019-05-18 Thread Peter J. Holzer
On 2019-05-18 15:19:22 -0500, Ron wrote: > On 5/18/19 2:27 PM, Peter J. Holzer wrote: > > On 2019-05-18 10:49:53 -0700, David G. Johnston wrote: > > > You don’t perform math on a hash > > That's not generally true. Hashes are used for further computation for >

Re: bigint out of range

2019-05-18 Thread Peter J. Holzer
On 2019-05-18 17:14:59 -0500, Ron wrote: > On 5/18/19 3:49 PM, Peter J. Holzer wrote: > > On 2019-05-18 15:19:22 -0500, Ron wrote: > > On 5/18/19 2:27 PM, Peter J. Holzer wrote: > > On 2019-05-18 10:49:53 -0700, David G. Johnston wrote: > >

Re: bigint out of range

2019-05-19 Thread Peter J. Holzer
On 2019-05-18 19:16:19 -0500, Ron wrote: > On 5/18/19 5:39 PM, Peter J. Holzer wrote: > > On 2019-05-18 17:14:59 -0500, Ron wrote: > > > On 5/18/19 3:49 PM, Peter J. Holzer wrote: > > > On 2019-05-18 15:19:22 -0500, Ron wrote: > > > On 5/

Migrating a Patroni cluster from Ubuntu 16.04 to Ubuntu 18.04

2019-05-30 Thread Peter J. Holzer
n with one machine upgraded to Ubuntu 18. Yay! \o/ Next node is E, which is only running etcd. Since it already has 3.0, the upgrade to 3.2 is smooth. Finally A: Swith the master over to B, run do-release-upgrade, after the reboot, reinstall patroni (+depencies, +rename config). And ... everyt

Re: Questions about btree_gin vs btree_gist for low cardinality columns

2019-05-30 Thread Peter J. Holzer
g the contents of the index if hd seems to confirm this. For a btree_gin index spanning multiple columns I'm not sure. I would have expected each field to be a token, but it looks like both are stored together. So unless somebody more knowledgeable speaks up, I guess Jeremy will have to read t

Re: Questions about btree_gin vs btree_gist for low cardinality columns

2019-05-31 Thread Peter J. Holzer
On 2019-05-30 21:00:57 +0200, Peter J. Holzer wrote: > Firstly, the GIN index doesn't generally index single characters. It > uses some rule to split the field into tokens. For example, for a text > field, it might split the field into words (possibly with some > normalization

Re: Questions about btree_gin vs btree_gist for low cardinality columns

2019-06-01 Thread Peter J. Holzer
A hash of a two > character string is likely about worst-case. I think that a hash index is generally a poor fit for low cardinality indexes: You get a lot of equal values, which are basically hash collisions. Unless the index is specifically designed to handle this (e.g. by storing the key only once

Re: Questions about btree_gin vs btree_gist for low cardinality columns

2019-06-02 Thread Peter J. Holzer
On 2019-06-02 09:10:25 +1000, Morris de Oryx wrote: > Peter, thanks a lot for picking up on what I started, improving it, and > reporting back. I thought I was providing timing estimates from the EXPLAIN > cost dumps. Seems not. Well, there's another thing that I've learned. T

Re: Postgres 10.7 Systemd Startup Issue

2019-06-08 Thread Peter J. Holzer
a working systemd configuration (assuming systemd is the default init on SuSE). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.h

Re: Requirement PA-DSS 1.1.4

2019-06-08 Thread Peter J. Holzer
Is this safe? You are overwriting the file while it still belongs to the database. Renaming the table should have gotten rid of all transactions accessing it, but what about the background writer or autovacuum? I'm not convinced that nothing would access the file between i. and ii. hp

Re: checkpoints taking much longer than expected

2019-06-14 Thread Peter J. Holzer
.com Maybe you have the same problem? 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 &

Re: bug regclass::oid

2019-06-16 Thread Peter J. Holzer
lumn_name from information_schema.columns where table_name like '% %'; ╔══╤═╤═════╗ ║ table_schema │ quote_ident │ column_name ║ ╟──┼─┼─╢ ║ public │ "foo bar" │ id ║ ╚══╧═

<    2   3   4   5   6   7   8   9   10   >