Re: Avoid excessive inlining?

2020-12-22 Thread Laurenz Albe
and not others. I can’t think of a way to do that offhand. Where do you see that? As far as I know, VOLATILE is the best choice if you want the function to be inlined. I would say that the simplest way to prevent a function from being inlined is to set a parameter on it: ALTER FUNCTION f()

Re: Unexpected result count from update statement on partitioned table

2020-12-18 Thread Laurenz Albe
(NOT reserved) AND (task_type = 1)) OR (task_type = 2)) -> Index Scan using task_child_2_task_timestamp_idx on task_child_2 task_parent_8 Filter: (((NOT reserved) AND (task_type = 1)) OR (task_type = 2)) (29 rows) The subquery is executed twice, and the two executions obviously don't return the same results. I am at a loss for an explanation ... Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Very large table: Partition it or not?

2020-12-16 Thread Laurenz Albe
e getting rid of old data. That can be quite painful with a single large table, but it might be trivial with partitioning. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: pg_ctl.exe deleted on abrupt shutdown of Windows

2020-12-15 Thread Laurenz Albe
p". > This smells strongly of filesystem corruption which requires a Windows guru. Not that I am one, but this smacks of anti-virus software that mistakenly thinks "pg_ctl.exe" is malware and removes or "isolates" it. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: User input to queries

2020-12-09 Thread Laurenz Albe
; - > > Suggestions on what I should read to learn more about this subject are > appreciated. You probably need the \prompt psql command: \prompt 'What is "p.lname"' p_lname \prompt 'What is "p.fname"' p_fname SELECT ... WHERE p.lname = :p_lname AND p.fname = :p_fname; Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Set COLLATE on a session level

2020-12-05 Thread Laurenz Albe
meone asks you why an index isn't used to support sorting, you'd always have to remember to ask what collation has been set in the session. Yours, Laurenz Albe

Re: Number of parallel workers chosen by the optimizer for parallel append

2020-12-04 Thread Laurenz Albe
On Wed, 2020-11-25 at 17:36 +0100, Laurenz Albe wrote: > I have a partitioned table, each partition has "parallel_workers = 10" set. > > SET max_parallel_workers_per_gather = 8; > > SET enable_partitionwise_aggregate = on; > > EXPLAIN (COSTS OFF) >

Re: AW: FDW using remote ODBC driver

2020-12-01 Thread Laurenz Albe
On Tue, 2020-12-01 at 15:23 +, Zwettler Markus (OIZ) wrote: > I want to do a Connection FROM Postgres@Linux using fdw + odbc TO > SQL-Server@Windows. Is there any reason for not using tds_fdw? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: PostgreSQL 12.4 Parallel Query doesn't work while EXPLAIN is OK

2020-12-01 Thread Laurenz Albe
ations: - The function is executed after the "Gather" node. Perhaps you didn't define it as PARALLEL SAFE. - Perhaps the tables are small. During a parallel sequential scan, each worker is assigned a range of blocks to scan, so all rows found in a single block are scanned by a single worker. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Storage and querying of filesystem paths

2020-11-30 Thread Laurenz Albe
t; to hear what approach others have taken ? I have not personally taken that approach, but you could give the ltree extension a go. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Laurenz Albe
replication all ::1/128 trust Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: How to debug authentication issues in Postgres

2020-11-26 Thread Laurenz Albe
you more details to error message. The client gets less information, because such information could be useful to an attacker. I'd expect that you get at least the line in pg_hba.conf that was used, which will ease debugging for you. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: postgres_fdw insert extremely slow

2020-11-26 Thread Laurenz Albe
hing like this: > > INSERT INTO foreign.labels (address, labels) > VALUES (), (), (), (); > > postgres_fdw would send it as individual INSERTs? Yes, that's the way the FDW API works. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Transaction isolation level Repeatable Read Read Only vs Serializable Read Only

2020-11-26 Thread Laurenz Albe
only case, I do not see how REPEATABLE READ could differ > from SERIALIZABLE. Yet [1] explains that: There is an example in the Wiki: https://wiki.postgresql.org/wiki/SSI#Read_Only_Transactions In that example, serializability is broken only because of a READ ONLY transaction. Yours, Laurenz

