Hello, I added a unique constraint to a column via...
# help
l
Hello, I added a unique constraint to a column via the SQL editor but I don't know how to delete it. any help?
n
Hello @Lesourdingo! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
l
when i try to find the unique constraint with the query, it doesnt appear. but still get an error
'duplicate key value violates unique constraint "name"'
g
try this from same link: select * from information_schema.table_constraints;
you can add a where table_name = 'test'
Although both work for me.
l
where table_name = "test" doesnt work
syntax error at or near "where"
i scrolled all the constraint and didnt find any unique on the table
so weird
g
if you used double quotes that won't work. Has to be single. select * from information_schema.table_constraints where table_name = 'realtest'
Is the problem maybe a primary key instead of a unique key?
l
single quote works
oh maybe the mrimary key
primary*
so i might delete and recreate the table
or can i just drop the primary key?
g
Should be able to
l
i cant
cannot drop constraint rikishis_pkey on table rikishis because other objects depend on it
Yeah i might recreate a table i think
oh no the primary key is not the column with problems
Ok, i deleted the column and recreate it
seems to work..
thanks for ur help
n
Thread was archived by @Lesourdingo. Anyone can send a message to unarchive it.