Many, MANY years ago - more than I would like to admit - I was one of the people answering this particular Stack Overflow question about the order of data in the output of pg_dump . In my answer I was pointing out then-recent patch to pg_dump that was providing the --ordered param that would cause dumping of the table data in a deterministic order, instead of reflecting the current on-disk…
Ansible can occasionally fail with the following error: 'Timeout (12s) waiting for privilege escalation prompt'. At some point I wanted to finally learn exactly what this 'privilege escalation prompt timeout' is, where I can change its value and where it says that it defaults to 12 seconds. Clearly it relates to sudo (or other become mechanism), but I could not find anything about it in Ansible…
Examples in this entry use Jinaj2 syntax, but the topic is completely stack agnostic and does not require deep understanding of any specific templating language. Problem statement When templating config files, it's not uncommon that one ends up with some form of the following: {% if something %} some-config-statement {% endif %} It's a conditionally added statement, so not just a config param that…
Short intro to paste paste is a tool defined in POSIX as follows: The paste utility shall concatenate the corresponding lines of the given input files, and write the resulting lines to standard output. The default operation of paste shall concatenate the corresponding lines of the input files. The <newline> of every line except the line from the last input file shall be replaced with a <tab>. And…
PostgreSQL has two variants of a type called 'timestamp': timestamp with time zone and timestamp without time zone . At a first glance, it looks as if those two data types must differ in terms of what and how is being stored, but that's not exactly the case. In PostgreSQL, with time zone variant doesn't physically store any time zone information. This fact is a key to understand how those two…
Web browsers really like favicons. If your site does not declare one with <link rel='icon'> , most (all?) of the mainstream ones will issue request to /favicon.ico anyway, in a hope of getting one. Favicons are a whole topic on its own. But what if we don't use one? Can we somehow nudge browsers towards actually not looking for it? For saving them from making an extra request and for making dev…
In the recent note titled 'Hiding /etc/shadow from psql' , I've mentioned how calling psql was causing auditd to log denied reads of /etc/shadow and have showed one way to deal with this. Here is the continuation of this story, as thanks to insights from @hillu.bsky.social , it's clear that I've missed an important detail. On Debian /usr/bin/psql is actually a distro specific wrapper over the…
Ansible has a task called add_host . It adds extra hosts to the inventory at play execution time. It has two non obvious properties, though. First, such a host is not automatically selected as execution target during current play. Only subsequent plays, that run in the same execution context, can match such new host with host selectors. The other is that such added hosts will stay in the inventory…
psql Debian wrapper of psql (see this update ), at least in version 15.12, really likes /etc/shadow file. To such a degree that it tries to read it upon each invocation: $ strace psql 2>&1 | grep /etc/shadow openat(AT_FDCWD, '/etc/shadow', O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied) On this particular host, such event is logged by auditd (output edited for brevity): type=SYSCALL…
PostgreSQL in version 17 introduced sslnegotiation connection param . Setting it to direct skips asking the server if it supports SSL connections and proceeds establishing such connection directly. This post mentions using that to save seconds (!) in connection times, but in a very specific circumstances, where additional factors greatly amplified observed performance. The post itself is…
Recently I've landed on a blog post from 2011 titled 'URL as UI' . One claim caught my eye in particular - 'an ideal URL is guessable': Synonyms should ideally redirect. If you have a support page at /support and a user types /help, is that really such a bad request? Don't show them a 404 — send them to the page they're looking for! Yes, in principle that looks like a great idea. You show…
This is slightly embarrassing, but I've learned just recently that tail command has -F option. It's a CAPITAL F, not commonly used lower case -f . It's not POSIX standardized, but many implementations have it. GNU coreutils is an example closest to my daily usage, but I can see that (apparently similar) implementations are present in e.g. FreeBSD, NetBSD or Busybox (here behind a compile time flag…
Some programs require that the name of the passed file has a specific scheme. For example, just now I want to start programX and it won't work, if config file has no proper extension. There are better or worse reasons to do that. But the cons include, at a minimum, reduced interoperability. For example, 'process substitution' is a convenient way to pass file-like objects constructed on the fly…
Motivated by one of those 'why can't A access B on AWS' questions I just saw, a short reminder - AWS has this thing called... Reachability Analyzer. The name is straight to the point, and such is the tool itself. It allows you to create a set of named paths between points in your infrastructure, and test if they can be traversed end to end or not. Apart from yes/no answer, you also get a nice…
When using CSS flexbox, I have this tendency to use margin: auto whenever I want to push single item to the flex-end. For example (assuming ltr mode here and for the rest of this note), inside display:flex; flex-direction: column I would put margin-left: auto on the last item, to make it stick to the right edge, while keeping rest of them to the left. Fine, you can do that, but it's probably not…
nftables has some peculiarities in its syntax. One of my 'favorites' is the fact that you can't define an empty set while using elements keyword and contents literal. For example, let's create a table: nft add table test_tbl Now we can add a set: nft add set test_tbl test_set { type inet_service\; } This set is empty - that works just fine. We could also initialize it with some values from the get…
pgBackRest does not support HTTP proxies (in its S3 client). This was raised on Github couple of times ( [1] , [2] , [3] , [4] ). Suggested workaround is to use ProxyChains . Discovering you need to slap some extra component into a critical path of a critical workflow is exciting... Exciting as in need-to-go-to-a-dentist kind of exciting. But happy to confirm that it just works! With Squid on the…
Latest episode of Postges FM podcast does interesting overview of top things to be aware of when operating PostgreSQL deployments. All are important, obviously, but if I were to chose one, corruption case is the worst. Let's say we have page checksums on, do regular backups and run test restoration as mandatory step for each of them: run full am check, run pg_checksums, read whole db via…
'Do not confuse the <b> element with the <strong> , <em> , or <mark> elements', says MDN page on <b> : https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/b . But why, exactly? What kinds of daemons will we summon otherwise? Well, don't do it because 'the <strong> element represents text of certain importance, <em> puts some emphasis on the text and the <mark> element represents…
@winand.at noted on Bluesky : New PostgreSQL tag: REL_18_BETA1 So many features to check out… My personal favorites are: generated columns - trading compute for space, defined in single place and once, uuidv7() - time-sortable UUIDs, idle_replication_slot_timeout - automatic cleanup of unused replication slots, gin_index_check() - more consistency checks, e.g when test-restoring backups.
Apparently no way to get config of currently running instance of gpg-agent? There is gpgconf --list-options gpg-agent , but it only operates on what gpg-agent (would have) read from config file and does not take into account params passed to the agent cli. At least in gpg 2.2.40.
Funny how most of the cost of the smallest VM on scaleway.com (1 shared vCPU, 1GB RAM) is actually... IPv4 address. Yes, you can drop it, in which case cost calculator estimates monthly bill of... 0.97€ + VAT (so for me that would be 1.19€). There are caveats, though: 'Limited availability and no SLA' disclaimer, presence only in two out of nine availability zones, only 10GB of storage (with…
Who would have though that Ansible behvior when casting null to bool will be closer to SQL than to Python: $ python -c 'print(bool(None))' False $ psql -tA -c 'select null::bool is null' t $ ansible -o -m raw -a 'echo -n {{ None | bool | type_debug }}' localhost localhost | CHANGED | rc=0 | (stdout) NoneType
Question littlek notes on Stackoverflow: I am finding that pg_dump will not always dump the database in the same way. It will dump things in a different order every time. Therefore, when I do a diff on the two database dumps, the comparison will result in the two files being different, when they are actually the same, just in a different order. And then they ask : Is there a different way I can go…