Re: Duplicate Key Values

2025-03-15 Thread mark bradley
ubject: Re: Duplicate Key Values On 3/13/25 09:25, mark bradley wrote: > > > I'm assuming that by 'simple version' you mean no inheritance. > > Inheritance was not specified by me in either case. By simple, I mean Unless someone else is working on this code, it was don

Re: Duplicate Key Values

2025-03-13 Thread Adrian Klaver
On 3/13/25 09:25, mark bradley wrote: > I'm assuming that by 'simple version' you mean no inheritance. Inheritance was not specified by me in either case.  By simple, I mean Unless someone else is working on this code, it was done by you. Pretty sure it had to do with from this message: h

Re: Duplicate Key Values

2025-03-13 Thread mark bradley
com/author/markjbrady> From: Adrian Klaver Sent: Thursday, March 13, 2025 12:05 PM To: mark bradley ; Ron Johnson ; pgsql-general Subject: Re: Duplicate Key Values On 3/13/25 08:56, mark bradley wrote: > >Postgresql does not assume / default to inheri

Re: Duplicate Key Values

2025-03-13 Thread mark bradley
sql-general Subject: Re: Duplicate Key Values On 3/13/25 08:56, mark bradley wrote: > >Postgresql does not assume / default to inheritance. In text-mode > clients where you type >in "raw" SQL, you have to explicitly add an > explicit "INHERITS " clause to the

Re: Duplicate Key Values

2025-03-13 Thread Adrian Klaver
On 3/13/25 08:56, mark bradley wrote: >Postgresql does not assume / default to inheritance.  In text-mode clients where you type >in "raw" SQL, you have to explicitly add an explicit "INHERITS " clause to the >"CREATE TABLE foo" statement. >Are you creating the tables via PgAdmin point-and

Re: Duplicate Key Values

2025-03-13 Thread Adrian Klaver
On 3/13/25 07:56, mark bradley wrote: >Mark, to illustrate: So, I think the crux of the problem is that Postgres assumes that inheritance is declared when it is not. Follow up. From pgAdmin end: https://www.pgadmin.org/docs/pgadmin4/9.1/table_dialog.html "Use the drop-down listbox next t

Re: Duplicate Key Values

2025-03-13 Thread Adrian Klaver
On 3/13/25 07:56, mark bradley wrote: >Mark, to illustrate: >create table node (node_id integer primary key, fld1 varchar); >create table node_1 (node_id integer primary key, node_1_fld boolean) >inherits ( node); >NOTICE:  merging column "node_id" with inherited definition >insert into n

Re: Duplicate Key Values

2025-03-12 Thread Adrian Klaver
On 3/11/25 13:24, Adrian Klaver wrote: On 3/11/25 12:55, mark bradley wrote: It happened again.  Now there are no sequences (although there once was). Read my previous post and provide the information requested. Mark sent me the below, which answers some of the questions, namely there is i

Re: Duplicate Key Values

2025-03-12 Thread Adrian Klaver
On 3/12/25 08:46, Adrian Klaver wrote: On 3/11/25 13:24, Adrian Klaver wrote: On 3/11/25 12:55, mark bradley wrote: It happened again.  Now there are no sequences (although there once was). Read my previous post and provide the information requested. Mark sent me the below, which answers s

Re: Duplicate Key Values

2025-03-11 Thread Adrian Klaver
/node_id/s in table node as a primary key. 2. I reentered the datasets, in table /dataset/. 3. /Node_id/ was already a PK in dataset. 4. _I set _/_node_id_/_ to also be a foreign key in _/_dataset_/_._ 5. I went back to look at /node/ and see that duplicate key values appeared

Re: Duplicate Key Values

2025-03-11 Thread mark bradley
key in dataset. 5. I went back to look at node and see that duplicate key values appeared. [cid:c13bcb32-fda3-41d6-9b43-688f6e1cdad8] [cid:2382fdb0-9b71-44f6-848f-69aae7ab8444] Processing nodes are unaffected because I didn't add any data to the processing_node table. Next, I'm going

Re: Duplicate Key Values

2025-03-11 Thread Adrian Klaver
On 3/11/25 11:52, mark bradley wrote: there is an index on node_id as it is the Primary Key. Why do you think there is not? My mistake, I misread the output from \d dataset Can you elaborate more on point 3. Are you calling the Foreign Key relationships subclassing? Although I d

Re: Duplicate Key Values