Number of parallel workers chosen by the optimizer for parallel append

2020-11-25 Thread Laurenz Albe
-> HashAggregate Group Key: z_flat.applicant_name -> Seq Scan on xyz_1 z_flat [8 more such partition scans] (33 rows) How does the optimizer decide to use 4 parallel workers? No matter what I try, I cannot influence that number. Yours, Laurenz Albe

Re: Performance hit if I create multiple DBs on same instance

2020-11-25 Thread Laurenz Albe
suming activities on them again. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Set COLLATE on a session level

2020-11-20 Thread Laurenz Albe
> affected. There is no way to do that in PostgreSQL. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: \COPY command and indexes in tables

2020-11-18 Thread Laurenz Albe
at the loading nearly stops (without any real CPU > consumption) in the middle. The wild guess is that we forgot to DROP the > indexes on > the tables. If it does not consume CPU, it must be stalled somehow. Are there any wait events in "pg_stat_activity". Yours, Laurenz

Re: Problem with compiling extensions with Postgres Version 13

2020-11-18 Thread Laurenz Albe
ince 9.2, as far as I can tell. The underscore in front of the function name is relevant: perhaps you compile your function using a different "calling convention" than was used to build PostgreSQL? Sorry, but I am not a Windows expert. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: psql backward compatibility

2020-11-18 Thread Laurenz Albe
u upgrade, move to v13. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: autovacuum recommendations for Large tables

2020-11-18 Thread Laurenz Albe
cuum > > Hope you find it useful. Then I can chime in with https://www.cybertec-postgresql.com/en/tuning-autovacuum-postgresql/ Yours, Laurenz Albe

Re: vacuum vs vacuum full

2020-11-18 Thread Laurenz Albe
hat they create (long duration of ATTACH/DETACH PARTITION, index fragmentation). Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: pg_upgrade from 12 to 13 failes with plpython2

2020-11-18 Thread Laurenz Albe
R: could not access file > "$libdir/plpython2": No such file or directory > In database: argosrm > In database: template1 The problematic function is perhaps in another database. Look everywhere. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Unable to compile postgres 13.1 on Slackware current x64

