pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: Drop column constraint [FIXED]
3+ messages / 2 participants
[nested] [flat]

* Re: Drop column constraint [FIXED]
@ 2020-10-30 15:54 Rich Shepard <rshepard@appl-ecosys.com>
  2020-10-30 15:57 ` Re: Drop column constraint [FIXED] Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Rich Shepard @ 2020-10-30 15:54 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On Fri, 30 Oct 2020, Adrian Klaver wrote:

> It should be:
> alter table locations drop constraint 'constraint_name';

Adrian,

Yes, I forgot to quote the constraint_name, And, I used the DDL name
'unique' rather than the internal name "locations_loc_nbr_key". Using the
latter, and adding 'cascade' (because the dependent table is empty) did the
trick.

Thank you,

Rich






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Drop column constraint [FIXED]
  2020-10-30 15:54 Re: Drop column constraint [FIXED] Rich Shepard <rshepard@appl-ecosys.com>
@ 2020-10-30 15:57 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2020-10-30 16:46   ` Re: Drop column constraint [FIXED] Rich Shepard <rshepard@appl-ecosys.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Adrian Klaver @ 2020-10-30 15:57 UTC (permalink / raw)
  To: Rich Shepard <rshepard@appl-ecosys.com>; pgsql-general@lists.postgresql.org

On 10/30/20 8:54 AM, Rich Shepard wrote:
> On Fri, 30 Oct 2020, Adrian Klaver wrote:
> 
>> It should be:
>> alter table locations drop constraint 'constraint_name';
> 
> Adrian,
> 
> Yes, I forgot to quote the constraint_name, And, I used the DDL name
> 'unique' rather than the internal name "locations_loc_nbr_key". Using the

Actually unique is not the name, it is the constraint type. You can 
create your own name when creating the constraint or Postgres will 
create one for you.

> latter, and adding 'cascade' (because the dependent table is empty) did the
> trick.
> 
> Thank you,
> 
> Rich
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Drop column constraint [FIXED]
  2020-10-30 15:54 Re: Drop column constraint [FIXED] Rich Shepard <rshepard@appl-ecosys.com>
  2020-10-30 15:57 ` Re: Drop column constraint [FIXED] Adrian Klaver <adrian.klaver@aklaver.com>
@ 2020-10-30 16:46   ` Rich Shepard <rshepard@appl-ecosys.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Rich Shepard @ 2020-10-30 16:46 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On Fri, 30 Oct 2020, Adrian Klaver wrote:

> Actually unique is not the name, it is the constraint type. You can create
> your own name when creating the constraint or Postgres will create one for
> you.

Adrian,

Got it, thanks.

Rich





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-10-30 16:46 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30 15:54 Re: Drop column constraint [FIXED] Rich Shepard <rshepard@appl-ecosys.com>
2020-10-30 15:57 ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-10-30 16:46   ` Rich Shepard <rshepard@appl-ecosys.com>

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