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

2021-01-16 Thread Alvaro Herrera
On 2021-Jan-16, Bruce Momjian wrote: > On Sat, Jan 16, 2021 at 02:50:58PM -0300, Álvaro Herrera wrote: > > On 2021-Jan-16, Hemil Ruparel wrote: > > > > > Okay. I will not reply to them. Enough mental cycles wasted > > > > One way you could help, is by learning what top-posting is, learning not >

Re: Error messages on duplicate schema names

2021-01-19 Thread Alvaro Herrera
On 2021-Jan-15, Michael Paquier wrote: > On Wed, Jan 06, 2021 at 07:15:24PM +0200, Andrus wrote: > > Should duplicate schema names accepted or should their usage throw better > > error messages. > > This means that we are one call of CommandCounterIncrement() short for > such queries, and similar

Re: How to post to this mailing list from a web based interface

2021-01-28 Thread Alvaro Herrera
On 2021-Jan-28, Ravi Krishna wrote: > I am planning to switch to a web based tool to read this mailing list. That's great. > While reading is easy via web, how do I post a reply from web. Yeah, "how" indeed. > I recollect there use to be a website from where one can reply from web. The commun

Re: How to post to this mailing list from a web based interface

2021-01-28 Thread Alvaro Herrera
On 2021-Jan-28, Ravi Krishna wrote: > > Everyone is free to use whatever he/she wants. For me a we based MUA > > would be the worst thing ever. > > Oh well. I have created a seperate email account for this to keep the > clutter out. In any half-decent email program, you can tag incoming email

Re: How to post to this mailing list from a web based interface

2021-02-15 Thread Alvaro Herrera
On 2021-Feb-15, Adrian Klaver wrote: > On 2/15/21 9:24 AM, Thomas Guyot wrote: > > > The "download mbox" option doesn't work, I get asked for a user/password > > every time (I would've downloaded archives for the lats two months to > > get continuation on most threads). > > The user/password is

Re: PostgreSQL URI

2021-02-26 Thread Alvaro Herrera
On 2021-Feb-25, Paul Förster wrote: > So, my suggestion is: > > postgresql://[user[:password]@][[host][:port]][,...][/dbname][?param1=value1&...] > > Still, I think that it's an improvement, because it makes clear that not only > the port, but also the host may be repeated. I wonder if we shou

Re: PostgreSQL URI

2021-02-26 Thread Alvaro Herrera
On 2021-Feb-26, Paul Förster wrote: > Hi Tom, > > > On 26. Feb, 2021, at 15:51, Tom Lane wrote: > > > > +1. I think you could lose the outer brackets in hostspec in > > this formulation, ie given that hostspec is already bracketed > > above, it should be enough to write > > > >hostspec is

Re: Localizing stored functions by replacing placeholders in their body

2021-03-02 Thread Alvaro Herrera
On 2021-Mar-02, Alexander Farber wrote: > CREATE OR REPLACE FUNCTION localize_hello() > RETURNS text AS > $func$ > SELECT '$(hello)'; > $func$ LANGUAGE sql IMMUTABLE; I'm not sure this is a great approach to in-database translations: you have one function per string, which is cumb

Re: Locks in creating a partition in CREATE TABLE vs ALTER TABLE

2021-03-02 Thread Alvaro Herrera
On 2021-Mar-02, Asaf Flescher wrote: > I'm not sure if this is a bug or I'm missing something regarding how > partitioning is supposed to work but I've noticed (in Postgres 12.6) that > if I have a partitioned table, and then try to add a partition to it via > CREATE TABLE ... PARTITION OF, the st

Re: PG12: Any drawback of increasing wal_keep_segments

2022-03-24 Thread Alvaro Herrera
On 2022-Mar-22, Shukla, Pranjal wrote: > Team, > Are there any disadvantages of increasing the “wal_keep_segments” to a > higher number say, 500? Will it have any impact on performance of > streaming replication, on primary or secondary servers? No. It just means WAL will occupy more disk space.

Re: support for DIN SPEC 91379 encoding

2022-03-27 Thread Alvaro Herrera
On 2022-Mar-27, Ralf Schuchardt wrote: > where did you read, that this DIN SPEC 91379 norm is incompatible with UTF-8? > > In the document „String.Latin+ 1.2: eine kommentierte und erweiterte > Fassung der DIN SPEC 91379. Inklusive einer umfangreichen Liste häufig > gestellter Fragen. Herausgegeb

Re: support for DIN SPEC 91379 encoding

2022-03-28 Thread Alvaro Herrera
On 2022-Mar-28, Peter J. Holzer wrote: > On 2022-03-27 14:06:25 -0400, Tom Lane wrote: > > We follow that spec, so depending on what DIN 91379 *actually* says, > > we might have additional reasons not to be in compliance. I don't > > read German unfortunately. > > It defines minimal character s

