Project

General

Profile

  • svn:executable: *

# Date Author Comment
13325 04/25/2014 10:56 PM Aaron Marcuse-Kubitza

fix: *{.sh,run}: always log kw_params at same log_level as echo_func

13288 04/22/2014 10:33 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: pg_snapshot(): perform online backup if possible, to avoid needing to restart the server

13287 04/22/2014 10:31 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: added pg_start_backup(), pg_stop_backup()

13286 04/22/2014 10:29 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: psql(): only set redirs if can redirect

13285 04/22/2014 10:17 PM Aaron Marcuse-Kubitza

bugfix: psql(): when as_root is on, need to avoid redirections as these are not passed through by sudo

13283 04/22/2014 06:01 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/db.sh: psql(): don't use `--file /dev/fd/40` when can't redirect

13282 04/22/2014 05:59 PM Aaron Marcuse-Kubitza

fix: lib/sh/db.sh: psql(): when using sudo with custom $stdin, raise error that this is not supported

13281 04/22/2014 05:50 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: psql(): $data_bypasses_filter: renamed to $data2stdout for clarity

13280 04/22/2014 05:29 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: psql(): $bypass_ok: renamed to $can_redir for clarity

13279 04/22/2014 05:22 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: psql(): usage: $stdin: documented that can also use process substitution for this

13264 04/21/2014 07:38 PM Aaron Marcuse-Kubitza

lib/sh/sync.sh: db_copy() and callers: pass args as rsync options

13262 04/21/2014 07:22 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: added pg_ctl(), pg_snapshot()

13259 04/21/2014 07:03 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysql_snapshot(): use new db_snapshot()

13253 04/21/2014 04:46 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysql_snapshot(): for large files, don't re-copy entire file

13252 04/21/2014 04:44 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysql_snapshot(): use live mode as the default

13251 04/21/2014 04:30 PM Aaron Marcuse-Kubitza

fix: lib/sh/db.sh: mysql_snapshot(): need to create dest dir if doesn't exist

13250 04/21/2014 04:27 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/db.sh: mysql_snapshot(): try: need to use split syntax with prep_try instead, to work with prefix vars

13249 04/21/2014 04:23 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/db.sh: mysql_snapshot(): try: need to use split syntax with prep_try instead, to work with prefix vars

13191 04/19/2014 10:07 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/db.sh: mysql_ctl(): need to ignore errors if not running

13187 04/19/2014 09:48 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/db.sh: mysql_snapshot(): need to run `mysql_ctl start` even if there is an error

13186 04/19/2014 09:38 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysql_snapshot(): $to: default to $from.bak

13185 04/19/2014 08:06 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: added mysql_snapshot()

13184 04/19/2014 07:46 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: added mysql_ctl()

13183 04/19/2014 07:35 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: pg_cmd(): updated to use new sudo()

13172 04/19/2014 10:57 AM Aaron Marcuse-Kubitza

lib/sh/db.sh: pg_cmd(): $as_root: use $sudo

13169 04/19/2014 09:55 AM Aaron Marcuse-Kubitza

lib/sh/db.sh: removed no longer used pg_as_root(), which was buggy anyway. use `as_root=1 ...` instead.

13168 04/19/2014 09:38 AM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysql_ANSI: fixed comment

13166 04/18/2014 05:34 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: pg_dump(): support dumping entire cluster, and cluster users

13165 04/18/2014 05:10 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: pg_cmd(): added $as_root switch

13162 04/17/2014 02:52 PM Aaron Marcuse-Kubitza

lib/sh/db.sh pg_dump(), bin/pg_dump_vegbien: --format=plain: removed comment that this is the plain format, because this is now self-documenting

13161 04/17/2014 02:51 PM Aaron Marcuse-Kubitza

lib/sh/db.sh pg_dump(), bin/pg_dump_vegbien: --format: use the long form of the formats to make the code self-documenting

12865 03/22/2014 04:53 AM Aaron Marcuse-Kubitza

bugfix: lib/sh/db.sh: pg_table_exists(): need ! to negate boolean result

12846 03/22/2014 01:39 AM Aaron Marcuse-Kubitza

fix: lib/sh/db.sh: pg_cmd(): hide PGPASSWORD at the normal verbosity so that the value of it doesn't appear in any log files

12829 03/21/2014 11:48 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: clog*: renamed to log* for clarity (possible now that log* is no longer used for function-local log_level setting)

12828 03/21/2014 11:44 PM Aaron Marcuse-Kubitza

: local setting of log_level: use log_local instead of relying on the log aliases, so that these aliases can instead be used for wrapping commands (the more common use case)

12806 03/21/2014 05:35 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: pg_*_exists(): log the DB statements to check this at a higher log_level so that they don't clutter up the log output

12800 03/21/2014 03:42 PM Aaron Marcuse-Kubitza

*{.sh,run}: stderr_matches() wrapper calls: removed no longer needed prep_try/rethrow

12796 03/21/2014 03:00 PM Aaron Marcuse-Kubitza

fix: lib/sh/db.sh: pg_table_exists(): use stderr_matches() rather than just the exit status. this also avoids highlighting the benign error.

12770 03/20/2014 06:56 PM Aaron Marcuse-Kubitza

stderr_matches(): wrapper caller usage: added alternative usage when using `||`

12766 03/20/2014 06:45 PM Aaron Marcuse-Kubitza

fix: *{.sh,run}: stderr_matches() wrappers: usage: added `rethrow`

12763 03/20/2014 06:36 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/db.sh: pg_schema_exists(): need to ignore benign error exit status from the "cannot create temporary relation in non-temporary schema" error