2025-03-11 Thread mark bradley
_ From: Adrian Klaver Sent: Tuesday, March 11, 2025 12:00 PM To: mark bradley Cc: pgsql-general Subject: Re: Duplicate Key Values On 3/11/25 08:16, mark bradley wrote: A) 1) Please do not top post. Either inline or bottom post. It makes things like the below easier to follow. I wrote the po

Re: Duplicate Key Values

2025-03-11 Thread mark bradley
adley Cc: pgsql-general Subject: Re: Duplicate Key Values On 3/7/25 11:47, mark bradley wrote: > Wouldn't that be nice 🙂 No, because you would end up with a mess. My AI rant: AI is neither artificial or intelligent. It is human code that pattern matches and then throws the matches a

Re: Duplicate Key Values

2025-03-11 Thread Greg Sabino Mullane
A reindex is not going to remove rows from the table, so we need to see how you came to the conclusion that it did. Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support

Re: Duplicate Key Values

2025-03-11 Thread Adrian Klaver
mazon.com/author/markjbrady>_ *From:* Adrian Klaver *Sent:* Tuesday, March 11, 2025 11:12 AM *To:* mark bradley *Cc:* pgsql-general *Subject:* Re: Duplicate Key Values On 3/11/25 08:05, mark bradley wrote: The rows that were preserved in the nodes tabl

Re: Duplicate Key Values

2025-03-11 Thread mark bradley
radley Cc: pgsql-general Subject: Re: Duplicate Key Values On 3/11/25 08:05, mark bradley wrote: > The rows that were preserved in the nodes table were the ones that were > not dups originally. 1) To be specific: a) If there where two or more rows with a node_id, after the reindexing was th

Re: Duplicate Key Values

2025-03-11 Thread Ron Johnson
estions. > > Best regards, > Mark Brady > *amazon.com/author/markjbrady <https://amazon.com/author/markjbrady>* > -- > *From:* Adrian Klaver > *Sent:* Friday, March 7, 2025 3:25 PM > *To:* mark bradley > *Cc:* pgsql-general > *Subject:* Re: Dupl

Re: Duplicate Key Values

2025-03-11 Thread Adrian Klaver
ady>_ *From:* Adrian Klaver *Sent:* Tuesday, March 11, 2025 10:56 AM *To:* mark bradley *Cc:* pgsql-general *Subject:* Re: Duplicate Key Values On 3/11/25 07:28, mark bradley wrote: An "interesting" effect of reindexing is that all the records that w

Re: Duplicate Key Values

2025-03-11 Thread mark bradley
radley Cc: pgsql-general Subject: Re: Duplicate Key Values On 3/11/25 07:28, mark bradley wrote: > An "interesting" effect of reindexing is that all the records that were > dups in the nodes table were deleted, both copies. I am trying to understand above. Was there at least o

Re: Duplicate Key Values

2025-03-11 Thread Adrian Klaver
On 3/11/25 07:28, mark bradley wrote: An "interesting" effect of reindexing is that all the records that were dups in the nodes table were deleted, both copies. I am trying to understand above. Was there at least one row of each node_id left? Also, all rows having node_id as a foreign key i

Re: Duplicate Key Values

2025-03-11 Thread Greg Sabino Mullane
On Tue, Mar 11, 2025 at 10:29 AM mark bradley wrote: > An "interesting" effect of reindexing is that all the records that were > dups in the nodes table were deleted, both copies. > Er...that's not just interesting, but alarming - if true. Can you show the steps you took? Cheers, Greg -- Crunc

Re: Duplicate Key Values