Re: "create function... depends on extension..." not supported. Why?

2022-04-27 Thread Alvaro Herrera
On 2022-Apr-26, Tom Lane wrote: > I suppose that "DEPENDS ON EXTENSION" was modeled after the commands > to control extension membership, which likewise exist only in ALTER > form because CREATE's behavior for that is hard-wired. If you wanted > to hand-wave a lot, you could maybe claim that owne

Re: parallel-processing multiple similar query tasks - any example?

2022-04-28 Thread Alvaro Herrera
On 2022-Apr-28, Shaozhong SHI wrote: > multiple similar query tasks are as follows: > > select * from a_table where country ='UK' > select * from a_table where country='France' > and so on > > How best to parallel-processing such types of multiple similar query tasks? > > Any example available?

Re: parallel-processing multiple similar query tasks - any example?

2022-04-28 Thread Alvaro Herrera
On 2022-Apr-28, Shaozhong SHI wrote: > Why sleep(1)? It is sleeping to show that they are running concurrently. If it runs five sleeps of one second each and the whole command lasts one second, then all sleeps ran in parallel. Had the whole command taken five seconds, you would know that the qu

Re: parallel-processing multiple similar query tasks - any example?

2022-04-28 Thread Alvaro Herrera
On 2022-Apr-28, Shaozhong SHI wrote: > Expand and explain please. No, thanks. -- Álvaro Herrera

Re: ADD COLUMN ts tsvector GENERATED too slow

