Re: checking if sequence exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I tried this from pg_admin, but I get a syntax error (unexpected character)
 
IF EXISTS (SELECT 0 FROM pg_class
             WHERE relkind = 'S'
               AND oid::regclass::text = 'public.' || quote_ident('hibernate_sequence'))
  THEN
    RAISE EXCEPTION 'sequence public.% already exists!', 'hibernate_sequence
ENF IF;
 
Thanks.
From: Thara Vadakkeveedu <tharagv@xxxxxxxxx>
To: "pgsql-admin@xxxxxxxxxxxxxx" <pgsql-admin@xxxxxxxxxxxxxx>
Sent: Friday, November 15, 2013 2:30 PM
Subject: Re: checking if sequence exists

How can we find out if a particular sequence exists ? The idea is to check if sequence first and if it does not exist then create it...the goal is to do this when we deploy the application war...
thanks
tg

 



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux