File: create_drops.pl

package info (click to toggle)
postgresql-q3c 2.0.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,548 kB
  • sloc: sql: 27,430; ansic: 3,908; python: 110; perl: 104; makefile: 101; sh: 17
file content (34 lines) | stat: -rw-r--r-- 311 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
my $state=0;
while(<>)
{
	if (/^--/)
	{
		next;
	}
	elsif (s/CREATE OR REPLACE FUNCTION/DROP FUNCTION/)
	{
		if (!(/\)/))
		{
			$state=1;
			chomp;
			print;
			next;
		}
		chomp;
		print;
		print ";\n";
		next;
	}
	if ($state==1)
	{
		chomp;
		print;
		if (/\)/)
		{
			print ";\n";
			$state=0;
		}
		
	} 

}