2025-03-09 Thread mark bradley
Sent: Thursday, March 6, 2025 1:11 PM To: Adrian Klaver ; Ron Johnson ; pgsql-general Subject: Re: Duplicate Key Values Here is the table definition: [cid:ecac8e92-826b-45c8-95a8-aaf0e55c4f9c] And here is the error message I get when I try to delete a duplicate: [cid:a0f5f298-984d-4f8

Re: Duplicate Key Values

2025-03-07 Thread mark bradley
Wouldn't that be nice 🙂 Best regards, Mark Brady amazon.com/author/markjbrady<https://amazon.com/author/markjbrady> From: Adrian Klaver Sent: Friday, March 7, 2025 10:55 AM To: mark bradley Cc: pgsql-general Subject: Re: Duplicate Key Values On 3

Re: Duplicate Key Values

2025-03-07 Thread Adrian Klaver
ubject:* Re: Duplicate Key Values On 3/7/25 06:34, mark bradley wrote: This is what MS Copilot has to say about this apparent bug where Postgres inserts extra rows violating a primary keys uniqueness constraint: What to do?  I hesitate to just delete my tables and start over because this error w

Re: Duplicate Key Values

2025-03-07 Thread Adrian Klaver
On 3/7/25 06:34, mark bradley wrote: This is what MS Copilot has to say about this apparent bug where Postgres inserts extra rows violating a primary keys uniqueness constraint: What to do?  I hesitate to just delete my tables and start over because this error will reoccur. Let the AI solv

Re: Duplicate Key Values

2025-03-07 Thread Greg Sabino Mullane
On Fri, Mar 7, 2025 at 9:35 AM mark bradley wrote: > This is what MS Copilot has to say about this apparent bug where Postgres > inserts extra rows violating a primary keys uniqueness constraint: > > Yes, this issue has been encountered by others. There are a few potential > reasons why this migh

Re: Duplicate Key Values

2025-03-07 Thread mark bradley
/author/markjbrady<https://amazon.com/author/markjbrady> From: mark bradley Sent: Friday, March 7, 2025 9:34 AM To: Adrian Klaver Cc: pgsql-general Subject: Re: Duplicate Key Values This is what MS Copilot has to say about this apparent bug where Postgres i

Re: Duplicate Key Values

2025-03-07 Thread mark bradley
pgsql-general Subject: Re: Duplicate Key Values On 3/6/25 12:06, mark bradley wrote: My mistake I forgot to Cc list on my previous post, which was: That would be an issue and also would mean it is not a PK. In psql do: \d dataset and show the results as text in your reply. Ccing list The bel

Re: Duplicate Key Values

2025-03-06 Thread Adrian Klaver
On 3/6/25 10:11, mark bradley wrote: Here is the table definition: And here is the error message I get when I try to delete a duplicate: Please answer the following: 1) Did you not see duplicates with the old version of pgAdmin4? 2) What do you see if you use psql? 3) Did you upgrade/move

Re: Duplicate Key Values

2025-03-06 Thread Adrian Klaver
) NOT VALID Inherits: node Best regards, Mark Brady _amazon.com/author/markjbrady <https://amazon.com/author/markjbrady>_ ------------ *From:* Adrian Klaver *Sent:* Thursday, March 6, 2025 3:03 PM *To:* mark bradley *Subject:* Re: Duplica

Re: Duplicate Key Values

2025-03-06 Thread Adrian Klaver
rkjbrady>_ *From:* Adrian Klaver *Sent:* Thursday, March 6, 2025 1:22 PM *To:* mark bradley ; Ron Johnson ; pgsql-general *Subject:* Re: Duplicate Key Values On 3/6/25 10:11, mark bradley wrote: Here is the table definition: And here is the error message I

Re: Duplicate Key Values

2025-03-06 Thread mark bradley
ady> From: Adrian Klaver Sent: Wednesday, March 5, 2025 6:49 PM To: Ron Johnson ; pgsql-general Subject: Re: Duplicate Key Values On 3/5/25 15:37, Ron Johnson wrote: > What does "and unique identifier" mean? > > (Creating a Primary Key constraint automatically creates a

Re: Duplicate Key Values

2025-03-05 Thread Adrian Klaver
On 3/5/25 15:37, Ron Johnson wrote: What does "and unique identifier" mean? (Creating a Primary Key constraint automatically creates a unique no-nulls-allowed index on the column(s), so no other index is needed.) Can you show the table definition? Anyway, you /should/ be able to delete one o

Re: Duplicate Key Values

2025-03-05 Thread Ron Johnson
; *From:* Ron Johnson > *Sent:* Wednesday, March 5, 2025 12:50 PM > *To:* pgsql-general@lists.postgresql.org < > pgsql-general@lists.postgresql.org> > *Subject:* Re: Duplicate Key Values > > On Wed, Mar 5, 2025 at 12:36 PM mark bradley > wrote: > > Although I did no

Re: Duplicate Key Values

2025-03-05 Thread Ron Johnson
On Wed, Mar 5, 2025 at 12:36 PM mark bradley wrote: > Although I did not enter them, somehow duplicate primary key values have > appeared in one of my tables. > Is it a text/varchar column? Has the distro been upgraded "recently", or maybe streamed from an older Linux system to a newer Linux sy

Duplicate Key Values

2025-03-05 Thread mark bradley
Although I did not enter them, somehow duplicate primary key values have appeared in one of my tables. I can't remove the offending rows because the key is a foreign key in another table. What to do? Mark Brady, amazon.com/author/markjbrady