Commit Graph

32 Commits

Author SHA1 Message Date
J Smith 406167058b Add additional PostgreSQL completions for 13+ and reorganize 2022-01-27 18:23:03 -04:00
Shohei YOSHIDA 3b247d3071
Merge pull request #749 from arp242/psqlrc
pgsql: add -X to psql commands to prevent loading ~/.psqlrc
2020-06-03 14:24:46 +09:00
Martin Tournoij 76efcab2f9
pgsql: Check for pg_config existence
pg_config isn't installed by default on many systems, and is usually
part of postgresql-libs-devel or some such, leading to needless
"pg_config not found" errors on completion.
2020-06-03 12:33:45 +08:00
Martin Tournoij f371431619
pgsql: add -X to psql commands to prevent loading ~/.psqlrc
The ~/.psqlrc may alter the output. In particular, I have '\timing on'
in there to add timings. This is useful when using psql, but not when
relying on it in scripts.

For example:

    psql -Aqt -c "select n.nspname \
        from pg_catalog.pg_namespace n \
        where n.nspname "'!~'" '^pg_' \
          and n.nspname <> 'information_schema' \
        order by 1;" postgres 2>/dev/null

Gives the output:

    public
    Time: 1.882 ms

Whereas with -X it gives the standard output:

    public
2020-06-03 11:40:37 +08:00
Dimitris Apostolou 9e9bee7066
Fix typos 2020-04-09 11:51:09 +03:00
J Smith f46ec9befb Add additional PostgreSQL completions for PostgreSQL 12+ 2020-02-13 14:31:02 -04:00
J Smith 2ab70accf4 Fix a syntax error on the PostgreSQL `createuser` utility 2019-06-14 16:12:15 -03:00
Julien Nicoulaud c299511237
#505: pg_restore accepts a file 2018-10-13 23:39:52 +02:00
J Smith bbd0fe91f4 Add the --role option to the common pgsql options 2017-08-28 11:51:58 -03:00
J Smith 2a331231c5 Add additional options for initdb 2017-08-28 11:51:42 -03:00
J Smith 2653bb59a6 Add the -i/--interactive option for dropuser 2017-08-28 11:51:27 -03:00
J Smith 48f3bb5beb Add additional options for createuser 2017-08-28 11:50:02 -03:00
J Smith 41bc851b84 Add additional options for pg_dump 2017-08-28 11:49:47 -03:00
J Smith 506972a1d6 Add additional options for psql 2017-08-28 11:49:04 -03:00
Julien Nicoulaud 0f883ba365 #207: add license headers to compdefs from zsh-users mailing list 2016-05-27 19:52:25 +02:00
Stefano Zacchiroli a812877745 Add service=... support to PostgreSQL completion 2015-11-06 09:56:40 -08:00
J Smith 705800ca20 pg_restore completion 2015-06-28 21:40:18 -04:00
Syohei YOSHIDA d6fdb720e2 Correct misspellings 2015-06-08 16:05:14 +09:00
Felix Bünemann b405c9fae4 Fix typo in _pgsql_utils --disable-dollar-quoting 2014-08-28 18:53:41 +02:00
Daniel Serodio e9f3294210 pg_dumpall completion 2012-09-21 10:24:37 -03:00
J Smith 1b2dabcd2e Add a bunch of additional options for pg_dump. 2012-09-11 14:29:00 -04:00
J Smith 625eaa58ce Add the -T/--exclude-table option for pg_dump. 2012-09-11 14:29:00 -04:00
J Smith d1e2e96be8 Add the -N/--exclude-schema option for pg_dump. 2012-09-11 14:29:00 -04:00
J Smith bc8ef15557 Add _pgsql_schemas to grab the list of schemas for pg_dump. 2012-09-11 14:29:00 -04:00
J Smith 5921809d49 Add the -E/--encoding option for pg_dump. 2012-09-11 14:29:00 -04:00
J Smith 603bd2f4e1 Add the initdb command. 2012-09-10 01:18:33 -04:00
J Smith 6b1c882e9d Add the createuser and dropuser commands. 2012-09-10 01:18:33 -04:00
J Smith cfb8da6fb2 Get the list of encodings from the database cluster. 2012-09-10 01:18:33 -04:00
J Smith c5a5033e08 Connect to template1 when getting the list of databases.
We can't assume that the user will have a database that shares their
user name.
2012-09-10 01:18:33 -04:00
J Smith 98f5f1abc1 Fix typo -- "oin" should be "oid". 2012-09-10 01:18:33 -04:00
Aaron Schrab 3f55429b0e Move modelines to end of file
Having a vim modeline or emacs local variable line somewhere in the
middle of the file isn't really helpful.  By default, vim will only
check the first and last 5 lines of a file for a modeline (assuming the
modeline option is enabled).  Emacs is even more strict about the type
of local variable line that was in use, it will only check the first
line of the file or the second line if the first line specifies a script
interpreter (which isn't the case here).

Move the vim modeline to the end of the file so that it can actually be
found by vim but is out of the way for editing.  For emacs more work is
required, convert that to the more verbose Local Variables syntax which
emacs will look for starting 3000 characters from the end of the file.

Also there is no zsh mode for emacs (according to
zsh-users/zsh-completions#75), use the "Shell-Script" mode instead.
This seems to automatically detect that the files are for zsh.

I'm not an emacs user, so I haven't tested that portion much.  But, this
does at least improve the syntax highlighting there.
2012-08-23 11:18:49 -04:00
Julien Nicoulaud 10ffeb0c15 [BREAKING CHANGE] Move compdefs to own directory (to ease packaging and
avoid bloating users fpath with unneeded files such as README.md)
2012-08-01 13:23:11 +02:00