Re: How can I stop a long run pgAgent job?

2018-06-21 Thread Adam Brusselback
As said, terminating a backend is the current way to kill a job. An alternative if this is something you do often: https://github.com/GoSimpleLLC/jpgAgent jpgAgent supports terminating a job by issuing a NOTIFY command on the correct channel like this: NOTIFY jpgagent_kill_job, 'job_id_here'; It w

Re: Can PostgreSQL create new WAL files instead of reusing old ones?

2018-06-22 Thread Adam Brusselback
> Is there some way to make it auto-detect when it should be enabled? If not, please document that it should be used on ZFS and any other file system with CoW properties on files. In addition to this, wondering what type of performance regression this would show on something like ext4 (if any).

Re: Using CTE vs temporary tables

2018-07-11 Thread Adam Brusselback
One thing to note, if this is a query you would like to run on a replica, temp tables are a non-starter. I really wish that wasn't the case. I have quite a few analytical queries I had to optimize with temp tables and indexes, and I really wish I could run on my hot standby. I in most cases I can

Re: Why no CREATE TEMP MATERIALIZED VIEW ?

2019-07-16 Thread Adam Brusselback
> How different is a "*temp* materialized view" from a regular view? If it existed, it would be useful for cases when you need to reference that view in multiple queries in the same session. I've gotten around this by just using temp tables.

Re: easy way to acquire height / width from images (PNG, JPEG) stored as bytea?

2020-04-17 Thread Adam Brusselback
Why not extract and store that metadata with the image rather than trying to extract it to filter on at query time? That way you can index your height and width columns to speed up that filtering if necessary. You may be able to write a wrapper for a command line tool like imagemagic or something

Re: SET ROLE and search_path

2020-05-20 Thread Adam Brusselback
I have this exact setup, and I use roles / schema names that match so the $user var works with the search path when I set role as my application user. > When search_path contains “$user”, does it refer to session_user or current_user ? It uses current_user, not session_user. Works perfectly with s

Re: Table partitioning for cloud service?

2020-05-21 Thread Adam Brusselback
> An interesting answer, if there needs to be shared data, is for the shared data to go in its own database, and use a Foreign Data Wrapper to have each tenants' database access it < https://www.postgresql.org/docs/12/postgres-fdw.html> For my application I went the schema-per-tenant route, but I

Re: Oracle vs. PostgreSQL - a comment

2020-06-02 Thread Adam Brusselback
> How good will that be in performance. In my experience, not great. It's definitely better than not having it at all, but it does not make for quick queries and caused serious connection overhead when a query referenced that foreign table. I've since moved to logical replication to improve the s

Re: CPU Configuration - postgres

2020-06-11 Thread Adam Brusselback
> For parallelism, there are these options That only matters if you want to use those extra cores to make individual queries / commands faster. If all OP cares about is "will PG use my extra cores", the answer is yes it will without doing anything special.

Re: Does TOAST really compress the complete row?

2020-07-02 Thread Adam Brusselback
Another thing that was said I wasn't aware of and have not been able to find any evidence to support: > 10. Blobs don’t participate in Logical replication.

Re: Does TOAST really compress the complete row?

2020-07-02 Thread Adam Brusselback
> > > https://www.postgresql.org/docs/12/logical-replication-restrictions.html > > > > "Large objects (see Chapter 34) are not replicated. There is no > > workaround for that, other than storing data in normal tables." > > > > Of course that does not apply to bytea: > > > https://www.postgres

Re: Unexplained disk usage in AWS Aurora Postgres

2020-08-07 Thread Adam Brusselback
I would highly suggest you reach out to AWS support for Aurora questions, that's part of what you're paying for, support. For reasons you mentioned and more, it's pretty hard to debug issues because it isn't actually Postgres. >

Re: UUID or auto-increment

2020-08-10 Thread Adam Brusselback
> I would point out, however, that using a V1 UUID rather than a V4 can help with this as it is sequential, not random (based on MAC address and timestamp + random) I wanted to make this point, using sequential UUIDs helped me reduce write amplification quite a bit with my application, I didn't u

Re: serial + db key, or guid?

