Re: Creating files with testdata

2025-03-10 Thread H
On March 10, 2025 3:27:02 PM GMT-04:00, Francisco Olarte wrote: >On Mon, 10 Mar 2025 at 20:18, H wrote: >> There are tables referencing each other using randomly generated IDs, >ie. those IDs are not known until after the parent table row is >inserted. > >Random? Then they CAN collide. ;-> > >Do

Re: Creating files with testdata

2025-03-10 Thread H
On March 10, 2025 3:15:10 PM EDT, H wrote: >On March 10, 2025 2:26:48 PM GMT-04:00, Adrian Klaver > wrote: >> >> >>On 3/10/25 11:09 AM, H wrote: >>> I am developing a complex multi-tenant application in postgresql 16 >>in Linux. During the development I would like to be able to enter test >>data i

Re: No. Of wal files generated

2025-03-10 Thread Achilleas Mantzios - cloud
On 3/7/25 17:59, Atul Kumar wrote: Hi, Please could you help me by sharing any redhat linux command through which I can count the no. of wal files and no. of ".ready" files generated in last 10 minutes. Do you have wal archiving enabled? If yes, then simply go to the archive dir and suit y

Re: exclusion constraint question

2025-03-10 Thread Achilleas Mantzios - cloud
On 3/8/25 21:01, Rhys A.D. Stewart wrote: Greetings All, I have the following table: CREATE TABLE shelves( shelf_id bigint PRIMARY KEY, l_mug_id bigint UNIQUE, c_mug_id bigint UNIQUE, r_mug_id bigint UNIQUE, CHECK (l_mug_id <> c_mug_id AND l_mug_id <> r_mug_id AND c_mu

Re: exclusion constraint question

2025-03-10 Thread personal
Hey Rhys, I think you might be better served doing something like CREATE TABLE shelve_items( id bigint PRIMARY KEY, shelf_id bigint, column_name VARCHAR, mug_id bigint UNIQUE ) and then putting a unique index on (shelf_id, column_name): CREATE UNIQUE INDEX shelve

Re: exclusion constraint question

2025-03-10 Thread Achilleas Mantzios - cloud
On 3/10/25 10:43, Achilleas Mantzios - cloud wrote: On 3/8/25 21:01, Rhys A.D. Stewart wrote: Greetings All, I have the following table: CREATE TABLE shelves( shelf_id bigint PRIMARY KEY, l_mug_id bigint UNIQUE, c_mug_id bigint UNIQUE, r_mug_id bigint UNIQUE, CHECK

Re: Creating files with testdata

2025-03-10 Thread H
On March 10, 2025 3:22:41 PM GMT-04:00, Francisco Olarte wrote: >On Mon, 10 Mar 2025 at 19:17, H wrote: >... >> After entering my test data into the markdown file for the given test >scenario, I would then run an awk script or similar to create a SQL >file with the various CTE INSERT statements.

Re: Creating files with testdata

2025-03-10 Thread H
On March 10, 2025 3:21:57 PM GMT-04:00, "David G. Johnston" wrote: >On Mon, Mar 10, 2025 at 12:17 PM H wrote: > >> There are tables referencing each other using randomly generated IDs, >ie. >> those IDs are not known until after the parent table row is inserted. >> > >I just reserve half of the

Re: exclusion constraint question

2025-03-10 Thread Rhys A.D. Stewart
Greetings, > I think I got it : > > ALTER TABLE shelves ADD CONSTRAINT shelves_excl EXCLUDE USING gist( > array_remove((ARRAY[l_mug_id,c_mug_id,r_mug_id]::int[]),NULL) WITH && ); > > but the caveat is I had to cast to 32-bit int array. Haven't found any > opclass for int8 (bigint) in intarray