Re: Are stored procedures/triggers common in your industry

2022-04-20 Thread raf
On Wed, Apr 20, 2022 at 12:18:23PM -0700, Guyren Howe wrote: > I’ve really only ever worked in web development. 90+% of web > developers regard doing anything at all clever in the database with > suspicion. > > I’m considering working on a book about implementing business logic in > Postgres, and

Re: Are stored procedures/triggers common in your industry

2022-04-20 Thread Mladen Gogala
On 4/20/22 15:18, Guyren Howe wrote: I’ve really only ever worked in web development. 90+% of web developers regard doing anything at all clever in the database with suspicion. I’m considering working on a book about implementing business logic in Postgres, and I’m curious about how common th

Re: Are stored procedures/triggers common in your industry

2022-04-20 Thread Alex Aquino
Agree with the comment on python, et al. I meant lock in within the context of Oracle PL/SQL. Actually, the point of Postgres support for all the languages you mentioned is interesting in that such mitigates the lockin argument if the DB used is. Postgres . Another reason to use Postgres, among

Re: alter function/procedure depends on extension

2022-04-20 Thread David G. Johnston
On Tue, Apr 12, 2022 at 8:55 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tue, Apr 12, 2022 at 8:49 AM Tom Lane wrote: > >> "David G. Johnston" writes: >> > - A function that's marked as dependent on an extension is >> automatically >> > - dropped when the extension i

Re: autovacuum_freeze_max_age on append-only tables

2022-04-20 Thread Peter Geoghegan
On Wed, Apr 20, 2022 at 4:06 PM senor wrote: > I'm attempting to mimic a new feature in version 13 where INSERTS will > trigger vacuum for an append-only table. The problem with that idea is that you need to express the idea that the table needs to be vacuumed now in terms of its "age", denomina

autovacuum_freeze_max_age on append-only tables

2022-04-20 Thread senor
Hi All, I'm attempting to mimic a new feature in version 13 where INSERTS will trigger vacuum for an append-only table. I'm using v11 and configuring autovacuum_freeze_max_age to a value representing some number of minutes worth of inserts on a table containing the current day events. I'm look

Large Data insert on Master server fills up /pgsql base dir when Logical replication (pglogical) is active

2022-04-20 Thread Siddhartha Gurijala
Hello Postgres community, I have a database cluster that crashed in a way I don’t understand. Some details about the setup: - The database that crashed is running postgres 14.1 - This database has three physical standbys using repmgr - The database allows another database in the same loca

Re: Are stored procedures/triggers common in your industry

2022-04-20 Thread Benedict Holland
It's a very wierd concern for me. I have never liked that justification as we convert 1:1 SAS to python. If you use Django, converting it to flask is really hard. If you use postgresql, converting it to oracle is really hard. I love stored procedures and triggers. Many of my colleagues don't under

Re: PITR and Temp Tables

2022-04-20 Thread Huan Ruan
Many thanks for the explanation, Tom and Greg. That all makes sense. Cheers Huan

Re: Are stored procedures/triggers common in your industry

2022-04-20 Thread Alex Aquino
Agree on the lock in comment, however, can't we say that of anything one is dependent on in the tech stack, whether that be at the java vs javascript vs python, or now aws vs azure vs gcp? Have always wondered that lock in concern seems to be only mentioned in light of dbs, but not any other piece

Re: Are stored procedures/triggers common in your industry

2022-04-20 Thread Ravi Krishna
I've really only ever worked in web development. 90+% of web developers regard doing anything at all clever in the database with suspicion. One common argument they use is that if you write your business logic in stored procedure, you are locked to that database since stored procedure languag

Re: ERROR: XX000: cache lookup failed for type 75083631

2022-04-20 Thread Jan Beseda
Hi Tom, Thanks for getting me directions for debugging, but it seems the devops team fully restored the system snapshot on corrupted instance for me. If it occurs again I'll reopen/write you as reply here if that's ok. Cheers, Jan čt 14. 4. 2022 v 19:24 odesílatel Tom Lane napsal: > Jan Beseda

Re: Are stored procedures/triggers common in your industry

2022-04-20 Thread Tim Clarke
On 20/04/2022 20:26, Philip Semanchuk wrote: > We have some business logic in Postgres functions, particularly triggers. Our > apps are written in Python, and we use pytest to exercise our SQL functions > to ensure they're doing what we think they’re doing. It works well for us. > > FWIW, we’re

