Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tNz8d-003LYo-8M for pgsql-general@arkaria.postgresql.org; Wed, 18 Dec 2024 18:51:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tNz8c-000jWm-Kq for pgsql-general@arkaria.postgresql.org; Wed, 18 Dec 2024 18:51:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tNz8c-000jWe-9h for pgsql-general@lists.postgresql.org; Wed, 18 Dec 2024 18:51:14 +0000 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tNz8Z-000S4u-9y for pgsql-general@postgresql.org; Wed, 18 Dec 2024 18:51:13 +0000 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-5f2dee7d218so2788949eaf.2 for ; Wed, 18 Dec 2024 10:51:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734547869; x=1735152669; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=u459fks25TQqiFBQ+oIp+E4lM44rqYEYiKxDF4Bla3o=; b=mfS4NODNKeG+PsVrecP6vMcyxC526RvOoSAzE3K8kteRsOmAFiKkfI2w2nwecyVxy1 0fCSR6aFHrjYfTVqgNsbhpxzTu6wwciXsOHqJGHewxDoFZZZ+Gfq00a36VHA4eKjXrV9 Jb72slPqZUx7krZ/UywrHxUzEn3B2FdUpFXJzpHiWiIGizeccYkIkK6011mL7MU6J6sP K/jrSjFBj4heaJ2G/TYHVJnjJUwZ0OQyeiAIcqIoC3N8LdBGZvGmY8BpdlBashHz93kG 2NO3tOSmpTZluP84sh3odI3EBXx6saH2PM4U+d8ch1loPwZXN8O2nYNHa1SMUrgvkvme 5/AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734547869; x=1735152669; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=u459fks25TQqiFBQ+oIp+E4lM44rqYEYiKxDF4Bla3o=; b=sAxCC5Jf6OoOKlsdfEhsQsFW5QvrW9XBIu9Ye5iQq/kBhtWqWawnh7JFOeTxlsbCQU TbUMUzh0iu82wZgnm5Cx3kEVTLOogcLV5NX4DMwgBac+l4+s0BlV0+Q8MBGwLb14PD9E tzueI/Z/NOynMS+/t27IsjRnMGnJOW48idXo0FTE2N4gIWfl/zKUZFWgGoznWWYXcP7Q 5d978z0zJjck3/0hmmJIR2Q2Pyyi4aTFGykrpAGQiCz113UdRc0heQCipxlXzcPzKPuT xeG3rWh0dlxVWhAaT2JjO0h95phbDxUrn6rseiCpDuPvFJWKwjdhUOoeW5qqBbS6c4gT iT5Q== X-Gm-Message-State: AOJu0Yye4xX0xdG7juXaAaNjEe8tm69hQGuEiUbLL7WxIqf2kMrM/L7l PigcnZVSpMwedoPsVxWAfQoq1xKVHFPIv9Aw0O1IrQBelXx3Kg9e1h9Hg+j+7si9M7iAskTfhX7 +t6+AGCafGTws/lrFn8hfi17CZG3G4Q== X-Gm-Gg: ASbGnctLn9vOjc2Cown4/lrSbnVh67L1fL7BmYQrMfibfCWqWuih6ArqxtmHrILB7fl MMT/shSuhJ4hYQdqk4uFz/wKu+2mGbKsjs3t5n3Qh8Nlla38pRLb8K+BrCd3yeq4KdimSL1ma X-Google-Smtp-Source: AGHT+IF+3tTvFlV6Qt4+uNNRFmxYUhSMGW0fsOCrP3zXFROxe8d9Mjq+KllVSgytog2qWu6jOoSPgowLp22QORt+158= X-Received: by 2002:a05:6871:4b82:b0:29d:c832:7ef6 with SMTP id 586e51a60fabf-2a7b32f38e3mr2181296fac.39.1734547869281; Wed, 18 Dec 2024 10:51:09 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Wed, 18 Dec 2024 13:50:58 -0500 Message-ID: Subject: Re: Cannot drop column To: pgsql-general Content-Type: multipart/alternative; boundary="0000000000009833f706298fe5dc" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009833f706298fe5dc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Dec 18, 2024 at 1:47=E2=80=AFPM Rich Shepard wrote: > I'm not seeing why postgres won't drop a table's column: > > bustrac=3D# select * from statustypes order by stat_name; > stat_name > -------------------- > Client > Lead > No further contact > Opportunity > Proposal submitted > Prospect > Qualified > Referral > Suspect > (9 rows) > > bustrac=3D# alter table statustypes drop column Suspect; > ERROR: column "suspect" of relation "statustypes" does not exist > bustrac=3D# > > What have I done incorrectly? > stat_name is the column. "Suspect" is a row value of column stat_name. DELETE FROM statustypes WHERE stat_name =3D 'Suspect'; --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000009833f706298fe5dc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Dec 18, 2024 at 1:47=E2=80=AFPM R= ich Shepard <rshepard@appl-e= cosys.com> wrote:
I'm not seeing wh= y postgres won't drop a table's column:

bustrac=3D# select * from statustypes order by stat_name;
=C2=A0 =C2=A0 =C2=A0 stat_name
--------------------
=C2=A0 Client
=C2=A0 Lead
=C2=A0 No further contact
=C2=A0 Opportunity
=C2=A0 Proposal submitted
=C2=A0 Prospect
=C2=A0 Qualified
=C2=A0 Referral
=C2=A0 Suspect
(9 rows)

bustrac=3D# alter table statustypes drop column Suspect;
ERROR:=C2=A0 column "suspect" of relation "statustypes"= does not exist
bustrac=3D#

What have I done incorrectly?

stat_name is the column.=C2=A0 "Suspect" is a row value o= f column stat_name.

DELETE FROM statustypes=C2=A0W= HERE stat_name =3D 'Suspect';

--
Death to <Redacted>, and butter sauce.
Don&#= 39;t boil me, I'm still alive.
<Redacted> lobster!
--0000000000009833f706298fe5dc--