2020-11-16 Thread Laurenz Albe
hard to believe that sprinkling "#include > " into random places is either necessary (on modern platforms > anyway) or a good idea (if we're not using , this seems pretty > much guaranteed to break things); so I think the rest of that patch is > foolhardy. How about thi

Re: Unable to compile postgres 13.1 on Slackware current x64

2020-11-16 Thread Laurenz Albe
On Mon, 2020-11-16 at 22:17 +1300, Thomas Munro wrote: > On Mon, Nov 16, 2020 at 10:10 PM Laurenz Albe > wrote: > > > On Mon, 2020-11-16 at 09:15 +0200, Condor wrote: > > > collationcmds.c: In function ‘get_icu_language_tag’: > > > collationcmds.c:467:51: er

Re: Unable to compile postgres 13.1 on Slackware current x64

2020-11-16 Thread Laurenz Albe
"umachine.h", which is a header file for the "libicu" library. PostgreSQL includes "unicode/ucol.h", which will include "umachine.h" (via "utypes.h"), so that should be fine. Are your libicu headers installed under /usr/include/unicode? Do you get any messages about missing include files earlier? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Error: checkpoint occurs too frequently

2020-11-13 Thread Laurenz Albe
uently. You should do exactly what the hint that goes with the message recommends. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: conflict with recovery when delay is gone

2020-11-13 Thread Laurenz Albe
tion conflict? What is in "pg_stat_database_conflicts" on the standby server? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Check constraints do not seem to be working!!!

2020-11-11 Thread Laurenz Albe
On Wed, 2020-11-11 at 11:47 +0100, Tomas Vondra wrote: > you may do this, for example: > > (b it not null and b = true) and (c is not null) > > Or something like that. My (equivalent) suggestion: b IS TRUE AND c IS NOT NULL Yours, Laurenz Albe -- Cybertec | https

Re: Foreign Data Wrapper Handler

2020-11-09 Thread Laurenz Albe
.in pg_hba.conf? No, in SQL: CREATE FOREIGN SERVER somename FOREIFN DATA WRAPPER postgres_fdw OPTIONS (...); Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Foreign Data Wrapper Handler

2020-11-09 Thread Laurenz Albe
ign server. Create one per user and foreign server (or a single one for PUBLIC = everybody). - The foreign table describes how a remote table is mapped locally. Define one per table that interests you. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Database system was interrupted. Possible reasons for a database to suddenly stop accepting connections?

2020-11-09 Thread Laurenz Albe
SQL got restarted and recovered at 12:04. Then there were two more clean shutdowns and restarts at 12:26 and 15:02. Your problem is probably the first crash. If you don't have any indication that the machine crashed, look into the kernel log - perkaps the out-of-memory killer struck (assuming this is Linux). Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: how to check that recovery is complete

2020-11-06 Thread Laurenz Albe
s before. The alternative way is running this after you connect: SELECT pg_is_in_recovery(); If that returns TRUE, recovery is not done yet. Back out, wait a while, then try again. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: CentOS 7 yum package systemd bug?

2020-11-04 Thread Laurenz Albe
ces that depend on PostgreSQL can rely on it being available. I think that is a good thing to have. I am no systemd expert, but as far as I know services are started in parallel, so it shouldn't block your boot process for other services that don't depend on PostgreSQL. The best place to disc

Re: facing problem in outparameters in c

2020-10-28 Thread Laurenz Albe
IBPQ-EXEC-SELECT-INFO > can you please check once attached two text files. I looked, and the C code is unreadable. You seem to be mixing embedded SQL and libpq calls, which you shouldn't. There is great value in a consistent indentation style. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: facing problem in outparameters in c

2020-10-27 Thread Laurenz Albe
calling defined? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Initplan placed at the righttree or the lefttree of joinnode

2020-10-22 Thread Laurenz Albe
=0.00..0.01 rows=1 width=4) -> Seq Scan on pgbench_accounts b (cost=0.00..26394.00 rows=100 width=97) -> Hash (cost=28894.00..28894.00 rows=10 width=97) -> Seq Scan on pgbench_accounts a (cost=0.00..28894.00 rows=10 width=97) Filter: (bid = $0) (8 rows) Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Date Format 9999-12-31-00.00.00.000000

2020-10-16 Thread Laurenz Albe
mance (index usage?). > > Or is > > TO_TIMESTAMP('-12-31-00.00.00.00', '-MM-DD-HH24.MI.SS.US') > > the only way? And isn't it possible to define this like NLS parameters in > Oracle > system wide? I would replace them with 'infinity', which is a valid timestamp value in PostgreSQL.

Re: Question on postgres certified OS platforms

2020-10-16 Thread Laurenz Albe
ystems that are supported: https://www.postgresql.org/docs/current/supported-platforms.html Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: character datatype explaination sought

2020-10-15 Thread Laurenz Albe
version the type cast is explicit. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Any interest in adding match_recognize?

2020-10-12 Thread Laurenz Albe
On Fri, 2020-10-09 at 09:25 -0700, Guyren Howe wrote: > I can find no evidence it’s ever been discussed here and there’s no mention > of it on the PG website. > > So: is anyone considering adding this feature? I think it would be useful, but non-trivial to implement. Yours,

Re: Problem close curser after rollback

2020-09-30 Thread Laurenz Albe
server during commit. So you could create the WITH HOLD cursor, commit and then start your individual transactions. Don't forget to close the cursor when you are done, else it will use server resources until you close the database connection. Another option is to use savepoints, but you

Re: Question about using ICU

2020-09-28 Thread Laurenz Albe
dex altogether, if possible. That couldn't be avoided anyway if you change the collation no matter if you do it on the database or on the column level. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Returning timestamp with timezone at specified timezone irrespective of client timezone

