From arun_jaisankar@yahoo.com Thu Feb 20 16:47:40 2003 X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7F62F4753A1 for ; Thu, 20 Feb 2003 11:47:40 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 34338-07 for ; Thu, 20 Feb 2003 11:47:27 -0500 (EST) Received: from smtp013.mail.yahoo.com (smtp013.mail.yahoo.com [216.136.173.57]) by postgresql.org (Postfix) with SMTP id 05A7E475B33 for ; Thu, 20 Feb 2003 11:40:44 -0500 (EST) Received: from 219-88-55-118.dialup.xtra.co.nz (HELO singlarc01) (arun?jaisankar@219.88.55.118 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 20 Feb 2003 16:40:48 -0000 Message-ID: <00fa01c2d8fe$c7918210$020000c0@singlarc01> From: "Arunachalam Jaisankar" To: Subject: How to drop all the sequences Date: Fri, 21 Feb 2003 05:40:27 +1300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00F5_01C2D96B.BD008090" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/462 X-Sequence-Number: 11860 This is a multi-part message in MIME format. ------=_NextPart_000_00F5_01C2D96B.BD008090 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I found sequences are not getting dropped when tables are dropped. It is to= o difficult to drop all sequences one by one manually. Is there any command= to drop all sequences in a database? Looking for help. regards Jaisankar ------=_NextPart_000_00F5_01C2D96B.BD008090 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I found sequences are not getting dropped = when=20 tables are dropped. It is too difficult to drop all sequences one by one=20 manually. Is there any command to drop all sequences in a database? Looking= for=20 help.
 
regards
Jaisankar
 
------=_NextPart_000_00F5_01C2D96B.BD008090-- From jasiek@klaster.net Thu Feb 20 20:55:26 2003 X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 44E6F475F22 for ; Thu, 20 Feb 2003 15:55:26 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 09906-07 for ; Thu, 20 Feb 2003 15:55:15 -0500 (EST) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id CF3BE475F53 for ; Thu, 20 Feb 2003 15:39:53 -0500 (EST) Received: from klaster.net (ph20.krakow.cvx.ppp.tpnet.pl [217.99.208.20]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 80FC32B88D; Thu, 20 Feb 2003 21:30:30 +0100 (CET) Message-ID: <3E553D04.6070407@klaster.net> Date: Thu, 20 Feb 2003 21:39:32 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; PL; rv:1.1) Gecko/20020826 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Arunachalam Jaisankar Cc: pgsql-sql@postgresql.org Subject: Re: How to drop all the sequences References: <00fa01c2d8fe$c7918210$020000c0@singlarc01> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/466 X-Sequence-Number: 11864 Arunachalam Jaisankar wrote: > I found sequences are not getting dropped when tables are dropped. It is > too difficult to drop all sequences one by one manually. Is there any > command to drop all sequences in a database? Looking for help. > > regards > Jaisankar Try this simple pl/pgsql function: create or replace function drop_all_sequences() returns integer as ' declare rec record; begin for rec in select relname as seqname from pg_class where relkind=''S'' loop execute ''drop sequence '' || rec.seqname; end loop; return 1; end; ' language 'plpgsql'; Regards, Tomasz Myrta From olleg@telecom.mipt.ru Fri Feb 21 08:04:29 2003 X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 14548474E5C for ; Fri, 21 Feb 2003 03:04:29 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 38563-07 for ; Fri, 21 Feb 2003 03:04:18 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 5BFF7474E4F for ; Fri, 21 Feb 2003 03:04:18 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 85DC143A670; Fri, 21 Feb 2003 03:04:17 -0500 (EST) From: Oleg Samoylov X-Newsgroups: comp.databases.postgresql.sql Subject: Re: How to drop all the sequences Date: Fri, 21 Feb 2003 11:04:16 +0300 Organization: MIPT Telecom Lines: 11 Message-ID: <3E55DD80.3010900@telecom.mipt.ru> References: <00fa01c2d8fe$c7918210$020000c0@singlarc01> Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: ru, en To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/472 X-Sequence-Number: 11870 Arunachalam Jaisankar wrote: > I found sequences are not getting dropped when tables are dropped. It is to= > regards > Jaisankar In 7.3 sequence created automatically by serial field must be dropped with table. -- Olleg Samoylov