Re: Are stored procedures/triggers common in your industry

2022-04-20 Thread Adrian Klaver
On 4/20/22 12:18, Guyren Howe wrote: I’ve really only ever worked in web development. 90+% of web developers regard doing anything at all clever in the database with suspicion. I’m considering working on a book about implementing business logic in Postgres, and I’m curious about how common tha

Re: Are stored procedures/triggers common in your industry

2022-04-20 Thread Philip Semanchuk
> On Apr 20, 2022, at 3:18 PM, Guyren Howe wrote: > > I’ve really only ever worked in web development. 90+% of web developers > regard doing anything at all clever in the database with suspicion. > > I’m considering working on a book about implementing business logic in > Postgres, and I’m

RE: Are stored procedures/triggers common in your industry

2022-04-20 Thread Basques, Bob (CI-StPaul)
We’ve used them in the past, but sparingly. Usually if the data is abstracted nicely for loading into the DB, you can get away with most processes only needing SQL, at least in our cases. There are obvious exceptions for things like monitoring or logging. Our use has been for running some set

Re: Are stored procedures/triggers common in your industry

2022-04-20 Thread Rob Sargent
On 4/20/22 13:18, Guyren Howe wrote: I’ve really only ever worked in web development. 90+% of web developers regard doing anything at all clever in the database with suspicion. I’m considering working on a book about implementing business logic in Postgres, and I’m curious about how common th

Are stored procedures/triggers common in your industry

2022-04-20 Thread Guyren Howe
I’ve really only ever worked in web development. 90+% of web developers regard doing anything at all clever in the database with suspicion. I’m considering working on a book about implementing business logic in Postgres, and I’m curious about how common that actually is.

Re: Error dydl : image not found when trying to install pg on Catalina

2022-04-20 Thread Peter Eisentraut
On 17.04.22 13:28, cecile rougnaux wrote: dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.70.dylib Whenever libicu's major version changes, you need to rebuilt the postgresql package.

Re: Unexpected result from ALTER FUNCTION— looks like a bug

2022-04-20 Thread David G. Johnston
On Wed, Apr 20, 2022 at 10:54 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > > > https://github.com/postgres/postgres/commit/344a225cb9d42f20df063e4d0e0d4559c5de7910 > > (I haven't figured out what the official way to reference a commit is, I > use the GitHub clone for research so the

Re: PostgreSQL 10.20 crashes / Antivirus

2022-04-20 Thread Adrian Klaver
On 4/20/22 10:23 AM, Thomas, Richard wrote: Adrian Klaver wrote: On 4/20/22 01:06, Thomas, Richard wrote: The command used in a PowerShell script (run with Windows task scheduler) to dump each database should evaluate to: "C:\Program Files\PostgreSQL\10\bin\pg_dump.exe" -b -v -F c -d $dbName

Re: Unexpected result from ALTER FUNCTION— looks like a bug

2022-04-20 Thread David G. Johnston
On Wed, Apr 20, 2022 at 10:45 AM Bryn Llewellyn wrote: > > t...@sss.pgh.pa.us wrote: > > > > > In any case, Bryn's right, the combination of a SET clause and a > PARALLEL clause is implemented incorrectly in AlterFunction. > > I'm taking what I've read in the responses to mean that the testcase I

Re: PostgreSQL 10.20 crashes / Antivirus

2022-04-20 Thread Adrian Klaver
On 4/20/22 10:23 AM, Thomas, Richard wrote: Adrian Klaver wrote: On 4/20/22 01:06, Thomas, Richard wrote: - pg_dump.exe executable is not excluded from McAfee on-access scanning (although as recommended postgres.exe is) Why not? I would think the whole C:\Program Files\PostgreSQL\10\bin\ w

Re: Unexpected result from ALTER FUNCTION— looks like a bug

2022-04-20 Thread Bryn Llewellyn
> t...@sss.pgh.pa.us wrote: > >> david.g.johns...@gmail.com wrote: >> >> Might I suggest the following... > > Actually, the reason proconfig is handled differently is that it's a > variable-length field, so it can't be represented in the C struct that we > overlay onto the catalog tuple... Th

RE: PostgreSQL 10.20 crashes / Antivirus

