Re: Cannot drop column - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Cannot drop column
Date
Msg-id 5060eb8f-2618-4cfb-8714-11907b440193@aklaver.com
Whole thread Raw
In response to Re: Cannot drop column  (Rich Shepard <rshepard@appl-ecosys.com>)
List pgsql-general

On 12/18/24 11:04 AM, Rich Shepard wrote:
> On Wed, 18 Dec 2024, Viral Shah wrote:
> 
>> Since your column name has an Upper case character, you will have to use
>> double quotes to drop it. Try alter table statustypes drop column 
>> "Suspect";
> 
> Viral,
> 
> Huh! I've not before encountered this in the 30+ years I've used postgres.

It has been that way for a long time:

https://www.postgresql.org/docs/7.0/syntax525.htm

Your issue though is as Ron pointed out:

alter table statustypes drop column Suspect

That is trying to drop a column named "Suspect" when in fact the column 
name is stat_name. 'Suspect' is a value in the column.

> 
> Thanks for the lesson.
> 
> Regards,
> 
> Rich
> 
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Cannot drop column
Next
From: Adrian Klaver
Date:
Subject: Re: Intermittent errors when fetching cursor rows on PostgreSQL 16