public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: mark bradley <[email protected]>
To: Ron Johnson <[email protected]>
To: pgsql-general <[email protected]>
Subject: Re: Duplicate Key Values
Date: Thu, 13 Mar 2025 09:05:37 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <SJ2PR22MB4328E65C7F54C164917C5063BAD32@SJ2PR22MB4328.namprd22.prod.outlook.com>
References: <CH3PR22MB4312C23476C0E67F9B4C2E10BACB2@CH3PR22MB4312.namprd22.prod.outlook.com>
	<SJ2PR22MB4328267BD9F601D90601715BBAD12@SJ2PR22MB4328.namprd22.prod.outlook.com>
	<[email protected]>
	<SJ2PR22MB4328A3EDC83E495DB9A4BD09BAD12@SJ2PR22MB4328.namprd22.prod.outlook.com>
	<[email protected]>
	<SJ2PR22MB4328CEB1B47FC1AC4A996CB3BAD12@SJ2PR22MB4328.namprd22.prod.outlook.com>
	<[email protected]>
	<SJ2PR22MB432802BD55A9AEFCF212F4A7BAD12@SJ2PR22MB4328.namprd22.prod.outlook.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<SJ2PR22MB43283C748A57C46E382FF4A3BAD32@SJ2PR22MB4328.namprd22.prod.outlook.com>
	<CANzqJaDDg51R2UvWgSw10+zxN9BteocWOAyGwWpuPq9hYXKkJQ@mail.gmail.com>
	<SJ2PR22MB4328E65C7F54C164917C5063BAD32@SJ2PR22MB4328.namprd22.prod.outlook.com>

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 <parent_table>" clause to the >"CREATE TABLE foo"  
> statement.
> 
>  >Are you creating the tables via PgAdmin point-and-click?
> 
> I am using PgAdmin 4 v9.1.
> 
> I think the problem may also be related to the fact that I had 
> *node_id* and *node_type *were in both tables from an earlier design and 
> Postgres would not let me delete* node_type* from the* dataset* table.

Because it was inherited:

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);

alter table node_1 drop column fld1;
ERROR:  cannot drop inherited column "fld1"

> 
> As an experiment, I created a simple version of the same tables from 
> scratch without *node_type* in the *dataset* table.  So far, no dups are 
> appearing.

I'm assuming that by 'simple version' you mean no inheritance.

> 
> Best regards,
> Mark Brady
> _amazon.com/author/markjbrady <https://amazon.com/author/markjbrady>_
> ------------------------------------------------------------------------


-- 
Adrian Klaver
[email protected]







view thread (25+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Duplicate Key Values
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox