Re: Lookup tables

2025-02-04 Thread Ron Johnson
On Tue, Feb 4, 2025 at 9:59 AM David G. Johnston wrote: > On Tuesday, February 4, 2025, Ron Johnson wrote: > >> On Tue, Feb 4, 2025 at 9:41 AM David G. Johnston < >> david.g.johns...@gmail.com> wrote: >> >>> On Tuesday, February 4, 2025, Rich Shepard &

Re: Lookup tables

2025-02-04 Thread Ron Johnson
On Tue, Feb 4, 2025 at 9:28 AM Rich Shepard wrote: > Should lookup tables have a numeric FK column as well as the description > column? > Does your lookup table just have one column? (That's what your question seems to imply, but that makes no sense, since the whole point of a lookup table is t

Re: Lookup tables

2025-02-04 Thread Ron Johnson
On Tue, Feb 4, 2025 at 10:08 AM Rich Shepard wrote: > On Tue, 4 Feb 2025, David G. Johnston wrote: > > > The point of a lookup table is to provide a unique list of authoritative > > values for some purpose. Kinda like an enum. But having the label serve > as > > the unique value is reasonable - w

Re: Lookup tables

2025-02-04 Thread Ron Johnson
On Tue, Feb 4, 2025 at 9:41 AM David G. Johnston wrote: > On Tuesday, February 4, 2025, Rich Shepard > wrote: > >> Should lookup tables have a numeric FK column as well as the description >> column? >> >> If so, how should I add an FK to the two lookup tables in my database? >> > > Most do (have

Re: Lookup tables

2025-02-04 Thread Ron Johnson
On Tue, Feb 4, 2025 at 10:05 AM Rich Shepard wrote: > On Tue, 4 Feb 2025, Ron Johnson wrote: > > > Does your lookup table just have one column? (That's what your question > > seems to imply, but that makes no sense, since the whole point of a > lookup > > table

Re: Lookup tables

2025-02-04 Thread Ron Johnson
On Tue, Feb 4, 2025 at 11:31 AM Michał Kłeczek wrote: [snip] > > The query to register a visit is: > insert into restaurant_visit > select $user, current_date, restaurant_id, $rating > from restaurant where name = $restaurant_name > > > It is now completely unclear what it means to change the nam

Re: Lookup tables

2025-02-04 Thread Ron Johnson
On Tue, Feb 4, 2025 at 12:05 PM Rob Sargent wrote: > > > > On 2/4/25 10:03, Ron Johnson wrote: > > On Tue, Feb 4, 2025 at 11:31 AM Michał Kłeczek wrote: > [snip] > >> >> The query to register a visit is: >> insert into restaurant_visit >> se

Re: old OS

2025-02-04 Thread Ron Johnson
https://ora2pg.darold.net/ It can access remote Oracle databases, and migrate LOB columns to bytea. Worked quite well for me on a database 3x that size. On Tue, Feb 4, 2025 at 3:28 PM Marc Millas wrote: > Hi Tom, > > the data in the redhat 6.5 machine is NOT in Postgres, its in an old > Oracle

Re: Table copy

2025-02-05 Thread Ron Johnson
Could there have been a network hiccup? Or some sort of timeout? If I needed to transfer 360GB of data, I'd probably do something old school like: 1. write a PowerShell script to export a set of rows into a csv file, 7zip compress it, then rsync or scp it to the target. 2. Write a bash script to

Re: Credcheck- credcheck.max_auth_failure

2024-12-11 Thread Ron Johnson
On Wed, Dec 11, 2024 at 12:57 PM Greg Sabino Mullane wrote: > On Wed, Dec 11, 2024 at 5:46 AM 張宸瑋 wrote: > >> In the use of the Credcheck suite, the parameter >> "credcheck.max_auth_failure = '3'" is set in the postgresql.conf file to >> limit users from entering incorrect passwords more than th

Re: Errors when restoring backup created by pg_dumpall

2024-12-09 Thread Ron Johnson
On Sat, Nov 30, 2024 at 10:36 PM Adrian Klaver wrote: [snip] > In future schema qualify all references. > > For now in the dump file you could search for > > SELECT pg_catalog.set_config('search_path', '', false); > > and set to > > SELECT pg_catalog.set_config('search_path', 'public', false); >

Re: Errors when restoring backup created by pg_dumpall

2024-12-09 Thread Ron Johnson
On Mon, Dec 9, 2024 at 11:24 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Monday, December 9, 2024, Ron Johnson wrote: > >> On Sat, Nov 30, 2024 at 10:36 PM Adrian Klaver >> wrote: >> [snip] >> >>> In future schema qualify all ref

Request for new column in pg_namespace

2024-12-15 Thread Ron Johnson
https://www.postgresql.org/docs/current/catalog-pg-namespace.html Currently, when I want to query all "userland" tables, I write something like: select ... from pg_class cl, pg_namespace nsp where cl.relnamespace = nsp.oid and nsp.nspname not like 'pg_% and nsp.nspname != 'information_schema';

Re: Request for new column in pg_namespace

2024-12-15 Thread Ron Johnson
On Sun, Dec 15, 2024 at 12:29 PM Tom Lane wrote: > Pavel Stehule writes: > > ne 15. 12. 2024 v 17:59 odesílatel Ron Johnson > > napsal: > >> A new boolean column named "indissystem" that's true only for system > >> relations would make *many* mai

Re: Request for new column in pg_namespace

2024-12-15 Thread Ron Johnson
On Sun, Dec 15, 2024 at 2:20 PM Tom Lane wrote: > Isaac Morland writes: > > On Sun, 15 Dec 2024 at 12:29, Tom Lane wrote: > >> What I'd suggest as an improvement that could be implemented > >> immediately is to wrap the checks in a user-defined function > >> like "is_system_schema(nspname name)

Re: Credcheck- credcheck.max_auth_failure

2024-12-16 Thread Ron Johnson
On Mon, Dec 16, 2024 at 8:10 AM Greg Sabino Mullane wrote: > On Mon, Dec 16, 2024 at 5:32 AM 張宸瑋 wrote: > >> We have both regular accounts and system accounts. For regular accounts, >> we still require password complexity and the lockout functionality after >> multiple failed login attempts. >>

Re: Credcheck- credcheck.max_auth_failure

2024-12-16 Thread Ron Johnson
edcheck.max_auth_failure parameter. > > > Peter J. Holzer 於 2024年12月14日 週六,上午4:24寫道: > >> On 2024-12-11 13:43:38 -0500, Ron Johnson wrote: >> > On Wed, Dec 11, 2024 at 12:57 PM Greg Sabino Mullane < >> htamf...@gmail.com> >> > wrote: >> > >>

Re: Credcheck- credcheck.max_auth_failure

2024-12-16 Thread Ron Johnson
On Mon, Dec 16, 2024 at 10:19 AM Peter J. Holzer wrote: > On 2024-12-16 09:17:25 -0500, Ron Johnson wrote: > > Local (socket-based) connections are typically peer-authenticated > > (meaning that authentication is handled by Linux pam). >

Re: Cannot drop column

2024-12-18 Thread Ron Johnson
On Wed, Dec 18, 2024 at 1:47 PM Rich Shepard wrote: > I'm not seeing why postgres won't drop a table's column: > > bustrac=# select * from statustypes order by stat_name; > stat_name > > Client > Lead > No further contact > Opportunity > Proposal submitted >

Re: Credcheck- credcheck.max_auth_failure

2024-12-17 Thread Ron Johnson
On Tue, Dec 17, 2024 at 1:39 PM Peter J. Holzer wrote: > On 2024-12-16 10:37:59 -0500, Ron Johnson wrote: > > On Mon, Dec 16, 2024 at 10:19 AM Peter J. Holzer > wrote: > > > > On 2024-12-16 09:17:25 -0500, Ron Johnson wrote: > > > Local (socket-base

Re: Intermittent errors when fetching cursor rows on PostgreSQL 16

2024-12-18 Thread Ron Johnson
On Wed, Dec 18, 2024 at 5:01 AM Enrico Schenone wrote: > Good day. > My name is Enrico Schenone, from Genoa, Italy. > I'm a software achitect working at Cleis Tech - Genoa - Italy - > http://gruppocleis.it > Me and my team are using PostgreSQL v12 to v16 on Debian 10-12 and Ubuntu > Server 22.04

Re: Allowed to return possibly TOASTed datums?

2024-12-14 Thread Ron Johnson
On Sat, Dec 14, 2024 at 12:02 PM Tom Lane wrote: > Jan Behrens writes: > > Is it allowed to use the following function, assuming the data type is > > TOASTable? > > > PG_FUNCTION_INFO_V1(mytype_pos); > > Datum mytype_pos(PG_FUNCTION_ARGS) { > > PG_RETURN_DATUM(GETARG_DATUM(0)); > > } > > Absol

Re: How to deal with dangling files after aborted `pg_restore`?

2024-12-18 Thread Ron Johnson
It could be that he only restored *some* tables in an existing database. On Wed, Dec 18, 2024 at 7:02 PM Saul Perdomo wrote: > Genuine question: Why are you looking to recover from this half-cooked > state instead of restarting the restore process from the beginning? > > On Tue, Dec 17, 2024, 1:

Re: any tips to have restricted inbound and getting connected with postgresql dB

2024-12-20 Thread Ron Johnson
On Fri, Dec 20, 2024 at 2:25 PM Y_Bharani_mbsv wrote: > Team > I have the need to have postgresql db running in multiuser mode and do my > needed tasks for few mins. > > How to restrict all the application layer , not to get connected with the > postgres db , > during my specific time window >

Re: Wired behaviour from SELECT

2024-11-22 Thread Ron Johnson
On Fri, Nov 22, 2024 at 3:07 PM Arbol One wrote: > > Two different SELECT sql statement don't behave the same way. > The below sql statement produces the right output > SELECT nickname, password FROM password WHERE id='0938105618107N1'; > nickname | password > -+-- > Picc

Re: CVE-2024-10979 Vulnerability Impact on PostgreSQL 11.10

2024-11-21 Thread Ron Johnson
15.0 is missing TWO YEARS of bug fixes. https://www.postgresql.org/docs/release/ And It's your database, not ours. Plus, we aren't the Version Police that knock your head with a billy club if you don't upgrade. Patching takes 10 minutes, and any good DBA will keep his or her systems as patched a

Re: Database stats ( pg_stat_database.stats_reset ) get reset on daily basis - why?

2024-11-21 Thread Ron Johnson
On Thu, Nov 21, 2024 at 4:12 PM Adrian Klaver wrote: > On 11/21/24 12:57, Steeve Boulanger wrote: > > > > > Please reply to list also. > > > > My apologies - I thought I did a "Reply all", but apparently not. I'm a > > little bit of a noob with email distrib lists. > > > > > 1) What is log_min_

Re: CVE-2024-10979 Vulnerability Impact on PostgreSQL 11.10

2024-11-23 Thread Ron Johnson
On Sat, Nov 23, 2024 at 1:10 PM Bruce Momjian wrote: [snip] > I have to admit, for this question, we just point people to: > > https://www.postgresql.org/support/versioning/ > > and say bounce the database server and install the binaries. What I > have never considered before, and I shou

Re: Best Practices for Managing Schema Changes Dynamically with libpq

2024-12-03 Thread Ron Johnson
On Tue, Dec 3, 2024 at 12:44 PM Sasmit Utkarsh wrote: [snip] > How can we efficiently handle table additions/updates while keeping the > application and database in sync dynamically? > Enumerate all relevant column names in SELECT and INSERT statements. That way, the application still works whe

Re: Autovacuum and visibility maps

2024-12-03 Thread Ron Johnson
On Tue, Dec 3, 2024 at 11:57 AM Adrian Klaver wrote: [snip] > > I have to believe it is due to this: > > > https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-SPACE-RECOVERY > > "If you have a table whose entire contents are deleted on a periodic > basis, consider doing it w

Re: Autovacuum and visibility maps

2024-12-03 Thread Ron Johnson
When in doubt, "manually" vacuum and/or analyze. Maybe even disable autovacuum on that table before the TRUNCATE + INSERT, do the "manual" vacuum-analyze and then re-enable autovacuum. Bonus points for programmatically determining which partitions you're going to insert into, so that you only man

Re: Errors when restoring backup created by pg_dumpall

2024-12-05 Thread Ron Johnson
On Thu, Dec 5, 2024 at 5:32 PM PopeRigby wrote: > On 12/1/24 13:55, Tom Lane wrote: > > Adrian Klaver writes: > >> On 12/1/24 13:14, Tom Lane wrote: > >>> It would be useful to know what is the command at line 4102 > >>> of all.sql. > >> It is here: > >> https://gist.github.com/poperigby/fcb59eb

Re: Display Bytea field

2025-01-11 Thread Ron Johnson
1. Do you still have the CSV file (or can you regenerate it from the still-existing MSSQL DB)? 2. Did you load the base64 string into PG, or did you decode before loading into PG? 3. A base64 string would be about 62KB. Either you did something wrong when loading, or the programmer is doing someth

Re: Display Bytea field

2025-01-11 Thread Ron Johnson
I bet Image*Source* doesn't contain what you think it does. I'd query that table using SSMS, to see what's really in that column. On Sat, Jan 11, 2025 at 6:49 PM Andy Hartman wrote: > I still have csv files and loaded right into PG no decoding and look like > this little snippet and I did the C

INTERVAL MINUTE TO SECOND didn't do what I thought it would do

2025-01-08 Thread Ron Johnson
PG 14.13 The goal of "(now() - query_start)::INTERVAL MINUTE TO SECOND" column is to see how many minutes and seconds ago that the query started. (Why? Because that's useful to me, and the people I show the output to when queries run for more than a few minutes. We don't need to see hours and da

Re: INTERVAL MINUTE TO SECOND didn't do what I thought it would do

2025-01-08 Thread Ron Johnson
On Wed, Jan 8, 2025 at 2:43 PM Adrian Klaver wrote: > > > On 1/8/25 11:00 AM, Ron Johnson wrote: > > PG 14.13 > > > > The goal of "(now() - query_start)::INTERVAL MINUTE TO SECOND" column is > > to see how many minutes and seconds ago that the query s

Re: Automatic deletion of orphaned rows

2025-01-22 Thread Ron Johnson
On Wed, Jan 22, 2025 at 9:37 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wednesday, January 22, 2025, Ron Johnson > wrote: >> >> >>> I therefore propose a feature, to be able to specify in a table schema >>> that a row should be d

Re: Automatic deletion of orphaned rows

2025-01-22 Thread Ron Johnson
On Wed, Jan 22, 2025 at 2:00 AM Runxi Yu wrote: > Hi, > > While writing a new program, I encountered the following: > > I have three tables: A, B, and X. Rows in X are referenced by A and/or B > via foreign keys, one or more times. I would like to delete all orphaned > rows in X, i.e. a row in X

Re: Help in vetting measuring egress/ingress w.r.to " pg_dumpall " - old vm to new vm

2025-01-28 Thread Ron Johnson
On Tue, Jan 28, 2025 at 3:13 PM Bharani SV-forum wrote: > TQ Adrian > another Question on the measuring egress (out bound traffic) /ingress > (inbound traffic) w.r.to " pg_dumpall " during usage of > > pg_dumpall -h-p 5432 | psql -p 5462 > > taking data from old_vm and copying to new_vm, as i

Re: Automatic upgrade of passwords from md5 to scram-sha256

2025-01-13 Thread Ron Johnson
On Mon, Jan 13, 2025 at 3:41 PM Peter J. Holzer wrote: > On 2025-01-13 12:19:06 -0500, Ron Johnson wrote: > > On Sun, Jan 12, 2025 at 5:59 PM Tom Lane wrote: > > [snip] > > > > I think this idea is a nonstarter, TLS or not. We're generally > movin

Re: Automatic upgrade of passwords from md5 to scram-sha256

2025-01-13 Thread Ron Johnson
On Sun, Jan 12, 2025 at 5:59 PM Tom Lane wrote: [snip] > I think this idea is a nonstarter, TLS or not. We're generally moving > in the direction of never letting the server see cleartext passwords. > It's already possible to configure libpq to refuse such requests > (see require_auth parameter

Re: Postgresql database terminates abruptly with too many open files error

2025-01-14 Thread Ron Johnson
On Tue, Jan 14, 2025 at 7:58 AM Sri Mrudula Attili wrote: > Hello Team, > > We have a postgresql VDB(virtual database- Delphix) that keeps > terminating due "to too many open files". > > Below are few alerts that we could see from the postgresql.log > > > < 2025-01-14 11:37:20.724 GMT >LOG: ou

Re: Need help in database design

2024-12-23 Thread Ron Johnson
How do you uniquely reference each set of 50 k/v pairs? On Mon, Dec 23, 2024 at 12:01 PM Divyansh Gupta JNsThMAudy < ag1567...@gmail.com> wrote: > Sure , for example, I have 50 key with name as t1 , t2 ,t3 ...t50 > > Now each key could have values from 0 to 3 > > So let suppose we have JSONB

Re: Need help in database design

2024-12-23 Thread Ron Johnson
ll work with userid index in Bitmap on the other > hand if I create a JSONB column I need to create a single index ? > > On Mon, 23 Dec 2024, 11:10 pm Ron Johnson, > wrote: > >> Given what you just wrote, I'd stick with 50 separate t* columns. >> Simplifies queri

Re: Need help in database design

2024-12-23 Thread Ron Johnson
ed to apply filter on userid always, however I have date >> columns but there is less variation in timestamp which I have that's why >> didn't go for range partition. >> >> On Mon, 23 Dec 2024, 11:57 pm Ron Johnson, >> wrote: >> >>> >&

Re: Need help in database design

2024-12-23 Thread Ron Johnson
Given what you just wrote, I'd stick with 50 separate t* columns. Simplifies queries, simplifies updates, and eliminates JSONB conversions. On Mon, Dec 23, 2024 at 12:29 PM Divyansh Gupta JNsThMAudy < ag1567...@gmail.com> wrote: > Values can be updated based on customer actions > > All rows won't

Re: Need help in database design

2024-12-23 Thread Ron Johnson
them? On Mon, Dec 23, 2024 at 12:07 PM Divyansh Gupta JNsThMAudy < ag1567...@gmail.com> wrote: > Each row have a PK (gdid) that will uniquely refrence 50 k/v pair set > > On Mon, 23 Dec 2024, 10:35 pm Ron Johnson, > wrote: > >> How do you uniquely reference each set of

Re: Need help in database design

2024-12-23 Thread Ron Johnson
gt; > On Mon, Dec 23, 2024 at 11:48 PM Divyansh Gupta JNsThMAudy < > ag1567...@gmail.com> wrote: > >> Adrian, the partition is on userid using hash partition with 84 partitions >> >> Ron, there could be more than 20 Million records possible for a single >> u

Re: Need help in database design

2024-12-23 Thread Ron Johnson
Where are the 50 "t* columns? On Mon, Dec 23, 2024 at 1:26 PM Divyansh Gupta JNsThMAudy < ag1567...@gmail.com> wrote: > Ron here is the entire table schema FYI, userid is the mandate column on > which filter is always applies: > > CREATE TABLE dbo.googledocs_tbl ( >

Re: Display Bytea field

2025-01-10 Thread Ron Johnson
On Fri, Jan 10, 2025 at 7:49 AM Daniel Verite wrote: [snip] > Alternatively, you could compare image checksums before and > after moving them into postgres. The advantage is that you > don't need to export or view any file, and you compare globally > all your images. If the checksums are identica

Re: glibc 2.35-2.39 upgrade requirements

2025-01-17 Thread Ron Johnson
On Fri, Jan 17, 2025 at 1:12 AM Kamen Kalchev wrote: > Hi everyone, we're planning to upgrade the OS running Postgres from ubuntu > jammy to ubuntu noble. As part of the OS change, the glibc version will be > changed from glibc 2.35 to glibc 2.39.. > > Can someone confirm if changing the glibc be

Re: Postgres do not support tinyint?

2025-01-07 Thread Ron Johnson
On Wed, Jan 8, 2025 at 12:06 AM Igor Korot wrote: > Hi, ALL, > According to https://www.postgresql.org/docs/9.1/datatype-numeric.html, > the > smallest numeric type supports numbers from -32768 to 32767/ > > My data will be in a range of [0..4], and so I guess my DB table will waste > space, righ

Re: Alter table fast

2025-01-09 Thread Ron Johnson
On Thu, Jan 9, 2025 at 11:25 AM veem v wrote: > Hello, > It's postgres version 16.1, we want to convert an existing column data > type from integer to numeric and it's taking a long time. The size of the > table is ~50GB and the table has ~150million rows in it and it's not > partitioned. We trie

Re: recovery error while running any statement

2025-01-09 Thread Ron Johnson
On Thu, Jan 9, 2025 at 11:42 AM yudhi s wrote: > Hello Experts, > It's postgres aurora version 16. While running the ALTER command on any > object we see an error "*Only RowExclusiveLock or less can be acquired on > database objects during recovery*". If I run any DML it gives an error > stating

Re: recovery error while running any statement

2025-01-09 Thread Ron Johnson
On Thu, Jan 9, 2025 at 12:01 PM yudhi s wrote: > > On Thu, Jan 9, 2025 at 10:21 PM Adrian Klaver > wrote: > >> On 1/9/25 08:42, yudhi s wrote: >> > Hello Experts, >> > It's postgres aurora version 16. While running the ALTER command on >> any >> > object we see an error "/Only RowExclusiveLock

Re: INTERVAL MINUTE TO SECOND didn't do what I thought it would do

2025-01-08 Thread Ron Johnson
On Wed, Jan 8, 2025 at 3:07 PM Adrian Klaver wrote: > > > On 1/8/25 11:58 AM, Ron Johnson wrote: > > On Wed, Jan 8, 2025 at 2:43 PM Adrian Klaver > <mailto:adrian.kla...@aklaver.com>> wrote: > > > > > > I'd hoped that ::INTERVAL MINUTE TO S

Re: Display Bytea field

2025-01-09 Thread Ron Johnson
On Thu, Jan 9, 2025 at 3:17 PM Andy Hartman wrote: > How thru a simple query can I make sure data matches and I can display it > > On Thu, Jan 9, 2025 at 3:16 PM Andy Hartman > wrote: > >> I have migrated over a Table from Mssql that had an Image column I now >> have it in Postgres >> > Did SSMS

Re: Display Bytea field

2025-01-09 Thread Ron Johnson
Sure. There's at least one Postgresql driver for PS, and Google says there are 3rd party libraries to display images. It's just a Simple Matter Of Programming! On Thu, Jan 9, 2025 at 3:31 PM Andy Hartman wrote: > could it be done using Powershell? > > On Thu, Jan 9,

Re: psql command line editing

2025-02-12 Thread Ron Johnson
On Wed, Feb 12, 2025 at 2:29 PM Tom Lane wrote: > Ron Johnson writes: > > On Wed, Feb 12, 2025 at 1:50 PM Rich Shepard > > wrote: > >> My web searches suggest that using the psql command line I'm limited to > >> moving the cursor one character at

Re: Bash profile

2025-02-15 Thread Ron Johnson
On Sat, Feb 15, 2025 at 2:01 PM Yongye Serkfem wrote: > Hi Everyone! > I would appreciate any assistance with configuring the bash profile to run > two different postgresql versions. Specifically V12.7 and 15.7 > Create a bash function that exports PGDATA to the relevant directory, based on the

Re: Bash profile

2025-02-15 Thread Ron Johnson
at 2:17 PM Yongye Serkfem wrote: > I am upgrading from version 12.7 to 15.7 > > On Sat, Feb 15, 2025, 2:15 PM Ron Johnson wrote: > >> On Sat, Feb 15, 2025 at 2:01 PM Yongye Serkfem >> wrote: >> >>> Hi Everyone! >>> I would appreciate any assista

Re: Bloated toast table with empty associated table

2025-03-20 Thread Ron Johnson
records. And... it did just that. But what *must* PG do when it discovers a constraint violation 99% of the way through inserting those 100 records? That's right: remove the records. Thus, you get bloat. > On Thu, Mar 20, 2025 at 4:28 PM Ron Johnson > wrote: > > > > On Th

Re: Experience and feedback on pg_restore --data-only

2025-03-21 Thread Ron Johnson
On Fri, Mar 21, 2025 at 2:36 PM Dimitrios Apostolou wrote: > On Thu, 20 Mar 2025, Dimitrios Apostolou wrote: > > > Rationale: > > > > When restoring a backup in an emergency situation, it's fine to run > > pg_restore as superuser and get an exact replica of the dumped db. > How often do you have

Re: Experience and feedback on pg_restore --data-only

2025-03-24 Thread Ron Johnson
Why are you regularly having emergencies requiring the restoration of multi-TB tables to databases with lots of cruft? Fixing that would go a long way towards eliminating your problems with pg_restore. On Mon, Mar 24, 2025 at 11:51 AM Dimitrios Apostolou wrote: > On Mon, 24 Mar 2025, Adrian Kla

Re: size of attributes table is too big

2025-03-25 Thread Ron Johnson
a table with size over 500GB. It is going to take a couple of hours I > presume. > > Also, I hope aggressive vacuuming will prevent us from this situation. > > Regards > Siraj > > > > > On Wed, Mar 19, 2025 at 11:27 PM Ron Johnson > wrote: > >> On Wed, M

Re: Cannot pg_dump_all anymore...

2025-03-18 Thread Ron Johnson
On Tue, Mar 18, 2025 at 5:14 AM E-BLOKOS wrote: > I got this error: > > pg_dump: error: query returned 0 rows instead of one: EXECUTE > dumpBaseType('794978') > > any clue to solve it? > PG version? Whole command line, including all error messages? -- Death to , and butter sauce. Don't boil m

Re: Query optimization

2025-03-13 Thread Ron Johnson
On Thu, Mar 13, 2025 at 11:48 PM Durgamahesh Manne < maheshpostgr...@gmail.com> wrote: > On Fri, 14 Mar, 2025, 09:11 Ron Johnson, wrote: > >> On Thu, Mar 13, 2025 at 11:25 PM Durgamahesh Manne < >> maheshpostgr...@gmail.com> wrote: >> >>> On Fri, M

Re: Creating a new database on a different file system

2025-03-17 Thread Ron Johnson
On Mon, Mar 17, 2025 at 11:18 AM Laurenz Albe wrote: > On Mon, 2025-03-17 at 15:51 +0100, Luca Ferrari wrote: > > On Mon, Mar 17, 2025 at 3:49 PM Ian Dauncey > wrote: > > > We have created a few databases on the file system defined in the > postgresql.conf, > > > but now I would like to create a

Re: Creating a new database on a different file system

2025-03-17 Thread Ron Johnson
On Mon, Mar 17, 2025 at 4:30 PM Laurenz Albe wrote: > On Mon, 2025-03-17 at 14:33 -0400, Ron Johnson wrote: > > On Mon, Mar 17, 2025 at 11:18 AM Laurenz Albe > wrote: > > > On Mon, 2025-03-17 at 15:51 +0100, Luca Ferrari wrote: > > > > On Mon, Mar 17, 2025 at

Re: Bloated toast table with empty associated table

2025-03-20 Thread Ron Johnson
ot;vacuumdb -d the_db -t > controlzone_passage". How often you run it depends on how quickly it > bloats. > > Seems like it is the only solution for now. > The autovacuum daemon can't know/see everything. > On Thu, Mar 20, 2025 at 4:03 PM Ron Johnson > wrote: &

Re: Export operation efficiency in read replica

2025-03-20 Thread Ron Johnson
On Thu, Mar 20, 2025 at 7:52 AM Siraj G wrote: > Hello Experts! > > I have a DB with 1TB in size serving needs of one of our critical > applications. I have a requirement to take export of the DB on a daily > basis, but want to carry out this operation in read replica. The postgresql > version is

Re: Bloated toast table with empty associated table

2025-04-05 Thread Ron Johnson
On Thu, Mar 20, 2025 at 7:40 AM Paul Allen wrote: > Hello. > > Preconditions. > > I have some empty table and constantly try to execute `insert ... on > conflict do update ...` on it. My data in row which I try to insert is > invalid by violation of foreing key constraint, so I am getting error >

Re: Any industry best practise to overcome this specific malware "pg_mem"

2025-04-05 Thread Ron Johnson
On Wed, Apr 2, 2025 at 11:31 AM Adrian Klaver wrote: > On 4/2/25 08:18, Bharani SV-forum wrote: > > Hello MVP's > > Good Morning > > Any industry best practise to overcome this specific malware "pg_mem". > > > > url = > > > https://www.aquasec.com/blog/pg_mem-a-malware-hidden-in-the-postgres-proc

Re: Archive logging not cleaning up pg_wal directory

2025-04-10 Thread Ron Johnson
On Thu, Apr 10, 2025 at 8:29 AM Justin Swanhart wrote: > Hi, > > I have the following in my postgresql.conf for archive logging: > archive_command='test ! -f /var/lib/postgresql/prod_archive_logs/%f && cp > %p /var/lib/postgresql/prod_archive_logs/%f' > > This command is properly copying the log

Re: Wal file query

2025-04-08 Thread Ron Johnson
You cannot connect to the Primary while connected to the Replica, except via postgres_fdw. Even then, it might not work, since the replica replicates _fdw definitions. These exist on the primary: pg_current_wal_lsn() pg_replication_slots pg_stat_replication These exist on the replica: pg_last_

Re: PgBackRest fails due to filesystem full

2025-04-09 Thread Ron Johnson
Try creating a new stanza, and doing a full backup from it. On Wed, Apr 9, 2025 at 1:49 AM KK CHN wrote: > > > On Tue, Apr 8, 2025 at 10:28 PM Greg Sabino Mullane > wrote: > >> On Mon, Apr 7, 2025 at 5:32 AM KK CHN wrote: >> >>> *ERROR: [082]: WAL segment 000101EB00*4B was not arch

Re: BTREE index: field ordering

2025-03-28 Thread Ron Johnson
On Fri, Mar 28, 2025 at 9:35 AM Laurenz Albe wrote: > On Fri, 2025-03-28 at 13:38 +0100, Moreno Andreo wrote: > > Postgres 16.4 (planning to go on 17.4) > > I'm creating some indexes based on some slow query reported by logs. > > These queries involve a WHERE with more than 5 fields, that are

Re: Query optimization

2025-03-13 Thread Ron Johnson
On Thu, Mar 13, 2025 at 10:16 PM Durgamahesh Manne < maheshpostgr...@gmail.com> wrote: [snip] > Hi Adrian Klaver > > 1) Postgres version. > select version(); > version > > -

Re: Query optimization

2025-03-13 Thread Ron Johnson
On Thu, Mar 13, 2025 at 11:25 PM Durgamahesh Manne < maheshpostgr...@gmail.com> wrote: > On Fri, Mar 14, 2025 at 8:19 AM Ron Johnson > wrote: > >> On Thu, Mar 13, 2025 at 10:16 PM Durgamahesh Manne < >> maheshpostgr...@gmail.com> wrote: >> [snip] >

Re: #1 - Known bug (memory related) with respect to Aurora postgresql 13.16.3

2025-03-17 Thread Ron Johnson
Aurora is very nonstandard. Thus, "we" don't support it. Having said that... "report running out of memory" smells like work_mem is set too high. On Mon, Mar 17, 2025 at 3:12 PM Bharani SV-forum wrote: > Team > Any one faced similar issue with Ver 13.16.X > > > > - Forwarded Message -

Re: To take backup of Postgresql Database without large objects

2025-04-11 Thread Ron Johnson
On Fri, Apr 11, 2025 at 8:56 AM sivapostg...@yahoo.com < sivapostg...@yahoo.com> wrote: > Hello, > > Using PostgreSQL 15.1, compiled by Visual C++ build 1914, 64-bit in > Windows 10. > That's 11 patch releases behind current. > Trying to take backup of a database, using pg_dump, where one table

Re: Best Tool for PostgreSQL Auditing and Storing Audit Logs Separately

2025-04-16 Thread Ron Johnson
pgaudit is statement-level, not transaction-level; that's its nature. This is the same as log_statement. On Wed, Apr 16, 2025 at 5:10 AM Achilleas Mantzios - cloud < a.mantz...@cloud.gatewaynet.com> wrote: > On 4/15/25 12:14, KENAN ÇİFTÇİ wrote: > > Hi, > > You can use pgaudit and pgauditlogtofi

Re: verify checksums online

2025-04-18 Thread Ron Johnson
On Fri, Apr 18, 2025 at 5:18 PM Jeremy Schneider wrote: > i should know the answer to this... but asking anyway > > i think there had been some mailing list discussions years ago? the > pg_checksum utility in core still can't do an online check right? > https://www.postgresql.org/docs/17/app-pgc

Re: Order of update

2025-04-20 Thread Ron Johnson
On Sun, Apr 20, 2025 at 5:35 AM Thiemo Kellner wrote: > Very interesting. But is the sort overhead worth it? Why not make the > constraint deferrable before the update and switch back afterwards? > The role which runs the UPDATE might not have the priv to ALTER TABLE ... ALTER CONSTRAINT. -- D

Re: Changing default fillfactor for the whole database

2025-04-27 Thread Ron Johnson
On Sat, Apr 26, 2025 at 10:31 PM Marcelo Fernandes wrote: > Hi there, > > I have a scenario where virtually all user tables in the database will > need to > have a lower fill factor. > > It would have been handy to have a way to set this default, but as of now, > I > don't think the default can b

Re: Index not used in certain nested views but not in others

2025-04-30 Thread Ron Johnson
On Wed, Apr 30, 2025 at 3:51 PM Markus Demleitner < msdem...@ari.uni-heidelberg.de> wrote: > Dear List, > > I know how tedious mails with a subject of the type "I don't understand > what the planner does" are, but on this one I'm really stumped. > Regrettably, the situation is also a bit complex.

Re: Best Tool for PostgreSQL Auditing and Storing Audit Logs Separately

2025-04-16 Thread Ron Johnson
On Wed, Apr 16, 2025 at 3:42 PM Nico Williams wrote: > On Wed, Apr 16, 2025 at 02:43:59PM -0400, Ron Johnson wrote: > > You'll have to bring that up with the PgAudit maintainer. Note, though, > > that the purpose of PgAudit is not "recreate the database from audi

Re: Best Tool for PostgreSQL Auditing and Storing Audit Logs Separately

2025-04-16 Thread Ron Johnson
n Wed, Apr 16, 2025 at 1:35 PM Achilleas Mantzios < a.mantz...@cloud.gatewaynet.com> wrote: > On 16/4/25 15:36, Ron Johnson wrote: > > > pgaudit is statement-level, not transaction-level; that's its nature. > This is the same as log_statement. > > ok, but log_statement p

Re: Cannot turn track_counts on

2025-04-17 Thread Ron Johnson
On Thu, Apr 17, 2025 at 5:13 AM Anton Shepelev wrote: > Daniel Gustafsson: > > > Also, is this by any chance a managed instance like Amazon > > RDS or Azure, or is it a local database under your > > control? > > It is a normal installation on a Linux machine, and my > company has full root access

Re: Best Tool for PostgreSQL Auditing and Storing Audit Logs Separately

2025-04-16 Thread Ron Johnson
On Wed, Apr 16, 2025 at 3:15 PM Achilleas Mantzios < a.mantz...@cloud.gatewaynet.com> wrote: > On 16/4/25 21:43, Ron Johnson wrote: > > > You'll have to bring that up with the PgAudit maintainer. Note, though, > that the purpose of PgAudit is not "recreate the da

Re: Upgrading PG11 to PG17 without dump/restore

2025-05-01 Thread Ron Johnson
On Thu, May 1, 2025 at 9:06 AM Durumdara wrote: > Hello! > > There is a heavily used server, with older debian, and PG11. > The data is more than 1,2 TB. > The PG_Upgrade is not possible because of lesser space and too old debian. > > As we see now we have only one way to move this server. > 1.)

Re: Fwd: Identify system databases

2025-04-15 Thread Ron Johnson
On Tue, Apr 15, 2025 at 3:11 PM Tom Lane wrote: > "David G. Johnston" writes: > > On Tue, Apr 15, 2025 at 11:20 AM Adrian Klaver < > adrian.kla...@aklaver.com> > > wrote: > >> If what you say is true why does initdb lack an option to not create > >> them on creating a cluster? > > > By creating

Re: The performance issues caused by upgrading PostgreSQL to version 16.3.

2025-02-17 Thread Ron Johnson
On Mon, Feb 17, 2025 at 2:55 AM 馬 騰飛 wrote: > Dear PostgreSQL Community, > > I hope this message finds you well. I am reaching out to seek your > technical assistance regarding a performance issue we encountered after > upgrading our PostgreSQL version from 12.19 to 16.3. > We have noticed a sign

Loading the latest N rows into the cache seems way too fast.

2025-02-17 Thread Ron Johnson
PG 9.6.24 and PG 14.15, if it matters. (Yes, 9.6 is really EOL. I don't control that.) (I could use pg_prewarm, but the table is much bigger than RAM, and last_block value only has the newest record if data has never been deleted. The oldest records regularly get deleted, and then the table is v

Re: Loading the latest N rows into the cache seems way too fast.

2025-02-17 Thread Ron Johnson
On Mon, Feb 17, 2025 at 4:36 PM Tom Lane wrote: > Ron Johnson writes: > > The bigint "id" column in "mytbl" is populated from a sequence, and so is > > monotonically increasing: the newest records will have the biggest id > > values. > > The ta

Re: Loading the latest N rows into the cache seems way too fast.

2025-02-17 Thread Ron Johnson
On Mon, Feb 17, 2025 at 4:51 PM Tom Lane wrote: > Ron Johnson writes: > > On Mon, Feb 17, 2025 at 4:36 PM Tom Lane wrote: > >> It's not pulling in the TOAST storage where the bytea column lives. > >> (pg_prewarm wouldn't have either, without special

Re: create_immv issue on aws Ubuntu even after create extention

2025-03-02 Thread Ron Johnson
nt is this works perfectly on all local machines with > exact same versions and same data. > > Regards. > On 2/28/25 22:24, Ron Johnson wrote: > > On Fri, Feb 28, 2025 at 11:41 AM Krishnakant Mane > wrote: > >> Hello all. >> >> I am not able to use create_im

Re: No. Of wal files generated

2025-03-07 Thread Ron Johnson
overwritten, purges old ones when not needed etc. Even compresses and encrypts them if you want. > > > Regards. > > > > On Sat, 8 Mar 2025, 01:37 Ron Johnson, wrote: > >> inotifywait can log every file creation and deletion in a directory. >> >> Hones

Re: No. Of wal files generated

2025-03-07 Thread Ron Johnson
cess and > archival process. > > So I want to check how many wal file got created in x minutes and how many > .ready files got created in those x minutes. > > > > Regards, > Atul > > On Fri, 7 Mar 2025, 22:45 Ron Johnson, wrote: > >> On Fri, Mar 7, 2025 at 10:

psql and regex not like

2025-03-07 Thread Ron Johnson
This statement runs great from the psql prompt. Does exactly what I want. select datname from pg_database WHERE datname !~ 'template|postgres' ORDER BY datname; But it doesn't work so well from the bash prompt. Not escaping the "!" generates a bunch of garbage, while escaping throws an sql synta

<    11   12   13   14   15   16   17   >