Re: Foreign Data Wrapper Handler

2020-11-09 Thread Laurenz Albe
r to access a foreign 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: 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: 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: conflict with recovery when delay is gone

2020-11-13 Thread Laurenz Albe
ation conflict? What is in "pg_stat_database_conflicts" on the standby server? 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: Unable to compile postgres 13.1 on Slackware current x64

2020-11-16 Thread Laurenz Albe
"TRUE" are defined in "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: 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: error

Re: Unable to compile postgres 13.1 on Slackware current x64

2020-11-16 Thread Laurenz Albe
ago. I find it 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 > foolh

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: vacuum vs vacuum full

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

Re: autovacuum recommendations for Large tables

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

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: 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: \COPY command and indexes in tables

2020-11-18 Thread Laurenz Albe
; and got to know that 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&quo

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: Performance hit if I create multiple DBs on same instance

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

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: Transaction isolation level Repeatable Read Read Only vs Serializable Read Only

2020-11-26 Thread Laurenz Albe
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

Re: postgres_fdw insert extremely slow

2020-11-26 Thread Laurenz Albe
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: How to debug authentication issues in Postgres

2020-11-26 Thread Laurenz Albe
re 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: How to debug authentication issues in Postgres

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

Re: Storage and querying of filesystem paths

2020-11-30 Thread Laurenz Albe
rested > 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: 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: 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: 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: Set COLLATE on a session level

2020-12-05 Thread Laurenz Albe
ore subtle. For example, if someone 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: User input to queries

2020-12-09 Thread Laurenz Albe
= &p.lname AND p.fname = &p.fname; > - > > 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: pg_ctl.exe deleted on abrupt shutdown of Windows

2020-12-15 Thread Laurenz Albe
tup". > 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: 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: Unexpected result count from update statement on partitioned table

