Thread: TABLEs to VIEWs with Perl

TABLEs to VIEWs with Perl

From
Justin Tocci
Date:
#!/usr/bin/perl -w
use strict;

# This program turns text files with TABLE definitions
#      clipped from PGADMIN into VIEWs with a pre-pended 't'.
#
# All VIEWs get a full set of rules and permissions and assume the first column is the primary key.
# To use:
# put this script into a text file and save it.
# make it executable: chmod a+x viewsfromtable.pl
# Adjust the INFILE and FINAL directories for your system
# put your TABLE files, one TABLE per file into the INFILE directory.
# To run: ./viewsfromtable.pl fileone.txt filetwo.txt
# Output is appended to view.sql file in FINAL directory

I tried to post the program and got denied for size. Its 72 lines.

Is there an appropriate place to post such a thing?

justin tocci
fort worth, texas