2022-04-20 Thread Thomas, Richard
Adrian Klaver wrote: > On 4/20/22 01:06, Thomas, Richard wrote: > > The command used in a PowerShell script (run with Windows task scheduler) > to dump each database should evaluate to: > > > > "C:\Program Files\PostgreSQL\10\bin\pg_dump.exe" -b -v -F c -d $dbName > > -h localhost -p 6488 -U backup

Re: Can anyone confirm the flaw of postgres and how to deal with it?

2022-04-20 Thread Adrian Klaver
On 4/20/22 08:47, Shaozhong SHI wrote: I loaded several tables onto Postgres. When you view, you can see all columns. However, there are 'ghost columns' that I remember I used before, but not now.  select column_name::text from information_schema.columns where table_name=a_table Best gue

Re: Can anyone confirm the flaw of postgres and how to deal with it?

2022-04-20 Thread David G. Johnston
On Wed, Apr 20, 2022 at 8:48 AM Shaozhong SHI wrote: > I loaded several tables onto Postgres. > > When you view, you can see all columns. > > However, there are 'ghost columns' that I remember I used before, but not > now. > > select column_name::text from information_schema.columns where > tabl

Can anyone confirm the flaw of postgres and how to deal with it?

2022-04-20 Thread Shaozhong SHI
I loaded several tables onto Postgres. When you view, you can see all columns. However, there are 'ghost columns' that I remember I used before, but not now. select column_name::text from information_schema.columns where table_name=a_table keeps listing columns that I can not see in the curren

Re: PostgreSQL 10.20 crashes / Antivirus

2022-04-20 Thread Adrian Klaver
On 4/20/22 01:06, Thomas, Richard wrote: Adrian Klaver wrote: What are the actual commands you are using to do the above? The command used in a PowerShell script (run with Windows task scheduler) to dump each database should evaluate to: "C:\Program Files\PostgreSQL\10\bin\pg_dump.exe" -b -v

Re: PITR and Temp Tables

2022-04-20 Thread Greg Stark
There actually is a third backstop if no other session ever connects to that temp schema and cleans them out. Eventually autovacuum notices that they would need a vacuum "to prevent wraparound". It can't actually did the vacuum on temp tables but if there's no session attached to the temp schema i

Re: PITR and Temp Tables

2022-04-20 Thread Tom Lane
Huan Ruan writes: > Let's say at T0 a database has N session based temp tables. They would have > corresponding records in the catalog tables like pg_class and pg_attribute > that are visible to other sessions. > At T1, I do a PITR to T0. That recovered database should not have those > temp table

Re: PITR and Temp Tables

2022-04-20 Thread Huan Ruan
Hi Patrick Thanks for your reply. > > > My guess is that temp table entries will still be in your catalog until > you do a VACUUM FULL of the pg_class / pg_attribute tables. > > But you should not care about these entries if these tables are vacuumed > at regular intervals. > What I observed in o

RE: PITR and Temp Tables

2022-04-20 Thread Patrick FICHE
From: Huan Ruan Sent: Wednesday, April 20, 2022 2:18 PM To: pgsql-general@lists.postgresql.org Subject: PITR and Temp Tables Hi All Let's say at T0 a database has N session based temp tables. They would have corresponding records in the catalog tables like pg_class and pg_attribute that are vi

PITR and Temp Tables

2022-04-20 Thread Huan Ruan
Hi All Let's say at T0 a database has N session based temp tables. They would have corresponding records in the catalog tables like pg_class and pg_attribute that are visible to other sessions. At T1, I do a PITR to T0. That recovered database should not have those temp tables because the session

LwLocks contention

2022-04-20 Thread Michael Lewis
We are occasionally seeing heavy CPU contention with hundreds of processes active but waiting on a lightweight lock - usually lock manager or buffer mapping it seems. This is happening with VMs configured with about 64 CPUs, 350GBs ram, and while we would typically only have 30-100 concurrent proce

RE: PostgreSQL 10.20 crashes / Antivirus

2022-04-20 Thread Thomas, Richard
Adrian Klaver wrote: > What are the actual commands you are using to do the above? The command used in a PowerShell script (run with Windows task scheduler) to dump each database should evaluate to: "C:\Program Files\PostgreSQL\10\bin\pg_dump.exe" -b -v -F c -d $dbName -h localhost -p 6488 -U b