2020-09-28 Thread Laurenz Albe
(current_timestamp, '+08'); format_timestamp --- 2020-09-28 17:15:25.083677+08 (1 row) Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Question about using ICU

2020-09-28 Thread Laurenz Albe
n of all columns to use the new collation. psql's \gexec may help. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Foreign tables, user mappings and privilege setup

2020-09-21 Thread Laurenz Albe
. If several users should have the same credentials, use a group. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Effective IO Concurrency

2020-09-14 Thread Laurenz Albe
s/13/release-13.html gives me 1176. > However, in the documentation > https://www.postgresql.org/docs/13/runtime-config-resource.html#GUC-EFFECTIVE-IO-CONCURRENCY > it says that the maximum value allowed is 1000. Then use the value 1000... Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Dirty buffers with suppress_redundant_updates_trigger

2020-09-13 Thread Laurenz Albe
uffers: local read=8334 dirtied=8334 written=8331 > Planning Time: 0.429 ms > Trigger z_min_update: time=57.069 calls=100 > Execution Time: 4174.785 ms > (15 rows) These are probably the "hint bits" set on newly committed rows by the first reader. Note that te blocks

Re: Schema/ROLE Rename Issue

2020-09-09 Thread Laurenz Albe
fier is used, so that renaming doesn't break anything, functions are stored as string literals and parsed at execution time. You'll have to edit all your functions (or undo the renaming). Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: compatibility matrix between client and server

2020-09-07 Thread Laurenz Albe
dn't exist back then. However, if I were you, I'd refuse to support any PostgreSQL major version that is no longer supported by the project: https://www.postgresql.org/support/versioning/ So, nothing older than 9.5. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Bitmap scan seem like such a strange choice when "limit 1"

2020-09-04 Thread Laurenz Albe
scan is wise then you expect one row. PostgreSQL estimates that 2817675 rows satisfy the index condition and expects that it will have to scan many of them before it finds one that satisfies the filter condition. That turns out to be a wrong guess. You could create an index on (cars_ref, t), then PostgreSQL will certainly pick an index scan. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: 回复: Is it possible to set end-of-data marker for COPY statement.

2020-09-01 Thread Laurenz Albe
Please, don't top-post on these lists. On Tue, 2020-09-01 at 09:20 +, Junfeng Yang wrote: > > 发件人: Laurenz Albe > > On Tue, 2020-09-01 at 06:14 +, Junfeng Yang wrote: > > > As described in the doc , the TEXT format recognizes > > > backslash-per

Re: Is it possible to set end-of-data marker for COPY statement.

2020-09-01 Thread Laurenz Albe
is that the file contains bad data. You are using the default TEXT format of copy, and backslashes must be escaped there. Everything will work as you want if you write the first line correctly like 122,as\\.d,adad Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: How bad is using queries with thousands of values for operators IN or ANY?

2020-08-31 Thread Laurenz Albe
h a certain condition, then select all rows from B where the foreign key matches any IDs from the first query. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: When are largobject records TOASTed into pg_toast_2613?

2020-08-31 Thread Laurenz Albe
gt; Is there another catalog table where the TOAST reference can be located? Yes, in the table itself. It seems like some values in pg_largeobject were stored in the TOAST table after all. I told you it was dangerous... I guess you'll have to migrate with dump/restore. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Postgres and alias

2020-08-28 Thread Laurenz Albe
2. Use a subquery: select ls_number, substr (ls_number, 3, 3) FROM (SELECT '1234567890' AS ls_number) AS q; 3. Use a CTE: WITH x AS (SELECT '1234567890' as ls_number) SELECT ls_number, substr (ls_number, 3, 3) FROM x; Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Are advisory locks guaranteed to be First Come First Serve? And can the behavior be relied upon?

2020-08-27 Thread Laurenz Albe
in PostgreSQL. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Creating many tables gets logical replication stuck

2020-08-25 Thread Laurenz Albe
t I did not focus on this scenario. > > The walsender process can get stuck. Thanks you both, that is indeed the same problem, and the linked thread helps understand the problem. Yours, Laurenz Albe

Re: Migration of DB2 java stored procedures to PostgreSQL

