PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> Hello, I'm getting unexpected behaviour with IDENTITY columns when running
> ALTER TABLE ADD COLUMN IF NOT EXISTS on them when they already exist.
Yeah, this is a known issue: the IF NOT EXISTS operates to skip the
actual creation of the column, but it fails to suppress secondary
operations such as adding indexes or serial sequences. It's fixed
in v13, but the changes were too major to consider back-patching.
regards, tom lane