2022-07-06 Thread Alvaro Herrera
On 2022-Jul-06, Florents Tselai wrote: > Actually, I monitored my disk usage and it was **definitely** working as > It had already eaten up an additional 30% of my disk capacity. Adding a column like this requires creating a second copy of the table, copying all the contents from the old table (

Re: lifetime of the old CTID

2022-07-06 Thread Alvaro Herrera
On 2022-Jul-06, Matthias Apitz wrote: > This gives in the DB layer a CURSOR of say 100.000 rows of the > 3.000.000 in the table. Now the application fetches row by row and see > if something should be done with the row. If so, the DB layer must > LOCK the row for update. It does so using the CTID.

Re: Password reset link / 'less' does not exit in psql version 13.4

2022-07-25 Thread Alvaro Herrera
On 2022-Jul-25, Michael J. Baars wrote: > No, it's psql. Setting PAGER to "more -e" solved the problem l, but I never > had to before. There are no other variables affecting this behavior, so it > must be psql internal default piping command that has changed. Perhaps the settings are in the envir

Re: Support for dates before 4713 BC

2022-08-22 Thread Alvaro Herrera
Hello Stefan, Alexander, On 2022-Aug-22, stefan eichert wrote: > I can also fully support what Alex has written. I am an archaeologist at > the Natural History Museum Vienna and PostgreSQL is a perfect Open Source > software and we really love working with it for our archaeological and > (pre)his

Re: Missing query plan for auto_explain.

2022-08-30 Thread Alvaro Herrera
On 2022-Aug-30, Matheus Martin wrote: > Our Postgres recently started reporting considerably different > execution times for the same query. When executed from our JDBC > application the Postgres logs report an average execution time of 1500 > ms but when the query is manually executed through `ps

Re: Missing query plan for auto_explain.

2022-08-30 Thread Alvaro Herrera
On 2022-Aug-30, Matheus Martin wrote: > Good idea on using an actual prepared statement but unfortunately it didn't > produce any different result. I should have also mentioned to try the EXPLAIN EXECUTE six times and see if the last one produces a different plan. That's when it switches from pl

Re: is there still a memory leak with hash joins in PG 12.11 ?

2022-09-28 Thread Alvaro Herrera
On 2022-Sep-28, Zwettler Markus (OIZ) wrote: > I found this blog post talking about a memory leak having hash joins due to a > larger work_mem. > https://gist.github.com/luhn/2b35a9b31255e3a6a2e6a06d1213dfc9 Oh dear, is that what passes for a blog post these days? > Does anyone know if this pro

Re: fully qualified domain names and .pgpass

2022-10-04 Thread Alvaro Herrera
On 2022-Oct-04, Ron wrote: > Sometimes (both interactively and via script) I access a remote Pg server > via just the bare host name "foobar", and other times via the FQDN > "foobar.example.com". > > I've only been able to get this to work by having two lines in the .pgpass > file: Maybe it wou

Re: Weird planner issue on a standby

2022-10-11 Thread Alvaro Herrera
On 2022-Oct-11, Tom Lane wrote: > Are there any tables in this query where extremal values of the join > key are likely to be in recently-added or recently-dead rows? Does > VACUUM'ing on the primary help? I remember having an hypothesis, upon getting a report of this exact problem on a customer

Re: How to store "blobs" efficiently for small and large sizes, with random access

2022-10-19 Thread Alvaro Herrera
On 2022-Oct-19, Dominique Devienne wrote: > Upfront, I have to state that I'm not keen on lo, because of security > considerations. We store blobs in many different schemas, and users > can access some schemas, and not others. So the fact the lo table is > unique for the whole database would allow

Re: How to store "blobs" efficiently for small and large sizes, with random access

2022-10-19 Thread Alvaro Herrera
On 2022-Oct-19, Dominique Devienne wrote: > Anybody has an answer to my question regarding how substr() works on > bytea values? I.e. is it "pushed down" / optimized enough that it > avoids reading the whole N-byte value, to then pass it to substr(), > which then returns an M-byte value (where M

Re: possible bug

2022-10-24 Thread Alvaro Herrera
On 2022-Oct-21, Tom Lane wrote: > "David G. Johnston" writes: > > On Fri, Oct 21, 2022 at 4:52 PM Ravi Krishna wrote: > >> on a diff note, is the word memoize inspired from Perl Module memoize > >> which use to do the same thing. > > > It is a general functional programming concept - not sure o

Re: MERGE output doubt

2022-11-17 Thread Alvaro Herrera
e you saying that it should have been affected by the same bug? -- Álvaro HerreraBreisgau, Deutschland — https://www.EnterpriseDB.com/ >From 4282eadc0af3061dc53a5bc1ffcdd51b03cc28c4 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 17 Nov 2022 11:58:42 +0100 Subject: [PATCH]

Re: MERGE output doubt

2022-11-17 Thread Alvaro Herrera
On 2022-Nov-17, Alvaro Herrera wrote: > On 2022-Oct-20, Luca Ferrari wrote: > > > I was expecting an output tag like "MERGE 0" since both branches have > > "do nothing", so no tuples should be updated at all on the target > > table. > > Hmm,

Re: PostgreSQL extension for processing Graph queries (Apache AGE)

2022-11-30 Thread Alvaro Herrera
On 2022-Nov-29, Young Seung Andrew Ko wrote: > Hello PostgreSQL users, > > https://github.com/apache/age > Apache AGE is an Apache 2-licensed open source PostgreSQL extension for > storing Graph data. > > The current version of Apache AGE is to enable PostgreSQL users to use > Neo4j's openCypher

Re: gexec from command prompt?

2023-01-12 Thread Alvaro Herrera
On 2023-Jan-12, Ron wrote: > Postgresql 12.11 > > This might be more of a bash question, or it might be a psql vs engine > problem. > > I want to run this query using psql from a bash prompt: > select format('SELECT ''%s'', MIN(part_date) FROM %s;', table_name, > table_name) > from dba.table_s

Re: https://wiki.postgresql.org/wiki/Working_with_Git link one link cannot open, another link is unrelated.

2023-01-17 Thread Alvaro Herrera
On 2022-Dec-29, Melih Mutlu wrote: > also in this link: https://wiki.postgresql.org/wiki/Working_with_Git > > > >> See the documentation and tutorials at http://git.or.cz/ for a more > >> detailed Git introduction. For a more detailed lesson, check out > >> http://progit.org and maybe get a hardco

Re: How could I elog the tupleTableSlot to the fronted terminal?

2023-01-30 Thread Alvaro Herrera
On 2023-Jan-30, jack...@gmail.com wrote: > For example, I use "insert into t values(1)"; and I 'll get a tupleTableSlot, > > And Now I want to get the real data , that's 1, and then use elog() func > to print it. Could you give me some codes to realize that? futhermore, > what If the data type is

Re: Losing my latin on Ordering...

2023-02-14 Thread Alvaro Herrera
On 2023-Feb-14, Dominique Devienne wrote: > Honestly, who expects the same prefix to sort differently based on what > comes after, in left-to-right languages? Look, we don't define the collation rules. We just grab the collation rules defined by experts in collations. In this case the experts h

Re: Convert pg_constraint.conkey array to same-order array of column names

2023-03-24 Thread Alvaro Herrera
On 2023-Mar-23, Dominique Devienne wrote: > We have a query returning 1 row per constraint column, > which until recently we didn't realize wasn't preserving order of the > columns. > > A colleague fixed that, with something like below: > > SELECT ... > FROM pg_catalog.pg_constraint cnstr > ...

Re: Should pg 11 use a lot more memory building an spgist index?

2018-10-26 Thread Alvaro Herrera
On 2018-Oct-26, Tom Lane wrote: > After a quick look around, I think that making systable_begin/endscan > do this is a nonstarter; there are just too many call sites that would > be affected. Now, you could imagine specifying that indexes on system > catalogs (in practice, only btree) have to cle

Re: backend crash on DELETE, reproducible locally

2018-11-01 Thread Alvaro Herrera
On 2018-Nov-01, Karsten Hilbert wrote: > Program received signal SIGSEGV, Segmentation fault. > heap_attisnull (tup=0x0, attnum=5, tupleDesc=0xb2990ef4) at > ./build/../src/backend/access/common/heaptuple.c:403 > 403 ./build/../src/backend/access/common/heaptuple.c: Datei oder > Verzeichnis ni

Re: CREATE OR REPLACE FUNCTION statement just sitting there

2018-11-06 Thread Alvaro Herrera
On 2018-Nov-05, Ron wrote: > That (plus pg_locks)  is the heart of the "list all blocking queries" > statement I copied from https://wiki.postgresql.org/wiki/Lock_Monitoring. On that page there's a note about 9.6. Did you see the referenced commit https://git.postgresql.org/gitweb/?p=postgresql.

Re: CREATE OR REPLACE FUNCTION statement just sitting there

2018-11-06 Thread Alvaro Herrera
On 2018-Nov-06, Ron wrote: > On 11/06/2018 05:34 AM, Alvaro Herrera wrote: > I did see it, but the https://wiki.postgresql.org/wiki/Lock_Monitoring query > seems to work (seeing that it regularly shows locks). > > Is this query from https://stackoverflow.com/a/43363536/1543618 ad

Re: backend crash on DELETE, reproducible locally

2018-11-06 Thread Alvaro Herrera
On 2018-Nov-06, Ondřej Bouda wrote: > So we dumped and restored all our databases. After that, the crash on DELETE > never occurred (before, it was several times a day). However, the crash on > UPDATE still occurs on specific rows. We are quite certain no ALTER TABLE > statement was executed on th

Re: backend crash on DELETE, reproducible locally

2018-11-06 Thread Alvaro Herrera
On 2018-Nov-06, Ondřej Bouda wrote: > > Hmm, this one smells like c203d6cf81b4 -- haven't seen any fixes for > > that one. Can you share more details on this? I think the failing > > update is on table with oid=557732818, but I might be wrong. > > That's exactly the table, public.schedulecard.

Re: backend crash on DELETE, reproducible locally

2018-11-06 Thread Alvaro Herrera
On 2018-Nov-06, Tom Lane wrote: > =?UTF-8?Q?Ond=c5=99ej_Bouda?= writes: > >> Ondřej, as a short-term workaround you could prevent the crash > >> by setting that index's recheck_on_update property to false. > > > Thanks for the tip. I am unsuccessful using it, though: > > # ALTER INDEX public.sch

Re: WTF with hash index?

2018-11-13 Thread Alvaro Herrera
On 2018-Nov-13, Олег Самойлов wrote: > Very much better. What about to copy paste algorithm from > gin(jsonb_path_ops) to the hash index? You're welcome to submit patches. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training &

Re: Impact on PostgreSQL due to Redhat acquisition by IBM

2018-11-15 Thread Alvaro Herrera
On 2018-Nov-15, Sachin Kotwal wrote: > I feel community has most of linux based instance in thier buildfarm for > testing, might be very few Ubuntu based. If you feel the need to run more buildfarm members on Ubuntu, run some yourself. It's self-service. -- Álvaro Herrerahttps:

Re: pg_stat_statements: can we extend the object names to the qualified names?

2018-11-27 Thread Alvaro Herrera
On 2018-Nov-27, Sergei Agalakov wrote: > We do see that the queries are different but we can't see why they are so > much different in the execution time. > If the pg_stat_statements module would extend the object name to the > qualified names like s1.t1 and s2.t2 then we would see the report as >

Re: pg_stat_statements: can we extend the object names to the qualified names?

2018-11-27 Thread Alvaro Herrera
On 2018-Nov-27, legrand legrand wrote: > There are also some tryies to extend pg_stat_statements > with plans see > https://www.postgresql-archive.org/FEATURE-PATCH-pg-stat-statements-with-plans-td5940964.html Thread at http://postgr.es/m/9e43fd8f-4d35-4b9d-545c-f9011cd4a...@uni-muenster.de -

Re: DROP CASCADE transitive dependencies

2018-12-03 Thread Alvaro Herrera
On 2018-Dec-03, C GG wrote: > data=# begin; > BEGIN > data=# DROP SCHEMA blah CASCADE; > NOTICE: drop cascades to 278 other objects > DETAIL: drop cascades to type blah.timeclock_compute_hours_type > ... > and 178 other objects (see server log for list) > data=# rollback; > ROLLBACK > data=# >

Re: How to watch for schema changes

2018-12-03 Thread Alvaro Herrera
On 2018-Dec-03, Igor Korot wrote: > But I will probably create it on every connection and delete on the > disconnect (see above). This sounds certain to create a mess eventually, when a connection drops unexpectedly. (Also, what will happens to connections that run concurrently with yours?) --

Re: simple division

2018-12-05 Thread Alvaro Herrera
On 2018-Dec-06, Gavin Flower wrote: > Calculators normally work in floating point (in fact, as far as I am aware, > they never work in integer mode by default), The reason they don't work in "integer mode" is because it doesn't make sense. We only have this thing called "integer division" becaus

Re: psql profiles?

2018-12-06 Thread Alvaro Herrera
On 2018-Dec-06, Matt Zagrabelny wrote: > I'd rather do: > > psql foo > > and have it know that I connect to foo on host db-host-1.example.com. > > Is this possible with psql or do I hack together some wrapper script? Sure, just define a pg_service.conf file. https://www.postgresql.org/docs/11/

Re: Multiple LDAP Servers for ldap Authentication

2018-12-20 Thread Alvaro Herrera
Hello Virendra On 2018-Dec-20, Kumar, Virendra wrote: > I am going through ldap authentication documents in PostgreSQL and found that > we can specify multiple ldap servers but sure how. I have put two entries in > double quotes like below: > -- > hostall all

Re: Multiple LDAP Servers for ldap Authentication

2018-12-20 Thread Alvaro Herrera
On 2018-Dec-20, Kumar, Virendra wrote: > This is what I see: > -- > [postgres@usdf24v0131 ~]$ which postgres > /opt/postgres/10/bin/postgres > [postgres@usdf24v0131 ~]$ ldd /opt/postgres/10/bin/postgres > linux-vdso.so.1 => (0x7ffee3fe8000) > libpthread.so.0 => /lib64/libpthre

Re: Multiple LDAP Servers for ldap Authentication

2018-12-20 Thread Alvaro Herrera
On 2018-Dec-20, Kumar, Virendra wrote: > I am going through ldap authentication documents in PostgreSQL and found that > we can specify multiple ldap servers but sure how. I have put two entries in > double quotes like below: > -- > hostall all0.0.0.0/0

Re: Multiple LDAP Servers for ldap Authentication

2018-12-20 Thread Alvaro Herrera
On 2018-Dec-20, Kumar, Virendra wrote: > Comman separated doesn't work as well. Please separate by a comma and a space, not just a comma. My reading of the OpenLDAP source code, and some quick experiments comparing failure patterns, suggest that that exact combination may work. (OpenLDAP is not

Re: Decrease time needed to CREATE INDEX and FOREIGN KEY on new table column which has all values NULL

2019-01-22 Thread Alvaro Herrera
On 2019-Jan-22, Denisa Cirstescu wrote: > I am trying to add a new column to a really big table and to define an INDEX > and a FOREIGN KEY on that new column using the following instructions: > > ALTER TABLE Employee ADD COLUMN DepartmentId INTEGER; > CREATE INDEX IDX_Employee_DepartmentId ON Em

Re: Size estimation of postgres core files

2019-02-15 Thread Alvaro Herrera
On 2019-Feb-15, Jeremy Finzel wrote: > I am trying to determine the upper size limit of a core file generated for > any given cluster. Is it feasible that it could actually be the entire > size of the system memory + shared buffers (i.e. really huge)? In Linux, yes. Not sure about other OSes.

Re: Update does not move row across foreign partitions in v11

2019-02-27 Thread Alvaro Herrera
On 2019-Feb-22, Derek Hans wrote: > I've set up 2 instances of PostgreSQL 11. On instance A, I created a table > with 2 local partitions and 2 partitions on instance B using foreign data > wrappers, following https://pgdash.io/blog/postgres-11-sharding.html. > Inserting rows into this table works

Re: CVE-2019-9193 about COPY FROM/TO PROGRAM

2019-04-01 Thread Alvaro Herrera
On 2019-Apr-01, Tom Lane wrote: > Magnus Hagander writes: > > On Sat, Mar 30, 2019 at 10:16 PM Tom Lane wrote: > >> Yeah; this is supposing that there is a security boundary between > >> Postgres superusers and the OS account running the server, which > >> there is not. We could hardly have fea

Re: logical replication - negative bitmapset member not allowed

2019-04-01 Thread Alvaro Herrera
On 2019-Apr-01, Tom Lane wrote: > Tim Clarke writes: > > I'm getting this message every 5 seconds on a single-master, > > single-slave replication of PG10.7->PG10.7 both on Centos. Its over the > > 'net but otherwise seems to perform excellently. Any ideas what's > > causing it and how to fix? >

Re: Move vs. copy table between databases that share a tablespace?

2019-04-03 Thread Alvaro Herrera
On 2019-Apr-03, Tom Lane wrote: > I wrote: > > Steven Lembark writes: > >> Given that the two databases live in the same cluster and have > >> the owner & the tablespace in common, is there any way to move > >> the contents without a dump & reload? > > > In principle you could do that; it's more

Re: pg_indexes doesn't show indexes for partitioned tables - bug or intended?

2019-04-10 Thread Alvaro Herrera
On 2019-Apr-11, David Rowley wrote: > On Thu, 11 Apr 2019 at 00:39, Thomas Kellerer wrote: > > > > In Postgres 11.2, indexes defined on partitioned tables do not show up in > > pg_indexes (the actual indexes for the partitions however do show up). > > > Is leaving out the indexes defined on the

Re: When do vacuumed pages/tuples become available for reuse?

2019-04-11 Thread Alvaro Herrera
On 2019-Apr-11, rihad wrote: > Thanks! Our autovacuum_work_mem = 1GB, so this probably means any space > would be available for reuse only at the end of the vacuum? Are there any > downsides in decreasing it to, say, 64MB? I see only pluses ) Yes, each vacuum will take longer and will use much mo

Re: When do vacuumed pages/tuples become available for reuse?

2019-04-11 Thread Alvaro Herrera
On 2019-Apr-11, rihad wrote: > On 04/11/2019 06:20 PM, Tom Lane wrote: > > rihad writes: > > > Thanks! Our autovacuum_work_mem = 1GB, so this probably means any space > > > would be available for reuse only at the end of the vacuum? > > It's six bytes per dead tuple, last I checked ... you do the

Re: When do vacuumed pages/tuples become available for reuse?

2019-04-11 Thread Alvaro Herrera
On 2019-Apr-11, rihad wrote: > On 04/11/2019 06:41 PM, Alvaro Herrera wrote: > > > Perhaps it'd be better to vacuum this table much more often. > > > Each run took 5-6 hours, now it takes 2-3 hours after I've tweaked some > cost-based vacuum knobs. But how ofte

Re: When do vacuumed pages/tuples become available for reuse?

2019-04-11 Thread Alvaro Herrera
On 2019-Apr-11, rihad wrote: > 2019-04-11 19:39:44.450844500   tuples: 19150 removed, 2725811 remain, 465 > are dead but not yet removable What Jeff said. This vacuum spent a lot of time, only to remove miserly 19k tuples, but 2.7M dead tuples remained ... probably because you have long-running

Re: When do vacuumed pages/tuples become available for reuse?

2019-04-11 Thread Alvaro Herrera
On 2019-Apr-11, Tom Lane wrote: > Alvaro Herrera writes: > > On 2019-Apr-11, rihad wrote: > >> 2019-04-11 19:39:44.450844500   tuples: 19150 removed, 2725811 remain, 465 > >> are dead but not yet removable > > > What Jeff said. This vacuum spent a lot of

Re: is it possible to create partitioned tables using tables from different schemas

2019-04-17 Thread Alvaro Herrera
Note that unless you regularly query for only-manually-inserted or only-automatically-inserted data, this will be useless and will make queries more expensive, with no upside. Generally speaking, it's not a problem to put partitions in different schemas. -- Álvaro Herrerahttps://

Re: Postgres Security Patches Question

2019-04-24 Thread Alvaro Herrera
On 2019-Apr-24, Patil, Prashant wrote: > Thanks Tom. So since security patches is not release separately, they > are part of minor releases. Is this correct statement? It is correct. > If they are part minor releases, we need to download source code for > that release and perform upgrade and whi

Re: how to add more than 1600 columns in a table?

2019-04-24 Thread Alvaro Herrera
On 2019-Apr-24, pabloa98 wrote: > How could we add more columns? Sorry. > Note: Tables are OK. We truly have 2400 columns now. Each column represents > a value in a matrix. Maybe you could use arrays? -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 S

Re: how to add more than 1600 columns in a table?

2019-04-24 Thread Alvaro Herrera
On 2019-Apr-24, pabloa98 wrote: > Regarding to (2), We are good by adding a patch and recompile a patched > version for our server databases. > > But we are open on helping to add thousands of columns support as a > compile-time parameter if there are other people interested. It's hard to say wh

Re: how to add more than 1600 columns in a table?

2019-04-24 Thread Alvaro Herrera
On 2019-Apr-24, Alvaro Herrera wrote: > Note that with pg12 you could have your own table AM that supported > wider ItemIds as a (small?) change on heapam, rather than supplant it > for all tables. That way you would only pay the (probably considerable) > cost of the wider line poi

Re: Does "ON UPDATE" for foreign keys require index?

2019-04-25 Thread Alvaro Herrera
On 2019-Apr-25, rihad wrote: > Hi. Say I have column A.b_id which references B.id (which is a primary key) > and as such it is declared as a foreign key constraint. A.b_id has no index > because it doesn't need one. What happens when table B's rows are modified > (but never deleted)? Will PG still

Re: Debugging Failed Startup

2019-05-02 Thread Alvaro Herrera
On 2019-May-02, Ray Cote wrote: > Does anyone have a hint on how I'd go about debugging why PostgreSQL 11 is > not starting on CentOS 7? > Was running fine for several weeks then fails to come up after a reboot. How are you getting it started after the reboot? If you're not using systemd facilit

Re: Relaxing NaN/Infinity restriction in JSON fields

2019-05-08 Thread Alvaro Herrera
On 2019-May-07, Mitar wrote: > On Mon, May 6, 2019 at 1:21 PM Tom Lane wrote: > > There is not, and never has been, any claim that JSON numbers correspond > > to the IEEE spec. > > There is note [1], but yes, it does not claim that nor I claimed that. > I am just saying that the reality is that

Re: FATAL: SMgrRelation hashtable corrupted

2019-05-17 Thread Alvaro Herrera
On 2019-May-17, Tom Lane wrote: > The good news is that the underlying ALTER TABLE bug is fixed in 11.3. > The bad news is that your database is probably toast anyway --- an update > won't undo the catalog corruption that is causing the WAL replay crash. > I hope you have a recent backup to restor

Re: POSTGRES_FSM_RELATIONS CRITICAL: DB control fsm relations used: 79569 of 80000 (99%)

2019-05-28 Thread Alvaro Herrera
On 2019-May-28, Julie Nishimura wrote: > Adrian, I am trying to avoid to do any tweaking to this legacy system that > nobody knows well (we inherited it recently). > Do you think it might help if we possibly drop old tables (I assume their > indices will be removed too), so the overall number of

Re: Localization

2019-05-30 Thread Alvaro Herrera
On 2019-May-30, Yonatan Misgan wrote: > Hello Dear, how are you doing? I am Yonathan Misgan from Ethiopia. > Currently I am working on open source database localization. I highly > requested your advice on how to support my hard code in PostgreSQL. I > am developed Ethiopian locales after all I ha

Re: postgres 11 issue?

2019-06-06 Thread Alvaro Herrera
On 2019-Jun-06, Steve Rogerson wrote: > On 06/06/2019 14:35, Adrian Klaver wrote: > > On 6/6/19 4:02 AM, Steve Rogerson wrote: > >> I've just updated my laptop to pg11 and I'm getting a problem. I'm  trying > >> to > >> keeps the details confidential, so somewhat vague I'm afraid. > >> > >> sjr_l

Re: Table partition with primary key in 11.3

2019-06-06 Thread Alvaro Herrera
On 2019-Jun-06, Alex V. wrote: > I think that your position about primary keys in partitional tables is > not right. > > If we see regular table, one-field primary key is cross-table unique. > In partitional tables for users view we MUST also seen unique > one-field primary key because this is us

Re: Table partition with primary key in 11.3

2019-06-07 Thread Alvaro Herrera
On 2019-Jun-07, Peter Geoghegan wrote: > On Thu, Jun 6, 2019 at 3:00 PM David Rowley > wrote: > > You may already be aware, but another use case for such variable-width > > identifiers was with indirect indexes as discussed in [1] > > Right. I went with global indexes because indirect indexes ar

Re: Table partition with primary key in 11.3

2019-06-07 Thread Alvaro Herrera
On 2019-Jun-07, Peter Geoghegan wrote: > On Fri, Jun 7, 2019 at 9:10 AM Alvaro Herrera > wrote: > > I think vacuuming for global indexes is somewhat challenging as well :-) > > Maybe not as much as for indirect indexes, that's true. > > > > In order for it to

Re: Table partition with primary key in 11.3

2019-06-07 Thread Alvaro Herrera
On 2019-Jun-07, Peter Geoghegan wrote: > On Fri, Jun 7, 2019 at 12:18 PM Alvaro Herrera > wrote: > > I was thinking of asynchonously cleaning it up rather than blocking > > DROP/DETACH ... which means you need to keep state somewhere. I don't > > think blocking

Re: Table partition with primary key in 11.3

2019-06-07 Thread Alvaro Herrera
Somehow we ended up discussing this topic in a rather mistitled thread ... oh well :-) (Nowadays I hesitate to change threads' subject lines, because gmail). On 2019-Jun-07, Peter Geoghegan wrote: > On Fri, Jun 7, 2019 at 12:43 PM Alvaro Herrera > wrote: > > Well, "quic

Re: Table partition with primary key in 11.3

2019-06-07 Thread Alvaro Herrera
On 2019-Jun-07, Peter Geoghegan wrote: > On Fri, Jun 7, 2019 at 1:22 PM Alvaro Herrera > wrote: > > Because you can't rely on that exclusively, and you want to reuse the > > partition ID eventually, you still need a cleanup process that removes > > those remaining

Re: checkpoints taking much longer than expected

2019-06-16 Thread Alvaro Herrera
it's not clear which other filesystems might benefit from one or both of those things, add individual GUCs to control those two behaviors independently and make only very general statements in the docs. Author: Jerry Jelinek, with some adjustments by Thomas Munro Reviewed-b

Re: checkpoints taking much longer than expected

2019-06-16 Thread Alvaro Herrera
On 2019-Jun-16, Stephen Frost wrote: > Not likely to help with what you're experiencing anyway though... My gut feeling is that you're wrong, since (as I understand) the symptoms are the same. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Re

Re: checkpoints taking much longer than expected

2019-06-16 Thread Alvaro Herrera
On 2019-Jun-16, Stephen Frost wrote: > The issue being discussed here is writing out to the heap files during a > checkpoint... We don't really know, as it was already established that the log line is misattributing time spent ... -- Álvaro Herrerahttps://www.2ndQuadrant.com/ Po

Re: perf tuning for 28 cores and 252GB RAM

2019-06-18 Thread Alvaro Herrera
Hello On 2019-Jun-18, Andres Freund wrote: > On 2019-06-17 19:45:41 -0400, Jeff Janes wrote: > > If not, I would set the value small (say, 8GB) and let the OS do the > > heavy lifting of deciding what to keep in cache. > > FWIW, in my opinion this is not a good idea in most cases. E.g. linux's >

Re: Is array_append O(n)?

2019-06-18 Thread Alvaro Herrera
On 2019-Jun-18, Rob Nikander wrote: > Does `array_append(arr, elt)` create a new array and copy everything? > In other words, is it O(n) or O(1)? I’m trying to use plpgsql and > realizing I don’t really have my usual data structures for basic > algorithms the way I’d normally write them. I probabl

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

2023-05-08 Thread Alvaro Herrera
On 2023-May-07, Thomas Munro wrote: > Did you previously run this same workload on versions < 15 and never > see any problem? 15 gained a new feature CREATE DATABASE ... > STRATEGY=WAL_LOG, which is also the default. I wonder if there is a > bug somewhere near that, though I have no specific ide

Re: 15 pg_upgrade with -j

2023-05-24 Thread Alvaro Herrera
On 2023-May-23, Ron wrote: > We'd never hardlink.  Eliminates the ability to return to the old system if > something goes wrong. If you'd never hardlink, then you should run your test without the -k option. Otherwise, the timings are meaningless. -- Álvaro Herrera PostgreSQL Developer

Re: [Beginner Question]What's the use of ResTarget?

2023-07-09 Thread Alvaro Herrera
On 2023-Jul-02, Wen Yi wrote: > Hi community > When I read the Internals document (41.1. The Query Tree), > the introduction of  the 'the result relation' confuse me. There are "result relations" in commands that modify a relation, such as insert or update. The result relation is where the new t

Re: suggestion about time based partitioning and hibernate

2023-07-19 Thread Alvaro Herrera
On 2023-Jul-18, Luca Ferrari wrote: > Dear all, > I'm looking for ideas here, and it could be someone already stepped > into declarative partitioning of an existing database where Hibernate > (a Java ORM) handles the tables. > The situation is as follows: > > create table foo( id primary key, a_d

Re: \d don't print all the tables

2023-07-24 Thread Alvaro Herrera
On 2023-Jul-24, Ron wrote: > Add namespace_a and namespace_b to your search_path.  Then it will work. > > Off the top of my head: > SET search_path = namespace_a, namespace_b, public; Actually it won't, because the table in the earliest schema "shadows" any other tables of the same name in later

Re: Completely Removing PostgreSQL

2023-07-31 Thread Alvaro Herrera
On 2023-Jul-31, Amn Ojee Uw wrote: > In my Debian 12, I have removed the following apps from my system by using > the following commands: > *dpkg -l | grep postgres* > rc  postgresql-12 12.15-1.pgdg120+1  amd64    The > World's Most Advanced Open Source Relational Database > r

Re: Schema renaming cascade

2023-08-17 Thread Alvaro Herrera
On 2023-Aug-17, Lorusso Domenico wrote: > Hello guys, > I need to rename a schema, including each reference to it (also for > functions) Maybe you should consider removing schema name references in function source code, and instead refer to the tables (and other functions, etc) by their unqualifi

Re: rollback to savepoint issue

2023-09-05 Thread Alvaro Herrera
On 2023-Sep-04, Erik Wienhold wrote: > On 04/09/2023 16:56 CEST David G. Johnston wrote: > > > On Monday, September 4, 2023, Erik Wienhold wrote: > > > > > On 04/09/2023 11:51 CEST Lorusso Domenico wrote: > > > > > > > The original code in embedded in a function, but the problem is the > > >

Re: Calculating Days/Time(Are Loops Neccessary?)

2023-09-20 Thread Alvaro Herrera
On 2023-Sep-19, Anthony Apollis wrote: > I have inherited this code, problem is it is over code, i believe. The > package is gonna run once a month and this code run is a loop. How can this > loop be running and checking data up until last day, if it only run once a > month? I didn't stop to unde

Re: Multiple inserts with two levels of foreign keys

2023-10-05 Thread Alvaro Herrera
On 2023-Oct-04, Dow Drake wrote: > I want to insert a farm record, then insert two crops associated with that > farm, then insert two deliveries for each of the the two crops so that in > the end, my tables look like this: If I understand you correctly, for each table you want one CTE with the da

<    1   2   3   4   >