12740 03/15/2014 07:20 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: psql(): $verbose_ok: renamed to $bypass_ok for clarity, because this applies only to the `--output /dev/fd/41` bypass (which when not possible, requires turning off verbose output

12739 03/15/2014 07:15 PM Aaron Marcuse-Kubitza

fix: lib/sh/db.sh: psql(): added $output_data switch analogous to what mysql() has. this causes query results of eg. void-returning functions to be correctly filtered by the logging mechanism, rather than output to stdout.

12738 03/15/2014 06:42 PM Aaron Marcuse-Kubitza

fix: lib/sh/db.sh: psql(): verbosity=0 (errors only) mode: use `SET client_min_messages = WARNING;` instead of NOTICE to hide verbose messages within psql as well

12737 03/15/2014 06:31 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: psql(): replaced `test "$verbose_ok" && can_log` with bool var $verbose_

12736 03/15/2014 06:29 PM Aaron Marcuse-Kubitza

fix: lib/sh/db.sh: psql(): $verbose_: renamed to $verbose_ok for clarity

12731 03/15/2014 05:28 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: die_error_hidden(): min verbosity to display error should not be hardcoded

12730 03/15/2014 05:18 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: psql(): "to see error details" msg: use new die_error_hidden()

12728 03/15/2014 05:13 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: psql(): "to see error details" msg: use new log_hint()

12726 03/15/2014 05:03 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/db.sh: psql(): "to see error details" msg: also don't print it for benign errors ($benign_error)

12724 03/15/2014 04:42 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: psql(): on error, display message describing how to see error details (prepend `vb=2` to the command)

12690 03/14/2014 07:32 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: stderr_matches(): inline the stderr_matches alias to avoid needing to quote stderr_matches as "stderr_matches" in the most common use case (with pattern as a prefix env var)

12689 03/14/2014 07:29 AM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: stderr_matches(): when passing `pattern=...` as a prefix env var, must be invoked as `"stderr_matches"` to avoid the env var applying to the prep_try portion of the stderr_matches alias

12201 02/14/2014 10:04 AM Aaron Marcuse-Kubitza

*{.sh,run}: stderr_matches calls: don't need to wrap the command in `"try"` because stderr_matches now does this

12193 02/14/2014 08:21 AM Aaron Marcuse-Kubitza

lib/sh/db.sh: pg_dump(): ignore "No matching tables were found" error, using new ignore_err_msg()

12191 02/14/2014 07:34 AM Aaron Marcuse-Kubitza

lib/sh/db.sh: pg_schema_exists(): documented that `try` is used to suppress the error exit status

11970 01/20/2014 11:33 AM Aaron Marcuse-Kubitza

moved everything into /trunk/ to create the standard svn layout, for use with tools that require this (eg. git-svn). IMPORTANT: do NOT do an `svn up`. instead, re-use your working copy's existing files with `svn switch` (http://svnbook.red-bean.com/en/1.6/svn.ref.svn.c.switch.html).

11859 12/06/2013 05:38 AM Aaron Marcuse-Kubitza

lib/sh/db.sh: added pg_require_schema()

11855 12/06/2013 04:14 AM Aaron Marcuse-Kubitza

lib/sh/db.sh: added pg_schema_exists()

11850 12/06/2013 02:52 AM Aaron Marcuse-Kubitza

fix: lib/sh/db.sh: pg_table_exists(): usage: documented that $table is actually required for this function

11784 11/26/2013 10:58 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: import_vars: don't overwrite vars that are already defined, to allow the caller to specify their own values for the vars to create. this requires callers that rely on the overwriting functionality to reverse the order in which they run use_* commands, so that the higher-precedence use_* is applied first and the other one as the default values for the first.

11771 11/26/2013 01:22 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: pg_table_exists(): use `SELECT NULL` instead of `SELECT *` to avoid a long column list cluttering up the log output

11768 11/26/2013 12:01 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: added pg_table_exists()

11579 11/05/2013 11:13 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mk_select(): usage: documented that this also takes a $limit/$n param

11578 11/05/2013 11:12 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: limit(): also support using $n as the limit param, since this var name is used by other parts of the import process

11576 11/05/2013 11:07 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: limit(): usage: documented that this also need a $limit param

11360 10/18/2013 09:54 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/db.sh: avoid outputting to /dev/fd/# when running as sudo on Linux, because this causes a "Permission denied" error (due to the /dev/fd/# file being owned by a different user). this is not a problem with normal redirects (>&#), because they do not use /dev/fd/# files which can have access permissions.

11357 10/18/2013 07:50 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: pg_as_root(): run sudo with echo_run to help debug

11356 10/18/2013 06:29 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/db.sh: pg_cmd(): only set PG* connection/login env vars when the corresponding var is non-empty. there are some situations in which these must be unset (in order to use the default value), and other situations when the var must be set to something (i.e. "") to avoid it being defaulted to a value in local.sh > connection vars.

11353 10/18/2013 06:11 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/local.sh: pg_as_root(): need to use -E (preserve environment) option to sudo, so that $schema, $table get passed through

11349 10/18/2013 05:29 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: added pg_as_root()

10888 09/07/2013 07:11 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysql_cmd(): added caller usage with connection/login opts

10887 09/07/2013 07:08 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysql(), mysql_export(): usage: added database=...

10827 08/30/2013 03:36 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mk_select(): added support for ORDER BY

10825 08/30/2013 03:28 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: added pg_export_table_to_dir(), analogous to pg_export_table_to_dir_no_header()

10775 08/27/2013 09:07 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/db.sh: pg_dump(): don't default $struct flag to on, because both structure and data should be printed by default

10774 08/27/2013 09:02 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: pg_dump(): added create_schema= flag to remove CREATE SCHEMA statements (useful if the schema already exists)

10764 08/27/2013 07:09 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: added pg_dump(), using the code in bin/pg_dump_vegbien with clarity improvements

10763 08/27/2013 07:06 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: added pg_cmd() (analogous to mysql_cmd() for PostgreSQL), and use it in psql(), so that other PostgreSQL operations can use this to set the PG* connection/login vars

10755 08/27/2013 02:38 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: pg_export(): added usage

10649 08/08/2013 07:15 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysqldump(): added create_db=1 flag to print the CREATE DATABASE statement

10446 07/26/2013 08:06 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysqldump(): don't use --compatible=postgresql when the table structure is being exported, because this removes the table options (which include the COMMENT attribute). --compatible=postgresql remains on in data-only mode because embedded ` in data cannot easily be distinguished from ` around column names, so ANSI_QUOTES is needed to do the translation to " (and data sections do not contain table options). note that all --compatible modes that offer ANSI_QUOTES unfortunately exclude the table options, and there is no way to run a SQL query to set the SQL mode before beginning the dump, so ANSI_QUOTES translation must be handled by my2pg instead.

10402 07/24/2013 05:13 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mk_select(): support passing $cols as array instead of SQL string, which is easier to enter in a shell script (less quotes, \ , etc.)

10401 07/24/2013 05:12 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: added cols2list()

10295 07/17/2013 07:40 AM Aaron Marcuse-Kubitza

lib/sh/db.sh: psql(): display stack traces and DETAIL sections of error messages at verbosity 2+, to help debugging (previously they were always turned off). in particular, the DETAIL section of a "duplicate key value violates unique constraint" error is useful because it contains the duplicated key.

10155 07/03/2013 05:26 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: psql(): hide the verbose CONTEXT information that is output with each NOTICE by setting the VERBOSITY psql var to terse (postgresql.1045698.n5.nabble.com/Quiet-quot-CONTEXT-quot-td1906036.html#a1906037)

10154 07/03/2013 05:15 PM Aaron Marcuse-Kubitza

*{.sh,run}: use new log-() instead of log+() with a negative #

9817 06/09/2013 09:18 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: set test mode when using limited # rows

9777 06/08/2013 04:12 AM Aaron Marcuse-Kubitza

*{.sh,run}: use mysql instead of mysql_ANSI because mysql is now an alias to mysql_ANSI (since ANSI mode still supports key MySQL features, like `` quotes)

9707 06/04/2013 11:17 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: moved mysql_root() after the mysql->mysql_ANSI alias (and load new aliases) so that it will also use ANSI mode and support "" identifiers

9706 06/04/2013 11:15 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysql: always use ANSI mode, to support "" identifiers. note that `` are still supported in this mode, so it also works with SHOW CREATE TABLE output and dumpfiles.

9701 06/04/2013 06:07 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysql_cmd(): run the command with `time` because in mysql()'s output_data mode, no queries, and therefore no runtimes, are echoed, so the total runtime needs to be echoed separately instead. the total runtime is also useful in general, when many long-running queries are run and you would also like to know the total time (e.g. in make_analytical_db).

9700 06/04/2013 05:54 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: limit(): usage: surrounded query in "" to clarify that it's a string, not a command

9698 06/01/2013 09:31 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: added set_large_table alias, used to set to_file's $del flag based on $limit

9694 06/01/2013 07:02 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysql_cmd(): use --quick to avoid buffering entire result (which is slow and memory-intensive for large result sets). this option applies to both mysql() and mysqldump().

9660 05/30/2013 07:19 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: mysql_import(): in append mode, use LOAD DATA IGNORE to allow inserting duplicate rows

9651 05/30/2013 05:43 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: convention of fds to use for command-specific alternate stdin/stdout/stderr: changed to 40/41/42 because 10/11/12 are used by eval (which is used by set_fds()). use of fd 10/11/12 will cause hard-to-find silent bugs because exec will not print an error when these are used. documented why not to use other series of fds for this purpose:...

9649 05/30/2013 02:38 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: psql(): set $PG* connection env vars from our connection vars ($server, $user, etc.). use use_pg to import $database so it can be different from $database for MySQL

9648 05/30/2013 02:31 PM Aaron Marcuse-Kubitza

lib/sh/db.sh: added use_pg alias

9647 05/30/2013 02:31 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/db.sh: psql(): added missing `--set ON_ERROR_STOP=1 --quiet` opts from psql_script_vegbien