Last entries
-
bash > how to iterate list of strings with `read -ra` and IFS in the loop (not while loop) - [s]
input_string='"npm-releases", "npm-hosted", "npm-proxy"' IFS=", " read -ra repos <<< "$input_string" for repo in "${repos[@]}"; do echo "Processing repository: $repo" done
-
bash > Are `-L1` and `-n 1` the same for `xargs` - [s]
$ printf '1 2\n3 4\n' | xargs -L1 -t echo echo 1 2 1 2 echo 3 4 3 4 $ printf '1 2\n3 4\n' | xargs -n1 -t echo echo 1 1 echo 2 2 echo 3 3 echo 4 4
-
postgres > JSON|jsonb Manipulation with PostgreSQL - [s]
UPDATE docker_asset SET attributes = jsonb_set(attributes, '{docker}', (attributes->'docker')::jsonb - 'content_digest', true);
-
postgres > Dealing with nested JSON objects (jsonb) in PostgreSQL - [s]
-
Using SELinux | Red Hat Product Documentation - [s]
-
postgres > Where in the DB is the Location of a PostgreSQL tablespace stored - [s]
select spcname ,pg_tablespace_location(oid) from pg_tablespace;
-
postgres|postgresql|patroni - [s]
-
bash - Tee resets exit status is always 0 - [s]
# Example: wrap git command to add trace logging cat << 'EOF' > ./git #!/usr/bin/env bash echo "# $(date --rfc-3339=seconds) Executing git" >> /tmp/git_trace.out export GIT_TRACE=2 GIT_CURL_VERBOSE=2 GIT_TRACE_SETUP=2 /usr/bin/git "$@" 2>/tmp/git_trace.out | tee -a /tmp/git_trace.out exit ${PIPESTATUS[0]} EOF chmod a+x ./git
-
postgres|PostgreSQL > assign variables with SELECT column INTO TEMP variable_tbl - [s]
select role_id into TEMP role_ids from role order by random() limit 11; select member_name into TEMP member_names from membership_mapping where member_type = 'USER' order by random() limit 1; EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM membership_mapping t0 WHERE (((t0.member_name = (select member_name from member_names) OR LOWER(t0.member_name) = LOWER((select member_name from member_names)) OR UPPER(t0.member_name) = UPPER((select member_name from member_names))) AND t0.member_type = 'USER' OR t0.member_name IN ('(all-authenticated-users)') AND t0.member_type = 'GROUP') AND t0.role_id IN (select role_id from role_ids)) ORDER BY t0.context_id ASC, t0.role_id ASC LIMIT 500000;
-
postgres > Optimizing PostgreSQL Performance: How the Fill Factor Setting improve I/O performance - [s]
ALTER TABLE customer_orders SET (fillfactor = 75); # https://www.cybertec-postgresql.com/en/estimating-table-bloat/ CREATE EXTENSION IF NOT EXISTS pgstattuple; # https://www.postgresql.org/docs/14/pgstattuple.html # the last two values are approx_free_space and approx_free_percent SELECT relnamespace::regnamespace::text as ns, relname AS table_name, pgstattuple_approx(oid) AS table_stats FROM pg_class WHERE relkind = 'r';
-
Keep Your postgres|postgresql Stable — Vacuum - [s]
-
postgres|postgresql > Understanding and Monitoring pg_stat_user_indexes - [s]