2020-12-18 Thread Laurenz Albe
Filter: (((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: Avoid excessive inlining?

2020-12-22 Thread Laurenz Albe
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: Information schema sql_identifier

2020-12-22 Thread Laurenz Albe
pretty(pg_table_s..." I don't see the problem. Cast "table_name" and "table_schema" to "text" wherever it occurs. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: SQL to query running transactions with subtransactions that exceeds 64

2021-01-05 Thread Laurenz Albe
ql.com/en/subtransactions-and-performance-in-postgresql/ You could export a snapshot with pg_export_snapshot() and see if the resulting file contains the line "sof:1". Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Declarative partitioning and automatically generated row-IDs using BIGSERIAL

2021-01-05 Thread Laurenz Albe
of foreign keys, while that statement is removed from > the docs of Postgres 13. How is a 1:1 relationship guaranteed in newer > version when PRIMARY KEYS are still local to their individual > partition table? There are foreign keys referencing partitioned tables from v12 on. You can guarantee a 1:1 relationship with a unique constraint on the source columns. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Keep needing to run manual analyze

2021-01-06 Thread Laurenz Albe
work better or should I just be looking at > scheduling a manual vacuum/analyze > periodically on all databases? That is not necessary. You should figure out what tables need more frequent ANALYZE runs to get good execution plans and tune autoanalyze for these tables, for example by reducing

Re: SQL to query running transactions with subtransactions that exceeds 64

2021-01-06 Thread Laurenz Albe
on, > query, > state > FROM pg_stat_activity > WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes'; Use xact_start rather than query_start. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Missing declaration of _PG_init()

2021-01-08 Thread Laurenz Albe
> > Should _PG_init(void) be declared in someplace included by postgres.h or > fmgr.h? It is provided by your module, so it must be declared by your module: extern void _PG_init(void); Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: System (and DB) upgrade problem.

2021-01-13 Thread Laurenz Albe
(attached logs) messages, I am missing some libraries, > what should I install? The logs complain about missing the "dblink" library, so you forgot to install the -contrib package. Remember to REINDEX all indexes on string columns, because the collations may have changed. Yours, Laur

Re: How to keep format of views source code as entered?

2021-01-13 Thread Laurenz Albe
be preserved. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: could not fsync file ""pg_wal/xlogtemp.23229"": Input/output error

2021-01-15 Thread Laurenz Albe
files in the data directory. What you can do is move the *complete* data directory to another location with more disk space and start it there. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: ldap connection parameter lookup

2021-01-15 Thread Laurenz Albe
mycompany.com/dc=mycompany,dc=com?description?one?(cn=${PGDATABASE}) I proposed something like that a while ago: https://postgr.es/m/D960CB61B694CF459DCFB4B0128514C2F3442B%40exadv11.host.magwien.gv.at but it was rejected. Perhaps you could come up with a better version. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: System (and DB) upgrade problem., "part 2"

2021-01-18 Thread Laurenz Albe
g/. Where they could be? You would call "initdb" or "postgresql-10-setup" to create a new, empty cluster in version 10 and use that with -D. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Do we need a way to moderate mailing lists?

2021-01-18 Thread Laurenz Albe
coming and unfriendly community. > > Banning should be reserved for the most serious and abusive cases. +1 I personally find Hemil's attitude and his persistent refusal to bottom-post more disruptive than the original question. pgsql-general should remain a low-threshold forum where n

Re: See what options a Postgresql binary was compiled with

2021-01-21 Thread Laurenz Albe
u start it using "Type=oneshot" and "pg_ctl" or "Type=exec" and "postgres", you don't need the systemd callback. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: FDW connections

2021-01-22 Thread Laurenz Albe
y would you want to close such connections before the database session ends? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: running vacuumlo periodically?

2021-01-28 Thread Laurenz Albe
matically run that on all databases. Avoid large objects if you can. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: AW: running vacuumlo periodically?

2021-01-29 Thread Laurenz Albe
t. :-( You'll have to examine the application and see which tables reference the large objects. Looking for columns with type "oid" will help. I recommend that you add an "ON UPDATE OR DELETE" trigger that unlinks orphaned large objects. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: AW: running vacuumlo periodically

2021-01-29 Thread Laurenz Albe
o, it won't. It will just be faster. That sounds like your database consists almost exclusively of large objects... Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Npgsql and the Connection Service File

2021-01-29 Thread Laurenz Albe
the application. No, the service file is part of libpq, and Npgsql doesn't use that. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: SV: Npgsql and the Connection Service File

2021-02-01 Thread Laurenz Albe
s? Either they don't or they write their own class that does that. Perhaps you should contact Npgsql and suggest such a feature. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: permission denied for large object 200936761

2021-02-01 Thread Laurenz Albe
lternatively, use the -B option of pg_dump to skip dumping large objects. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: vacuum is time consuming

2021-02-02 Thread Laurenz Albe
On Tue, 2021-02-02 at 13:44 +0530, Atul Kumar wrote: > Is there any other option to increase the speed of vacuum? For autovacuum, decrease "autovacuum_vacuum_cost_delay". Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: count(*) vs count(id)

2021-02-02 Thread Laurenz Albe
th the same count. But count(id) is more expensive, because it will perform this unnecessary NULLness check for each row. In short: use count(*) if you want to count rows, and use count(x) if you want to count all rows where x IS NOT NULL. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: permission denied for large object 200936761

2021-02-02 Thread Laurenz Albe
On Tue, 2021-02-02 at 00:20 +0200, Andrus wrote: > > Obviously large objects *are* used. > > How to figure out what is this large object ? You can extract it with \lo_export 200936761 'somefile' in psql and examine the file. Ask the people who use that database

Re: permission denied for large object 200936761

2021-02-02 Thread Laurenz Albe
file size is 0 . So? What is your point? Somebody created a large object of size 0. Don't ask me who did it, ask the people who use this database. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: count(*) vs count(id)

2021-02-03 Thread Laurenz Albe
e an index to use and it seems to > > be choosing one of smaller size which leads to less IO and hence returns > > the result faster. > > Would you mind throwing in a test for > > select count(1) ... No need to test. That will be slightly slower because it repeat

Re: vacuumdb not letting me connect to db

2021-02-04 Thread Laurenz Albe
> after running that command I was not able to connect the database > using psql for few minutes. That is to be expected. If you have 300 processes performing I/O and using CPU, your machine will vertainly be overloaded. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: curious vacuum full behavior

2021-02-04 Thread Laurenz Albe
? > > Postgres Version 9.6 VACUUM (FULL) will re-create the indexes too, and "maintenance_work_mem" has an impact on index build speed. But I have no explanation for such a large difference. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: when is useful min_wal_size?

2021-02-04 Thread Laurenz Albe
ivity but has a lower limit of "min_wal_size". If your workload is subject to long lulls followed by activity spikes, raising "min_wal_size" can improve the performance at the beginning of an activity spike. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Request for example using pqconnectstart,pqconnectpoll part.

2021-02-04 Thread Laurenz Albe
play/blob/master/database.c#L404 but it certainly is not the most concise example. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: updating(column) Porting from Oracle Trigger to PostgreSQL trigger

2021-02-05 Thread Laurenz Albe
the UPDATE statement. But you can do that in CREATE TRIGGER: CREATE TRIGGER ... BEFORE UPDATE OF (c3) ON mytable ... Of course that might mean that you cannot do conditional processing in the trigger function, but you have to define several triggers (which could perhaps share a trigger function). Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Which partition scheme makes sense for my time based IoT-datagrams?

2021-02-10 Thread Laurenz Albe
a single ID) and subpartition by timestamp. This will speed up the queries by ID, since only a single partition will be searched. You could then almost be as fast as with a single monolitic table. Don't forget that the speed of an index scan does not (or almost not) depend on the size of the table. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Unable to execute Query in parallel for partitioned table

2021-02-10 Thread Laurenz Albe
list. There must be really large data in this table, so it takes a long time to fetch and sort the rows. Try selecting only the columns you need. Alternatively, add a LIMIT clause. Do you really need all 80 rows? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Which partition scheme makes sense for my time based IoT-datagrams?

2021-02-10 Thread Laurenz Albe
out which partitions to scan takes planning time. Very few queries become notably faster through partitioning. Mostly those are aggregates and joins that match the partitioning scheme, and sequential scans that include the partitioning key. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Assistance on PostgreSQL DB

2021-02-11 Thread Laurenz Albe
On Thu, 2021-02-11 at 08:57 +, arunkumar.sampathku...@cognizant.com wrote: > We would like to know the best practice to maintain PostgreSQL DB health so > that there is no delay in Jabber chat messages. You should hire a knowledgeable DBA. Yours, Laurenz Albe -- Cybertec |

Re: Why is Postgres only using 8 cores for partitioned count? [Parallel Append]

2021-02-15 Thread Laurenz Albe
ition pruning: if the optimizer thinks that it will have to scan a lot of partitions, it will plan a lot of workers. But if the executor reduces that number to 1, we end up with way too many workers. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: certs in connection string

2021-02-15 Thread Laurenz Albe
trusted certificate. No password prompt will be sent to the client. The cn (Common Name) attribute of the certificate will be compared to the requested database user name, and if they match the login will be allowed. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: [LDAPS] Test connection user with ldaps server

2021-02-15 Thread Laurenz Albe
st have bound to "DC=company,DC=example,DC=com?sAMAccountName" as the "ldapbinddn" first. What I would do is experiment with the "ldapsearch" executable from OpenLDAP and see if you can reproduce the problem from the command line. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: MultiXactMemberControlLock contention on a replica

2021-02-15 Thread Laurenz Albe
e difference between primary and standby is not that a different number of multixacts are created, but that you need to read them on the standby and not on the primary. Are the multixacts caused by foreign keys or by subtransactions? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: MultiXactMemberControlLock contention on a replica

2021-02-15 Thread Laurenz Albe
On Mon, 2021-02-15 at 08:03 -0800, Christophe Pettus wrote: > On Feb 15, 2021, at 07:47, Laurenz Albe wrote: > > So my guess would be that the difference between primary and standby is not > > that a > > different number of multixacts are created, but that you need to read

Re: MultiXactMemberControlLock contention on a replica

2021-02-15 Thread Laurenz Albe
On Mon, 2021-02-15 at 12:40 -0800, Christophe Pettus wrote: > > On Feb 15, 2021, at 08:15, Laurenz Albe wrote: > > Right. I cannot think of any other reason, given that the standby only > > allows reading. It's just an "xmax", and PostgreSQL needs to read the

Re: delete old cluster after pg_upgrade with -k option

2021-02-16 Thread Laurenz Albe
ed > hard links with old cluster. It is absolutely safe. It would actually be quite unsafe *not* to delete the old cluster, because if anybody managed to start it, data corruption would be the consequence. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Order by not working

2021-02-16 Thread Laurenz Albe
On Tue, 2021-02-16 at 16:11 -0600, Ron wrote: > SQL is only intuitive to people who've done programming... :) SQL is quite counter-intuitive to people who have only done procedural programming. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: permanent setting of config variables

2021-02-18 Thread Laurenz Albe
user specific config values > that would become accessible to the "SHOW " SQL comand. _product_name := current_setting('company.product'); Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: when is pg_stat_archiver.stats_reset modified?

2021-02-18 Thread Laurenz Albe
ose that field is not "resettable" by the administrator, as I > tried to, but then what drives changes? SELECT pg_stat_reset_shared('archiver'); Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: permanent setting of config variables

2021-02-18 Thread Laurenz Albe
On Thu, 2021-02-18 at 11:42 +, Joao Miguel Ferreira wrote: > On Thu, Feb 18, 2021 at 10:52 AM Laurenz Albe > wrote: > > On Thu, 2021-02-18 at 09:09 +, Joao Miguel Ferreira wrote: > > > I have a few PL/pgSQL functions that use queires like "SHOW > > >

Re: how does PostgreSQL determine how many parallel processes to start

2021-02-19 Thread Laurenz Albe
greSQL will use as many of the planned workers as are currently available (max_parallel_workers). Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: how does PostgreSQL determine how many parallel processes to start

2021-02-19 Thread Laurenz Albe
r" to limit the number of parallel workers available to a single query. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: getting tables list of other schema too

2021-02-24 Thread Laurenz Albe
_0400_job | table | college > > > sys| scheduler_0450_job_argument | table | college > > yes I know that, but my doubt is why \dt is showing tables of other > schemas even I am setting the search_path. The problem is that you are not running PostgreS

Re: Different query result, maybe bad index

2021-02-24 Thread Laurenz Albe
unning different C libraries or C library versions, so that the collations with the same name behave slightly differently. That could lead to the observed behavior with indexes on string data types. Make sure to use the same C library version on both systems. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Tables used by a function

2021-02-26 Thread Laurenz Albe
On Fri, 2021-02-26 at 13:12 +0200, Yambu wrote: > Is there a quick way to list tables used by a function if the function is big > to search for tables manually? No. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: permission denied for pg_temp_XX when vacuuming

2021-03-03 Thread Laurenz Albe
the session that created them, so you can safely ignore these errors. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: A simple question: Why 'pg_ctl: command not found...' ?

2022-03-08 Thread Laurenz Albe
to install PostgreSQL packages from your Linux distribution. Your only problem is that /usr/pgsql-14/bin is not in your PATH environment variable. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Serializable read only deferrable- implications

2022-03-08 Thread Laurenz Albe
RABLE; > > SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY; A transaction started with the first statement will not take any SI locks, nor will it ever receive a serialization error. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: How to explicitly lock and unlock tables in pgsql?

2022-03-17 Thread Laurenz Albe
action which took the lock. The first thing you should do is to make sure that all your database transactions are short. Also, you should nevr explicitly lock tables. Table locks are taken automatically by the SQL statements you are executing. Yours, Laurenz Albe -- Cybertec | https://

Re: Query on WAL Optimization and Streaming Replication

2022-03-17 Thread Laurenz Albe
ication without the need of base back up again? There are three ways: 1. have a WAL archive and configure "restore_command" on the standby 2. set "wal_keep_size" on the primary high enough 3. use a replication slot Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Query on WAL Optimization and Streaming Replication

2022-03-17 Thread Laurenz Albe
"max_wal_size" is not the size of a WAL segment. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: How to explicitly lock and unlock tables in pgsql?

2022-03-18 Thread Laurenz Albe
e when people explicitly lock a table it is not the correct solution. Yours, Laurenz Albe

Re: Leading comments and client applications

2022-03-25 Thread Laurenz Albe
Tom prefers wine: https://postgr.es/m/14929.1358317...@sss.pgh.pa.us Yours, Laurenz Albe

Re: Locking a table read-only temporarilty

2022-04-01 Thread Laurenz Albe
e lock when finished. Could someone hit me with a clue-stick? You'd have to start a transaction and LOCK tab IN SHARE MODE; Commit the transaction to release the lock. However, it is a bad idea to keep transactions with high locks open for a long time. Your real problem might have a better

Re: Trigger functions and FDW tables

2022-04-04 Thread Laurenz Albe
ave nothing inside a database transaction that *could* take a long time (even if it is normally fast). Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Problem with PG 11 database on OrangePi3 (ARMBIAN, ARM64) after disk disrupion (problem with USB disk connection)

2022-04-06 Thread Laurenz Albe
On Wed, 2022-04-06 at 10:57 +0200, W.P. wrote: > Is it possible to repair this? Not unless you tell us what exactly you did, command by command. Yours, Laurenz Albe

Re: Problem with PG 11 database on OrangePi3 (ARMBIAN, ARM64) after disk disrupion (problem with USB disk connection)

2022-04-06 Thread Laurenz Albe
On Wed, 2022-04-06 at 18:41 +0200, W.P. wrote: > W dniu 06.04.2022 o 12:37, Laurenz Albe pisze: > > On Wed, 2022-04-06 at 10:57 +0200, W.P. wrote: > > > Is it possible to repair this? > > Not unless you tell us what exactly you did, command by command. > >

Re: How to get updated order data

2022-04-08 Thread Laurenz Albe
ATE runs in a transaction that hasn't been committed b) the SELECT is running on a standby server, and there is replication lag Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Feedback about hybrid SAN snap and rsync'd approach for large systemcloning

2022-04-13 Thread Laurenz Albe
here feedback re the sanity of this approach. I thought that an unlogged table is rendered empty by recovery, but perhaps I misunderstood what you are doing. Yours, Laurenz Albe

Re: autovacuum_freeze_max_age on append-only tables

2022-04-21 Thread Laurenz Albe
paround VACUUM is a routine activity and does not interfere with DML, just like a normal VACUUM. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: logical replication worker can't find postgis function

2022-04-22 Thread Laurenz Albe
use "search_path" is empty to avoid security problems. Fix your function: ALTER FUNCTION trigger_function() SET search_path = public; Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: logical replication worker can't find postgis function

2022-04-22 Thread Laurenz Albe
On Fri, 2022-04-22 at 15:26 +0200, Willy-Bas Loos wrote: > On Fri, Apr 22, 2022 at 3:20 PM Laurenz Albe wrote: > > > > The trigger function is bad and dangerous, because it relies on the current > > setting of "search_path". > > > > You no

Re: Handling glibc v2.28 breaking changes

2022-04-25 Thread Laurenz Albe
tchover to move to a current operating system on a different machine - REINDEX CONCURRENTLY all indexes on string expressions You could get data corruption and bad query results between the second and the third steps, so keep that interval short. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: pg_stat_activity.query empty

2022-04-26 Thread Laurenz Albe
mpty > > "query"? > > > > https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW > > They've never executed a query.  Probably due to connection pooling opening > connections for the pool but never needing to hand them out. An alternative option is that the last query sent was an empty string. Yours, Laurenz Albe

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