2020-08-24 Thread Laurenz Albe
de to PL/Python or PL/Perl. If the code is just glue around some SQL, PL/pgSQL might be the best choice. Yours, Laurenz Albe -- +43-670-6056265 CYBERTEC PostgreSQL International GmbH Gröhrmühlgasse 26, A-2700 Wiener Neustadt Web: https://www.cybertec-postgresql.com

Re: When are largobject records TOASTed into pg_toast_2613?

2020-08-21 Thread Laurenz Albe
relname = 'pg_toast_2613';" )" > toast_tuples="$(psql -U postgres --dbname=${database_name} -At --no-psqlrc > -c "select reltuples from pg_class where relname = 'pg_toast_2613';" )" > [...] That are just the estimates. You need to ascertain that the ta

Re: When are largobject records TOASTed into pg_toast_2613?

2020-08-21 Thread Laurenz Albe
t; tables with a toast relation as of HEAD. Yes, I was behind the times. Catalog tables *do* have TOAST tables, but not all of them, and "pg_largeobject" is one that doesn't. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: When are largobject records TOASTed into pg_toast_2613?

2020-08-21 Thread Laurenz Albe
On Fri, 2020-08-21 at 15:46 +0200, Thomas Boussekey wrote: > Le ven. 21 août 2020 à 15:10, Laurenz Albe a écrit > : > > On Fri, 2020-08-21 at 14:00 +0200, Thomas Boussekey wrote: > > > Working on a PostgreSQL 9.5 to 12 upgrade, I encounter problems on a > > > P

Re: is date_part immutable or not?

2020-08-21 Thread Laurenz Albe
partition key expression must be marked IMMUTABLE Two approaches: 1. Use "timestamp without time zone". 2. Partition in some other way, for example BY RANGE (log_time). Your list partitions don't make a lot of sense to me. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: When are largobject records TOASTed into pg_toast_2613?

2020-08-21 Thread Laurenz Albe
es have no TOAST tables in PostgreSQL, so I wonder how your "pg_largeobject" table could have grown one. Did you do any strange catalog modifications? The safest way would be to upgrade with pg_dumpall/psql. That should get rid of that data corruption. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Creating many tables gets logical replication stuck

2020-08-21 Thread Laurenz Albe
h +0.76% [.] RelfilenodeMapInvalidateCallback 0.63% [.] InvalidateCatalogSnapshot +0.62% [.] SysCacheInvalidate What could be causing this? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Loading Oracle Spatial Data to Postgresql

2020-08-21 Thread Laurenz Albe
EOMETRY MDSYS.SDO_GEOMETRY If the geometries are not exotic, oracle_fdw would do the trick. You won't be able to install it on a hosted database though. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Database logins taking longer and longer, showing up as "authentication" in ps(1)

2020-08-18 Thread Laurenz Albe
catoin configured? I'd "strace" a connection that is hanging in "authenticating" and see what the process does. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Implement a new data type

2020-08-11 Thread Laurenz Albe
s.html https://www.postgresql.org/docs/current/extend-pgxs.html Yours, Laurenz Albe

Re: Keeping state in a foreign data wrapper

2020-08-11 Thread Laurenz Albe
it. > > So is there any simple way to do implement such shared thread/process safe > state? I would create a table as part of the extension and use SPI to store the data there. Yours, Laurenz Albe

Re: Doubt in mvcc

2020-07-14 Thread Laurenz Albe
here is always a certain version (the latest) that can be updated, so this is the same no matter if you have MVCC or not: if two sessions want to update the same row, one has to wait until the other is done. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: BigSerial and txid issuance

2020-07-09 Thread Laurenz Albe
IDs are assigned when a transaction is about to modify data, and for identity columns you get the next value when the backing sequence is called. There is no guarantee that both have to happen in the same order? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Basic question about structuring SQL

2020-07-07 Thread Laurenz Albe
subtransactions. In the inner scripts, don't use BEGIN, but SAVEPOINT . Instead of ROLLBACK in the inner script, use ROLLBACK TO SAVEPOINT . Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: survey: psql syntax errors abort my transactions

