TABLEs to VIEWs with Perl

From: Justin Tocci <jtocci(at)tocci(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: TABLEs to VIEWs with Perl
Date: 2005-05-17 19:55:46
Message-ID: 38F8A304-34D7-416A-853F-1B345B7BDF6F@tocci.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

#!/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

Browse pgsql-general by date

  From Date Subject
Next Message Jerry Sievers 2005-05-17 19:58:56 CSV delim quoting differences PgCOPY, Excel etc...
Previous Message David Parker 2005-05-17 19:51:42 Re: explicit cursor vs. for loop in pl/pgsql