Index: trunk/tools/osm-tools/osm2pgsql-style/create-language-views.pl |
— | — | @@ -60,12 +60,24 @@ |
61 | 61 | |
62 | 62 | help() if $help; |
63 | 63 | |
| 64 | +if (not defined $languages) |
| 65 | +{ |
| 66 | + warn "--languages must be supplied"; |
| 67 | + help(); |
| 68 | +} |
| 69 | + |
64 | 70 | unless (-r $languages) |
65 | 71 | { |
66 | 72 | warn "Can't read the file `$languages'"; |
67 | 73 | help(); |
68 | 74 | } |
69 | 75 | |
| 76 | +if (not defined $psql_user) |
| 77 | +{ |
| 78 | + warn "--psql-user must be supplied"; |
| 79 | + help(); |
| 80 | +} |
| 81 | + |
70 | 82 | # |
71 | 83 | # Config |
72 | 84 | # |
— | — | @@ -73,6 +85,10 @@ |
74 | 86 | # The tables we're creating views for |
75 | 87 | my @tables = split_query( "select table_name from information_schema.tables where table_name ~ '^planet_osm';" ); |
76 | 88 | |
| 89 | +if (not @tables) { |
| 90 | + die "There were no tables beginning with 'planet_osm' in your database, or perhaps the database connection failed"; |
| 91 | +} |
| 92 | + |
77 | 93 | # Columns in those tables |
78 | 94 | my %columns; |
79 | 95 | |