2020-08-11 Thread Adam Brusselback
I mentioned this in another email thread yesterday about a similar topic, but I'd highly suggest if you do go the UUID route, do not use the standard UUID generation functions, they all suck for database use (v1 also sucks). I use: https://pgxn.org/dist/sequential_uuids/ written by Thomas Vondara

Re: Hot backup in PostgreSQL

2020-10-22 Thread Adam Brusselback
> how to do "hot backup" (copying files) while database running? As others have shown, there are ways to do this with PG's internal tooling (pg_basebackup). However, I would highly recommend you use an external backup tool like pgbackrest [1] to save yourself the pain of implementing things incorr

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

2021-01-13 Thread Adam Brusselback
> Admittedly, the system probably should be made to save the text, should someone wish to write such a patch. Just wanted to throw $0.02 behind this idea if anyone does want to take it up later. Using a source control system is better obviously. But even if you use source control it is still incre

Re: Postgres calendar?

2022-10-04 Thread Adam Brusselback
Absolutely, it'd be much easier having this info integrated with my work/personal calendar, as that's how I try and organize things anyways. Thanks for the suggestion. -Adam On Tue, Oct 4, 2022 at 5:02 PM Bruce Momjian wrote: > Would people be interesting in subscribing to a Postgres calendar t

Re: Postgres for SQL Server users

2019-05-06 Thread Adam Brusselback
I think the main "gotcha" when I moved from SQL Server to Postgres was I didn't even realize the amount of in-line t-sql I would use to just get stuff done for ad-hoc analysis. Postgres doesn't have a good way to emulate this. DO blocks cannot return resultsets, so short of creating a function and

Re: Feature request (or at least discussion): enable autovaccum on temp tables

2019-05-31 Thread Adam Brusselback
Temp tables are not visibile outside of a single connection, so the autovacuum worker connection isn't able to see it. Are you sure that it's actually an issue with accumulating dead tuples, and not an issue with bad statistics? In my processes which are heavy on temp tables, I have to manually r

Re: pgAgent for multiple databases in same instance

2021-03-10 Thread Adam Brusselback
So my experience isn't with pgagent directly, because I have been using my re-written version of it for ~5 years (but at least at one point I had a pretty darn good understanding from doing that rewrite)...please take this with a grain of salt if I am incorrect on anything. So the agent is only ab

Ways to "serialize" result set for later use?

2021-04-10 Thread Adam Brusselback
Hey there everyone, I am going through the process of writing my first pgtap tests for my database, and I wanted to get some feedback on if my solution seems fine, is just dumb, or could be acomplished much easier another way. So my main problem I was trying to work around, was my tests are writt

Re: Ways to "serialize" result set for later use?

2021-04-12 Thread Adam Brusselback
> Checking data (DML), if functions are doing the right things is something we do in our code unit tests. This is exactly what I am writing, unit tests for my code (which is pl/pgsql). This is an ELT pipeline for my customers to bulk update their data in my system, with detailed error reporting f

[GENERAL] postgres_fdw & could not receive data from client: Connection reset by peer

2017-11-22 Thread Adam Brusselback
Hey all, first off... Postgres version: 10.1 OS: Debian 9.0 So I have a database called: authentication It stores my user table for my application. I have it separated from the main database of my application to allow the same account to be used by multiple instances of my application. >From a c

Re: [GENERAL] postgres_fdw & could not receive data from client: Connection reset by peer

2017-11-28 Thread Adam Brusselback
Just bumping this because I posted it right before Thanksgiving and it was very easy to overlook. Sorry if this is bad etiquette for the list... Just let me know if it is and I won't do it in the future.

Re: pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?

2018-02-06 Thread Adam Brusselback
In my testing, gen_random_uuid() is quite a bit faster than uuid_generate_v4().

Re: Postgres incremental database updates thru CI/CD

2025-04-05 Thread Adam Brusselback
There are no built in tools for this in Postgres. There are other tools like the one mentioned that you can use instead. I've used Liquibase for migrations for multiple companies now and it works well enough. If you have to support rollbacks for your deployments, that is a pretty manual process fo