diff --git a/src/docs/user/list-tables.txt b/src/docs/user/list-tables.txt index 2d002375..fad14c48 100644 --- a/src/docs/user/list-tables.txt +++ b/src/docs/user/list-tables.txt @@ -53,3 +53,10 @@ job_descriptions office_supplies ---- +In case of postgresql, list tables command with common arguments fetches only "public" schema. For custom schema, use --schema argument to list tables of particular schema +Example +---- +$ sqoop list-tables --connect jdbc:postgresql://localhost/corp --username name -P -- --schema payrolldept +employees +expenses +---- diff --git a/src/java/org/apache/sqoop/tool/ListTablesTool.java b/src/java/org/apache/sqoop/tool/ListTablesTool.java index 529df37a..5d47bc9d 100644 --- a/src/java/org/apache/sqoop/tool/ListTablesTool.java +++ b/src/java/org/apache/sqoop/tool/ListTablesTool.java @@ -80,7 +80,9 @@ public void applyOptions(CommandLine in, SqoopOptions out) /** {@inheritDoc} */ public void validateOptions(SqoopOptions options) throws InvalidOptionsException { - if (hasUnrecognizedArgs(extraArguments)) { + options.setExtraArgs(getSubcommandArgs(extraArguments)); + int dashPos = getDashPosition(extraArguments); + if (hasUnrecognizedArgs(extraArguments, 0, dashPos)) { throw new InvalidOptionsException(HELP_STR); }