I need to check if a sequence exists, I know that to check if a table exists you can rin a querry line
SELECT count(*)>0 FROM pg_tables WHERE schemaname='public' AND tablename='sections'
and it will return true if the table exists and false if it doesnt. But how do you check this for a sequence? I couldnt fint much online about this.
Thanks
Raman
Checkif sequence exists
Moderator: General Moderators
Re: Checkif sequence exists
[sql]SELECT * FROM information_schema.sequences[/sql]
Why do you need that?
Why do you need that?
There are 10 types of people in this world, those who understand binary and those who don't
Re: Checkif sequence exists
when I run the install file that creates all the tables and sequences I need to check if the sequence exists before telling it to create it.