2020-07-06 Thread Laurenz Albe
NAME TO t1; > > COMMIT; > > How so, since it does not carry over indexes, foreign keys, triggers, > partition references, etc? It is an example of what a transaction could look like that would suffer from statement-level rollback. I am not claimimg that that code as such

Re: survey: psql syntax errors abort my transactions

2020-07-03 Thread Laurenz Albe
n while teaching a class when I made a typo inside a transaction. Still I prefer the way things are currently. Teaching classes is not the main use case of psql. Yours, Laurenz Albe

Re: survey: psql syntax errors abort my transactions

2020-07-03 Thread Laurenz Albe
uot; messages when your transaction fails. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Postgresql HA Cluster

2020-06-29 Thread Laurenz Albe
tion, though. There are some commercial solutions for that, but be warned that it would require non-trivial changes to your application. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Hiding a GUC from SQL

2020-06-21 Thread Laurenz Albe
own processes? Perhaps you can plug that hole that way, but that was just the first thing that popped in my head. Don't underestimate the creativity of attackers. I for one would not trust my ability to anticipate all possible attacks, and I think that would be a bad security practice. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Feature suggestion: auto-prefixing SELECT query column names with table/alias names

2020-06-21 Thread Laurenz Albe
s I don't see the problem so much. Here, the tables will be returned in the order you specify them in the query. So if you have "b JOIN a", the result columns will always be first all columns from "b", then all columns from "a". So you can easily figure ou

Re: Conflict with recovery on PG version 11.6

2020-06-20 Thread Laurenz Albe
ime window when session is active > on standby host. Perhaps heap only tuple chain pruning. Have you got "n_tup_hot_upd" > 0 somewhere in "pg_stat_user_tables"? Then any reader can "micro-vacuum" blocks with such tuples. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Conflict with recovery on PG version 11.6

2020-06-19 Thread Laurenz Albe
give any hints for anyone? Or how to find right version of source > code what to analyse? Yes, that are conflicts with VACUUM. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: HASH partitioning not working properly

2020-06-19 Thread Laurenz Albe
10.0) * 10; ?column? -- 7 (1 row) So that should end up in the eighth partition. You have no choice which hash function to use for partitioning. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: HASH partitioning not working properly

2020-06-19 Thread Laurenz Albe
> > How can I see the output of hash function that is used internally? In the case of "integer", the hash function is "pg_catalog"."hashint4". Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: autovacuum failing on pg_largeobject and disk usage of the pg_largeobject growing unchecked

2020-06-18 Thread Laurenz Albe
> connection read timeout). Is it possible to configure th read timeout for > psql? I have never heard about a connection read timeout for "psql". I'd look into the server log; perhaps there is an error that indicates data curruption that crashes the server? Yours, Laurenz Albe

Re: Hiding a GUC from SQL

2020-06-18 Thread Laurenz Albe
y be other things to try. It is mostly useless to try to keep a superuser from doing anything that the "postgres" operating system user can do. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Conflict with recovery on PG version 11.6

2020-06-18 Thread Laurenz Albe
It need not be caused by VACUUM; look which counter in "pg_stat_database_conflicts" has increased. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Conflict with recovery on PG version 11.6

2020-06-18 Thread Laurenz Albe
ted ACCESS EXCLUSIVE locks that conflict with queries - replicated ACCESS EXCLUSIVE locks that cause deadlocks - buffer pins that are needed for replication but held by a query - dropped tablespaces that hold temporary files on the standby > I just wondering what would be impact when I increase value for > autovacuum_vacuum_scale_factor > in order force vacuuming process postpone the clean up process. That won't help, it will just get your primary bloated. I told you the remedies above, why don't you like them? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: ESQL/C no indicator variables ./. error -213

2020-06-18 Thread Laurenz Albe
] Failure to do that causes an error (which you catch). If a statement causes an error, you cannot rely on the state of any host valiable that gets set by that statement. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Conflict with recovery on PG version 11.6

2020-06-17 Thread Laurenz Albe
ly avoid replication conflicts. Trying to have both no delay in applying changes and no cancelled queries is often not possible without seriously crippling autovacuum. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Something else about Redo Logs disappearing

2020-06-16 Thread Laurenz Albe
On Tue, 2020-06-16 at 00:28 +0200, Peter wrote: > On Mon, Jun 15, 2020 at 09:46:34PM +0200, Laurenz Albe wrote: > ! On Mon, 2020-06-15 at 19:00 +0200, Peter wrote: > ! > And that is one of a couple of likely pitfalls I perceived when > ! > looking at that new API. > ! > !

Re: Something else about Redo Logs disappearing

2020-06-15 Thread Laurenz Albe
> people will usually not do that. And that's why I consider that > new API as rather dangerous. ... so this is moot. Yours, Laurenz Albe

Re: TOAST table size in bytes growing despite working autovacuum

2020-06-15 Thread Laurenz Albe
t settings), I should likely make the autovacuuming on the > TOAST table even more aggressive via > toast.autovacuum_vacuum_scale_factor tinkering, right? No, the correct way is to reduce "autovacuum_vacuum_cost_delay". Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: TOAST table size in bytes growing despite working autovacuum

2020-06-15 Thread Laurenz Albe
│ 0.27 > free_space │ 669701052 > free_percent │ 93.56 Indeed, the table is almost entirely air. You should schedule down time and run a VACUUM (FULL) on that table. That will rewrite the table and get rid of the bloat. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: SV: pg_service.conf and client support

2020-06-15 Thread Laurenz Albe
nnot > find any examples om how to construct a connectionstring that PostgreSQL ODBC > will accept? After looking at the code, I am no longer sure. There doesn't seem to be a way to specify a general connection string. You could try setting the environment variable PGSERVICE to specify

Re: Something else about Redo Logs disappearing

2020-06-15 Thread Laurenz Albe
and returns "backup_label" accordingly. That means: the caller of the scripts has to make sure not to start a second backup while the first one is running. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Something else about Redo Logs disappearing

2020-06-15 Thread Laurenz Albe
the wrong "backup_label", you end up with silent data > corruption. > > ... this. Of course, if you do arbitrary nonsense like restoring a backup without "backup_label", you will get arbitrary data corruption. It is a fundamental principle that, apart from "backup_l

Re: Oracle vs. PostgreSQL - a comment

2020-06-15 Thread Laurenz Albe
If you GRANT a permission on a table to a user, you may get an entry in "pg_catalog.pg_shdepend", which is a global table (it is shared by all databases). Now if you want to recover a single database, and you get a WAL entry for that table, you'd have to "logically decode" that entry to figure out if it should be applied or not (because it references a certain database or not). Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: pg_service.conf and client support

2020-06-15 Thread Laurenz Albe
eSQL ODBC server can use pg_service.conf - NpgSQL cannot use the file. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: TOAST table size in bytes growing despite working autovacuum

2020-06-15 Thread Laurenz Albe
m_scale_factor=0.05, > toast.autovacuum_vacuum_cost_limit=1000 It is not surprising if there are more entries in the TOAST table than in the base table: a big value will be split in several chunks, each of which is an entry in the TOAST table. To see if the TOAST table is bloated, use pgstattuples: SELECT * FROM pgstattuple('pg_toast.pg_toast_293406'); Vacuum does not remove existing bloat, it just prevents increased bloat. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Something else about Redo Logs disappearing

2020-06-13 Thread Laurenz Albe
> backup? Do I correctly assume that such mistake gets somehow detected, > as otherwise it would have just the same unwelcome effects > (i.e. silent data corruption) as no backup_label at all? If you have the wrong "backup_label", you end up with silent data corruption

Re: Something else about Redo Logs disappearing

2020-06-11 Thread Laurenz Albe
On Thu, 2020-06-11 at 22:35 +0200, Magnus Hagander wrote: > I believe somebody around that time also wrote a set of bash scripts that can > be used in a pre/post-backup-job combination with the current APIs. https://github.com/cybertec-postgresql/safe-backup Yours, Laurenz Albe -- Cy

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