Giter Club home page Giter Club logo

pgcli's Introduction

We stand with Ukraine

Ukrainian people are fighting for their country. A lot of civilians, women and children, are suffering. Hundreds were killed and injured, and thousands were displaced.

This is an image from my home town, Kharkiv. This place is right in the old city center.

image

Picture by @fomenko_ph (Telegram).

Please consider donating or volunteering.

A REPL for Postgres

Build Status Code coverage report Latest Version Netlify

This is a postgres client that does auto-completion and syntax highlighting.

Home Page: http://pgcli.com

MySQL Equivalent: http://mycli.net

image

image

Quick Start

If you already know how to install python packages, then you can simply do:

$ pip install -U pgcli

or

$ sudo apt-get install pgcli # Only on Debian based Linux (e.g. Ubuntu, Mint, etc)
$ brew install pgcli  # Only on macOS

If you don't know how to install python packages, please check the detailed instructions.

Usage

$ pgcli [database_name]

or

$ pgcli postgresql://[user[:password]@][netloc][:port][/dbname][?extra=value[&other=other-value]]

Examples:

$ pgcli local_database

$ pgcli postgres://amjith:[email protected]:5432/app_db?sslmode=verify-ca&sslrootcert=/myrootcert

For more details:

$ pgcli --help

Usage: pgcli [OPTIONS] [DBNAME] [USERNAME]

Options:
  -h, --host TEXT            Host address of the postgres database.
  -p, --port INTEGER         Port number at which the postgres instance is
                             listening.
  -U, --username TEXT        Username to connect to the postgres database.
  -u, --user TEXT            Username to connect to the postgres database.
  -W, --password             Force password prompt.
  -w, --no-password          Never prompt for password.
  --single-connection        Do not use a separate connection for completions.
  -v, --version              Version of pgcli.
  -d, --dbname TEXT          database name to connect to.
  --pgclirc FILE             Location of pgclirc file.
  -D, --dsn TEXT             Use DSN configured into the [alias_dsn] section
                             of pgclirc file.
  --list-dsn                 list of DSN configured into the [alias_dsn]
                             section of pgclirc file.
  --row-limit INTEGER        Set threshold for row limit prompt. Use 0 to
                             disable prompt.
  --less-chatty              Skip intro on startup and goodbye on exit.
  --prompt TEXT              Prompt format (Default: "\u@\h:\d> ").
  --prompt-dsn TEXT          Prompt format for connections using DSN aliases
                             (Default: "\u@\h:\d> ").
  -l, --list                 list available databases, then exit.
  --auto-vertical-output     Automatically switch to vertical output mode if
                             the result is wider than the terminal width.
  --warn [all|moderate|off]  Warn before running a destructive query.
  --help                     Show this message and exit.

pgcli also supports many of the same environment variables as psql for login options (e.g. PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE).

The SSL-related environment variables are also supported, so if you need to connect a postgres database via ssl connection, you can set set environment like this:

export PGSSLMODE="verify-full"
export PGSSLCERT="/your-path-to-certs/client.crt"
export PGSSLKEY="/your-path-to-keys/client.key"
export PGSSLROOTCERT="/your-path-to-ca/ca.crt"
pgcli -h localhost -p 5432 -U username postgres

Features

The pgcli is written using prompt_toolkit.

  • Auto-completes as you type for SQL keywords as well as tables and columns in the database.
  • Syntax highlighting using Pygments.
  • Smart-completion (enabled by default) will suggest context-sensitive completion.

    • SELECT * FROM <tab> will only show table names.
    • SELECT * FROM users WHERE <tab> will only show column names.
  • Primitive support for psql back-slash commands.
  • Pretty prints tabular data.

Config

A config file is automatically created at ~/.config/pgcli/config at first launch. See the file itself for a description of all available options.

Contributions:

If you're interested in contributing to this project, first of all I would like to extend my heartfelt gratitude. I've written a small doc to describe how to get this running in a development setup.

https://github.com/dbcli/pgcli/blob/master/DEVELOP.rst

Please feel free to reach out to us if you need help. * Amjith, pgcli author: [email protected], Twitter: @amjithr * Irina, pgcli maintainer: [email protected], Twitter: @irinatruong

Detailed Installation Instructions:

macOS:

The easiest way to install pgcli is using Homebrew.

$ brew install pgcli

Done!

Alternatively, you can install pgcli as a python package using a package manager called called pip. You will need postgres installed on your system for this to work.

In depth getting started guide for pip - https://pip.pypa.io/en/latest/installing.html.

$ which pip

If it is installed then you can do:

$ pip install pgcli

If that fails due to permission issues, you might need to run the command with sudo permissions.

$ sudo pip install pgcli

If pip is not installed check if easy_install is available on the system.

$ which easy_install

$ sudo easy_install pgcli

Linux:

In depth getting started guide for pip - https://pip.pypa.io/en/latest/installing.html.

Check if pip is already available in your system.

$ which pip

If it doesn't exist, use your linux package manager to install pip. This might look something like:

$ sudo apt-get install python-pip   # Debian, Ubuntu, Mint etc

or

$ sudo yum install python-pip  # RHEL, Centos, Fedora etc

pgcli requires python-dev, libpq-dev and libevent-dev packages. You can install these via your operating system package manager.

$ sudo apt-get install python-dev libpq-dev libevent-dev

or

$ sudo yum install python-devel postgresql-devel

Then you can install pgcli:

$ sudo pip install pgcli

Docker

Pgcli can be run from within Docker. This can be useful to try pgcli without installing it, or any dependencies, system-wide.

To build the image:

$ docker build -t pgcli .

To create a container from the image:

$ docker run --rm -ti pgcli pgcli <ARGS>

To access postgresql databases listening on localhost, make sure to run the docker in "host net mode". E.g. to access a database called "foo" on the postgresql server running on localhost:5432 (the standard port):

$ docker run --rm -ti --net host pgcli pgcli -h localhost foo

To connect to a locally running instance over a unix socket, bind the socket to the docker container:

$ docker run --rm -ti -v /var/run/postgres:/var/run/postgres pgcli pgcli foo

IPython

Pgcli can be run from within IPython console. When working on a query, it may be useful to drop into a pgcli session without leaving the IPython console, iterate on a query, then quit pgcli to find the query results in your IPython workspace.

Assuming you have IPython installed:

$ pip install ipython-sql

After that, run ipython and load the pgcli.magic extension:

$ ipython

In [1]: %load_ext pgcli.magic

Connect to a database and construct a query:

In [2]: %pgcli postgres://someone@localhost:5432/world
Connected: someone@world
someone@localhost:world> select * from city c where countrycode = 'USA' and population > 1000000;
+------+--------------+---------------+--------------+--------------+
| id   | name         | countrycode   | district     | population   |
|------+--------------+---------------+--------------+--------------|
| 3793 | New York     | USA           | New York     | 8008278      |
| 3794 | Los Angeles  | USA           | California   | 3694820      |
| 3795 | Chicago      | USA           | Illinois     | 2896016      |
| 3796 | Houston      | USA           | Texas        | 1953631      |
| 3797 | Philadelphia | USA           | Pennsylvania | 1517550      |
| 3798 | Phoenix      | USA           | Arizona      | 1321045      |
| 3799 | San Diego    | USA           | California   | 1223400      |
| 3800 | Dallas       | USA           | Texas        | 1188580      |
| 3801 | San Antonio  | USA           | Texas        | 1144646      |
+------+--------------+---------------+--------------+--------------+
SELECT 9
Time: 0.003s

Exit out of pgcli session with Ctrl + D and find the query results:

someone@localhost:world>
Goodbye!
9 rows affected.
Out[2]:
[(3793, u'New York', u'USA', u'New York', 8008278),
 (3794, u'Los Angeles', u'USA', u'California', 3694820),
 (3795, u'Chicago', u'USA', u'Illinois', 2896016),
 (3796, u'Houston', u'USA', u'Texas', 1953631),
 (3797, u'Philadelphia', u'USA', u'Pennsylvania', 1517550),
 (3798, u'Phoenix', u'USA', u'Arizona', 1321045),
 (3799, u'San Diego', u'USA', u'California', 1223400),
 (3800, u'Dallas', u'USA', u'Texas', 1188580),
 (3801, u'San Antonio', u'USA', u'Texas', 1144646)]

The results are available in special local variable _, and can be assigned to a variable of your choice:

In [3]: my_result = _

Pgcli dropped support for Python<3.8 as of 4.0.0. If you need it, install pgcli <= 4.0.0.

Thanks:

A special thanks to Jonathan Slenders for creating Python Prompt Toolkit, which is quite literally the backbone library, that made this app possible. Jonathan has also provided valuable feedback and support during the development of this app.

Click is used for command line option parsing and printing error messages.

Thanks to psycopg for providing a rock solid interface to Postgres database.

Thanks to all the beta testers and contributors for your time and patience. :)

pgcli's People

Contributors

amjith avatar andyscho avatar anze3db avatar bersace avatar catherinedevlin avatar cfournie avatar darikg avatar davidszotten avatar dbaty avatar drocco007 avatar eryoung11 avatar fernandomora avatar fpietka avatar fraoustin avatar itruong-cars avatar j-bennet avatar jonathanslenders avatar koljonen avatar laixintao avatar lelit avatar macobo avatar meeuw avatar mmtj avatar msztolcman avatar owst avatar pasenor avatar qwesda avatar rishiramraj avatar stuartquin avatar tsroten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pgcli's Issues

Extremely Slow Startup

It takes it well over a minute to start up on my database - I suspect it is due to the inefficiency of iterating over all the tables and then issuing separate selects to pull in column names. (I am seeing boatloads of queries like SELECT column_name FROM information_schema.columns WHERE\n table_name ='')

Would likely be faster to do a single select table_name, column_name from information_schema.columns.

RPM Package

@herlo Volunteered to build a Fedora RPM package for pgcli. Thank you for your help!

Debian Packages

Love the app, but I wouldn't like to be installing it from pip everywhere - It would be great if this could be packaged and available on an apt mirror somewhere.

This would:

  • Make installs easier
  • Make upgrades easier
  • Ensure installations are properly logged
  • Ensure clean uninstallations when required
  • Reduce dependancies
  • Allow for easy on-site mirroring / caching

FYI packagecloud.io is pretty good, supports different package formats and their free plan would easily suffice.

\d <table> fails

searchdb> \d cacheaddresslookup
coercing to Unicode: need string or buffer, int found

This is clearly coming from Python, when you are trying to convert a int to a string without a proper cast or format.

Read socket configuration information

When connecting to a local database configured with a local socket, pgcli fails:

pgcli -U postgres data_entry

    could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

The equivalent call to psql succeeds:

psql -U postgres data_entry
psql (8.4.22)
Type "help" for help.

data_entry#

Running strace against psql shows that it reads the socket configuration directory from the unix_socket_directory of the postgresql.conf file. I can get pgcli to run by specifying -h /tmp which is the socket location on this distribution (Ubuntu 12.04.5), perhaps because this Postgres release is backported. The psql code executes this search to find the appropriate path.

Some defaults for sockets on various distributions and OSes:

  • "/var/run/postgresql" # Debian default
  • "/var/pgsql_socket" # MacOS default
  • "/usr/local/var/postgres" # FreeBSD default; custom installation
  • "/tmp" # custom installation

May be worth just iterating over these for an appropriate socket directory before failing with a blank 'host' parameter.

Deprecation warnings for BaseException.message

Tested on Python 2.6 (Cent 6).

$ pgcli
/usr/lib/python2.6/site-packages/pgcli/main.py:75: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  _logger.debug('Database connection failed: %r.', e.message)
/usr/lib/python2.6/site-packages/pgcli/main.py:76: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  click.secho(e.message, err=True, fg='red')
could not translate host name "port=5432" to address: Name or service not known

"UnboundError" with backslash-command without argument (\c)

I get an uncaught exception with backslash-commands that take arguments, like \c.

Consider the following interaction with a freshly installed database.

$ pgcli testdb
testdb> \c testdb
You are now connected to database "testdb" as user "<my_user>"
testdb>

From here, if I type \c without specifying which database I wish to connect to, I get an uncaught exception:

testdb> \c
Traceback (most recent call last):
  File "/home/<my_user>/.local/lib/python3.4/site-packages/pgcli/pgexecute.py", line 89, in run
    dbname = sql.split()[1]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/<my_user>/.local/lib/python3.4/site-packages/pgcli/main.py", line 104, in cli
    res = pgexecute.run(document.text)
  File "/home/<my_user>/.local/lib/python3.4/site-packages/pgcli/pgexecute.py", line 91, in run
    _logger.debug('Failed to switch. DB missing: %r', dbname)
UnboundLocalError: local variable 'dbname' referenced before assignment

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/<my_user>/.local/bin/pgcli", line 9, in <module>
    load_entry_point('pgcli==0.10.0', 'console_scripts', 'pgcli')()
  File "/home/<my_user>/.local/lib/python3.4/site-packages/click/core.py", line 610, in __call__
    return self.main(*args, **kwargs)
  File "/home/<my_user>/.local/lib/python3.4/site-packages/click/core.py", line 590, in main
    rv = self.invoke(ctx)
  File "/home/<my_user>/.local/lib/python3.4/site-packages/click/core.py", line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/<my_user>/.local/lib/python3.4/site-packages/click/core.py", line 416, in invoke
    return callback(*args, **kwargs)
  File "/home/<my_user>/.local/lib/python3.4/site-packages/pgcli/main.py", line 116, in cli
    _logger.debug("sql: %r, error: %r", document.text, e.message)
AttributeError: 'UnboundLocalError' object has no attribute 'message'

A proper way of handling this is to inform the user that a database (or other argument for other backslash-commands) must be provided and return to the prompt gracefully.

System details:
OS: 3.17.6-1-ARCH
Python 3.4.2
postgres (PostgreSQL) 9.3.5
Latest pip-release of pgcli.

Can't start (pkg_resources.DistributionNotFound: jedi>=0.8.1)

It seems as though pgcli can't find a package called jedi:

$ pgcli localhost
Traceback (most recent call last):
  File "/usr/local/bin/pgcli", line 5, in <module>
    from pkg_resources import load_entry_point
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 2912, in <module>
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 550, in _build_master
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 563, in _build_from_requirements
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 742, in resolve
pkg_resources.DistributionNotFound: jedi>=0.8.1

However, I already have a sufficient version of this package installed:

$ python
Python 2.7.9 (default, Dec 15 2014, 10:15:39)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import jedi
>>> jedi.__version__
'0.8.1-final0'

Am I missing anything obvious here?

Thank you for your time.

Cannot install (Linux Mint)

Error dump:

    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.4 (dt dec pq3 ext)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DPG_VERSION_HEX=0x090305 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.7 -I. -I/usr/include/postgresql -I/usr/include/postgresql/9.3/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-2.7/psycopg/psycopgmodule.o -Wdeclaration-after-statement

    In file included from psycopg/psycopgmodule.c:27:0:

    ./psycopg/psycopg.h:30:20: fatal error: Python.h: No such file or directory

     #include <Python.h>

                        ^

    compilation terminated.

    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
    Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-MicY5A/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-RwmUEB-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-MicY5A/psycopg2

'@' in password

I have an '@' symbol in a password. I tried escaping it with '@' but this also didn't work.

More graceful error management

Currently, on syntax errors in psycopg2 and connection error, the error isn't caught and pgcli fails and exits. Perhaps you should handle that more gracefully.

Error: pg_config executable not found

It looks like it requires PostgreSQL development packages as well?

OSX 10.10

Downloading/unpacking pgcli
  Downloading pgcli-0.10.0.tar.gz
  Running setup.py egg_info for package pgcli

Downloading/unpacking Click (from pgcli)
  Downloading click-3.3.tar.gz (259kB): 259kB downloaded
  Running setup.py egg_info for package Click

    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'examples'
    warning: no previously-included files matching '*.pyo' found under directory 'examples'
    no previously-included directories found matching 'docs/_build'
Downloading/unpacking prompt-toolkit (from pgcli)
  Downloading prompt_toolkit-0.25.tar.gz (93kB): 93kB downloaded
  Running setup.py egg_info for package prompt-toolkit

Downloading/unpacking psycopg2 (from pgcli)
  Downloading psycopg2-2.5.4.tar.gz (682kB): 682kB downloaded
  Running setup.py egg_info for package psycopg2

    Error: pg_config executable not found.

    Please add the directory containing pg_config to the PATH
    or specify the full executable path with the option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.
    Complete output from command python setup.py egg_info:
    running egg_info

creating pip-egg-info/psycopg2.egg-info

writing pip-egg-info/psycopg2.egg-info/PKG-INFO

writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt

writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt

writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

warning: manifest_maker: standard file '-c' not found



Error: pg_config executable not found.



Please add the directory containing pg_config to the PATH

or specify the full executable path with the option:



    python setup.py build_ext --pg-config /path/to/pg_config build ...



or with the pg_config option in 'setup.cfg'.

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/pd/xt410rg54rgf0595nx62wt6r0000gn/T/pip_build_samm/psycopg2
Storing complete log in /Users/samm/Library/Logs/pip.log
systems-samm ~ <1> % cat /Users/samm/Library/Logs/pip.log
------------------------------------------------------------
/usr/local/bin/pip run on Wed Jan  7 08:07:41 2015
Downloading/unpacking pgcli

  Getting page https://pypi.python.org/simple/pgcli/
  URLs to search for versions for pgcli:
  * https://pypi.python.org/simple/pgcli/
  Analyzing links from page https://pypi.python.org/simple/pgcli/
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.10.0.tar.gz#md5=c9a54942543365f2f95ad31a6a8e70cc (from https://pypi.python.org/simple/pgcli/), version: 0.10.0
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.2.tar.gz#md5=a5694a3babc166f95c5c46295e01ff89 (from https://pypi.python.org/simple/pgcli/), version: 0.2
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.3.1.tar.gz#md5=0ff42808af8cac9a5643fa42e0731b88 (from https://pypi.python.org/simple/pgcli/), version: 0.3.1
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.3.2.tar.gz#md5=56226a46a73512ce375b48224497aab8 (from https://pypi.python.org/simple/pgcli/), version: 0.3.2
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.3.tar.gz#md5=62031e7d66c9175becc7faacf57643ea (from https://pypi.python.org/simple/pgcli/), version: 0.3
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.4.0.tar.gz#md5=fbcadd95210bd36fd93426848bf0abfd (from https://pypi.python.org/simple/pgcli/), version: 0.4.0
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.4.1.tar.gz#md5=5803d4521e696dec753c1e63cd5c0c55 (from https://pypi.python.org/simple/pgcli/), version: 0.4.1
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.4.2.tar.gz#md5=7b8affb1976eae0e573099909d0cc4bf (from https://pypi.python.org/simple/pgcli/), version: 0.4.2
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.4.3.tar.gz#md5=d20c6b5d016cead391681eeb4cc970fb (from https://pypi.python.org/simple/pgcli/), version: 0.4.3
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.4.4.tar.gz#md5=47f7775eb05c70f86e866b1754811f69 (from https://pypi.python.org/simple/pgcli/), version: 0.4.4
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.5.0.tar.gz#md5=9a47eb77a24e9b7c722fb6b1fd409b7d (from https://pypi.python.org/simple/pgcli/), version: 0.5.0
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.5.1.tar.gz#md5=a6496960094cc00882d6b7487bad0bd0 (from https://pypi.python.org/simple/pgcli/), version: 0.5.1
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.6.0.tar.gz#md5=40ed143f626c5df12770ce8463fa4ff8 (from https://pypi.python.org/simple/pgcli/), version: 0.6.0
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.7.0.tar.gz#md5=39e186b36b1c7df7b63b1daace81b161 (from https://pypi.python.org/simple/pgcli/), version: 0.7.0
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.7.1.tar.gz#md5=f3a980877b4eb84b665c9778558a9f09 (from https://pypi.python.org/simple/pgcli/), version: 0.7.1
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.8.0.tar.gz#md5=b9131c5c5d690c703c244089b4687d99 (from https://pypi.python.org/simple/pgcli/), version: 0.8.0
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.8.1.tar.gz#md5=2ff79561ed2d4903d76885aec529448b (from https://pypi.python.org/simple/pgcli/), version: 0.8.1
    Found link https://pypi.python.org/packages/source/p/pgcli/pgcli-0.9.0.tar.gz#md5=3ce9a49388e5d2ac55e9ee47592ae06e (from https://pypi.python.org/simple/pgcli/), version: 0.9.0
  Using version 0.10.0 (newest of versions: 0.10.0, 0.9.0, 0.8.1, 0.8.0, 0.7.1, 0.7.0, 0.6.0, 0.5.1, 0.5.0, 0.4.4, 0.4.3, 0.4.2, 0.4.1, 0.4.0, 0.3.2, 0.3.1, 0.3, 0.2)
  Downloading pgcli-0.10.0.tar.gz

  Downloading from URL https://pypi.python.org/packages/source/p/pgcli/pgcli-0.10.0.tar.gz#md5=c9a54942543365f2f95ad31a6a8e70cc (from https://pypi.python.org/simple/pgcli/)
  Running setup.py egg_info for package pgcli

    running egg_info
    creating pip-egg-info/pgcli.egg-info
    writing requirements to pip-egg-info/pgcli.egg-info/requires.txt
    writing pip-egg-info/pgcli.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/pgcli.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/pgcli.egg-info/dependency_links.txt
    writing entry points to pip-egg-info/pgcli.egg-info/entry_points.txt
    writing manifest file 'pip-egg-info/pgcli.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found


    reading manifest file 'pip-egg-info/pgcli.egg-info/SOURCES.txt'
    writing manifest file 'pip-egg-info/pgcli.egg-info/SOURCES.txt'
  Source in /private/var/folders/pd/xt410rg54rgf0595nx62wt6r0000gn/T/pip_build_samm/pgcli has version 0.10.0, which satisfies requirement pgcli
Downloading/unpacking Click (from pgcli)

  Getting page https://pypi.python.org/simple/Click/
  URLs to search for versions for Click (from pgcli):
  * https://pypi.python.org/simple/Click/
  Analyzing links from page https://pypi.python.org/simple/click/
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-0.1-py2.py3-none-any.whl#md5=0cc6bb5069cd4aded45df121da94b482 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-0.2-py2.py3-none-any.whl#md5=a8107b8c2ef4c28c0cb13957688656ee (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-0.3-py2.py3-none-any.whl#md5=5bcb7aee93c18342927bf1ff0f475462 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-0.4-py2.py3-none-any.whl#md5=f987186fcd3ceb83405542aeada54709 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-0.5-py2.py3-none-any.whl#md5=383371917b60bc71e94124f4ee76a396 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-0.5.1-py2.py3-none-any.whl#md5=5eec0adef35a10bab82f5bdeb318e4ca (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-0.6-py2.py3-none-any.whl#md5=f66a36e97a157788ab40168d1c696593 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-0.7-py2.py3-none-any.whl#md5=4ed8c0b279f982048f0852088aca0389 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-1.0-py2.py3-none-any.whl#md5=3914880d0f97a722248d42a7d16e6b88 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-1.1-py2.py3-none-any.whl#md5=ac934d5f166064d4b22ef9814f31f8b8 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-2.0-py2.py3-none-any.whl#md5=73f58892ba05d0fbdb56fa7c2c822c4a (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-2.1-py2.py3-none-any.whl#md5=d1003edfac1fd82eb539b1b3ba01cb61 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-2.2-py2.py3-none-any.whl#md5=70cd3b28d696c6e882b0818352352505 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-2.3-py2.py3-none-any.whl#md5=7898be3bf41c91d003dd9cced5a8b183 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-2.4-py2.py3-none-any.whl#md5=52fb03573ab024cca207bd421888b08a (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-2.5-py2.py3-none-any.whl#md5=c1af149f5e10491831311f0e32aa7001 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-2.6-py2.py3-none-any.whl#md5=75941e4e80563ca134fda5045b537c78 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-3.0-py2.py3-none-any.whl#md5=13cead4d730cf0184e981bc2b5748248 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-3.1-py2.py3-none-any.whl#md5=008bac40c0e11f6be2226a5667b67095 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-3.2-py2.py3-none-any.whl#md5=7d0bf0ca4e8ce6056e35cc8135d21abd (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Skipping link https://pypi.python.org/packages/2.7/c/click/click-3.3-py2.py3-none-any.whl#md5=5ca07a6c8b1eaca8e529cdb50a8a8349 (from https://pypi.python.org/simple/click/); unknown archive format: .whl
    Found link https://pypi.python.org/packages/source/c/click/click-0.1.tar.gz#md5=9f1eb0ea0d713e61c0a1a805095092a3 (from https://pypi.python.org/simple/click/), version: 0.1
    Found link https://pypi.python.org/packages/source/c/click/click-0.2.tar.gz#md5=5dfdd49507748b776db6c051191b367f (from https://pypi.python.org/simple/click/), version: 0.2
    Found link https://pypi.python.org/packages/source/c/click/click-0.3.tar.gz#md5=5d9563adb701eb6508dd03180b69d0a7 (from https://pypi.python.org/simple/click/), version: 0.3
    Found link https://pypi.python.org/packages/source/c/click/click-0.4.tar.gz#md5=f5d95b8bafd0cf2e1c8938fade7058d0 (from https://pypi.python.org/simple/click/), version: 0.4
    Found link https://pypi.python.org/packages/source/c/click/click-0.5.1.tar.gz#md5=03aea68acd0402273d10846581c154ba (from https://pypi.python.org/simple/click/), version: 0.5.1
    Found link https://pypi.python.org/packages/source/c/click/click-0.5.tar.gz#md5=7717647596f0dbac3ea2abfbb14e9e8e (from https://pypi.python.org/simple/click/), version: 0.5
    Found link https://pypi.python.org/packages/source/c/click/click-0.6.tar.gz#md5=49268a0b714d88499b0ae74ea315b706 (from https://pypi.python.org/simple/click/), version: 0.6
    Found link https://pypi.python.org/packages/source/c/click/click-0.7.tar.gz#md5=970c4f58099d8f0132e5c53ad26729a8 (from https://pypi.python.org/simple/click/), version: 0.7
    Found link https://pypi.python.org/packages/source/c/click/click-1.0.tar.gz#md5=1b373dba472fbb9328cfbddfde61da9e (from https://pypi.python.org/simple/click/), version: 1.0
    Found link https://pypi.python.org/packages/source/c/click/click-1.1.tar.gz#md5=cb5a9b715bfffe7a297d107829978f45 (from https://pypi.python.org/simple/click/), version: 1.1
    Found link https://pypi.python.org/packages/source/c/click/click-2.0.tar.gz#md5=259ebb6fcf28a72df2104db8f5a22962 (from https://pypi.python.org/simple/click/), version: 2.0
    Found link https://pypi.python.org/packages/source/c/click/click-2.1.tar.gz#md5=0ba97ba09af82c56e2d35f3412d0aa6e (from https://pypi.python.org/simple/click/), version: 2.1
    Found link https://pypi.python.org/packages/source/c/click/click-2.2.tar.gz#md5=e07460aab221e1b7ceee0018122e04a9 (from https://pypi.python.org/simple/click/), version: 2.2
    Found link https://pypi.python.org/packages/source/c/click/click-2.3.tar.gz#md5=ce4852da9d4c33855e6f55e1fd06c1ac (from https://pypi.python.org/simple/click/), version: 2.3
    Found link https://pypi.python.org/packages/source/c/click/click-2.4.tar.gz#md5=7affaac2973184810c018fab7cedca4f (from https://pypi.python.org/simple/click/), version: 2.4
    Found link https://pypi.python.org/packages/source/c/click/click-2.5.tar.gz#md5=a1bff2d2270745affd5bc60e66e50c23 (from https://pypi.python.org/simple/click/), version: 2.5
    Found link https://pypi.python.org/packages/source/c/click/click-2.6.tar.gz#md5=bf5fbaecc1370934347b82ec707e3413 (from https://pypi.python.org/simple/click/), version: 2.6
    Found link https://pypi.python.org/packages/source/c/click/click-3.0.tar.gz#md5=6919bcf8dcbe99197893464a97f640d5 (from https://pypi.python.org/simple/click/), version: 3.0
    Found link https://pypi.python.org/packages/source/c/click/click-3.1.tar.gz#md5=6fc0aa839e01ac1d05c4a823c698b6b2 (from https://pypi.python.org/simple/click/), version: 3.1
    Found link https://pypi.python.org/packages/source/c/click/click-3.2.tar.gz#md5=f8a439029337ff39ed814ae5ce948318 (from https://pypi.python.org/simple/click/), version: 3.2
    Found link https://pypi.python.org/packages/source/c/click/click-3.3.tar.gz#md5=40edaba4d216915a8326c5b2cb52781d (from https://pypi.python.org/simple/click/), version: 3.3
  Using version 3.3 (newest of versions: 3.3, 3.2, 3.1, 3.0, 2.6, 2.5, 2.4, 2.3, 2.2, 2.1, 2.0, 1.1, 1.0, 0.7, 0.6, 0.5.1, 0.5, 0.4, 0.3, 0.2, 0.1)
  Downloading from URL https://pypi.python.org/packages/source/c/click/click-3.3.tar.gz#md5=40edaba4d216915a8326c5b2cb52781d (from https://pypi.python.org/simple/click/)
  Running setup.py egg_info for package Click

    running egg_info
    creating pip-egg-info/click.egg-info
    writing pip-egg-info/click.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/click.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/click.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/click.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found


    reading manifest file 'pip-egg-info/click.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '*.pyc' found under directory 'docs'

    warning: no previously-included files matching '*.pyo' found under directory 'docs'

    warning: no previously-included files matching '*.pyc' found under directory 'tests'

    warning: no previously-included files matching '*.pyo' found under directory 'tests'

    warning: no previously-included files matching '*.pyc' found under directory 'examples'

    warning: no previously-included files matching '*.pyo' found under directory 'examples'

    no previously-included directories found matching 'docs/_build'

    writing manifest file 'pip-egg-info/click.egg-info/SOURCES.txt'
  Source in /private/var/folders/pd/xt410rg54rgf0595nx62wt6r0000gn/T/pip_build_samm/Click has version 3.3, which satisfies requirement Click (from pgcli)
Downloading/unpacking prompt-toolkit (from pgcli)

  Getting page https://pypi.python.org/simple/prompt_toolkit/
  URLs to search for versions for prompt-toolkit (from pgcli):
  * https://pypi.python.org/simple/prompt_toolkit/
  Analyzing links from page https://pypi.python.org/simple/prompt-toolkit/
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.1.tar.gz#md5=dea19326a6645e8b77c864477ea2adf8 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.1
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.10.tar.gz#md5=acaad96aad20d15796df1ba96a6b9989 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.10
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.11.tar.gz#md5=2f2f4c7970685b8080eddfe524c0705a (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.11
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.12.tar.gz#md5=e1741b1a0d3d06bac689ab4cffa47f55 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.12
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.13.tar.gz#md5=2b8c3ec7e8a00a241af57a3178c7cf9e (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.13
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.14.tar.gz#md5=f5a2ad872f662e3bf7950b803deba226 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.14
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.15.tar.gz#md5=3e7612b837cc60364b17cdf16a97676f (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.15
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.16.tar.gz#md5=e4fa5b630187eef39db647adc9482bd6 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.16
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.17.tar.gz#md5=ea41be587d32f068ed9ec66f804455cc (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.17
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.18.tar.gz#md5=80a256e77ab159ac69c50b0950937312 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.18
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.19.tar.gz#md5=1cbeaf3d01eec0ca31090fb9b5046648 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.19
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.2.tar.gz#md5=1ac53b41e13420be3c77cbb955cf8dc8 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.2
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.20.tar.gz#md5=432b1489989e52e3377caf8b967e6c58 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.20
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.21.tar.gz#md5=939d26f5cafe606ef2c9313561c4e4e3 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.21
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.22.tar.gz#md5=0d8ff72ed09901a14d5a1909603b270c (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.22
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.23.tar.gz#md5=06ab9b2775b6c5f5e393792b8ab82a41 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.23
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.25.tar.gz#md5=be64d70110358e937163e8fd548a00e0 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.25
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.3.tar.gz#md5=c93ad0b508d9f8408f71fbfe0defa6db (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.3
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.4.tar.gz#md5=b911eadf4b2bd149443c1184a0543272 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.4
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.5.tar.gz#md5=472f1fde93da89e194f1f5f9c0a2ea91 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.5
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.6.tar.gz#md5=4c54d52a140c2fbc95631f9e63b74b65 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.6
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.8.tar.gz#md5=3ef78a0992f3417fbb39222cd8883136 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.8
    Found link https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.9.tar.gz#md5=1c78adccc7f98735ab75055931689f68 (from https://pypi.python.org/simple/prompt-toolkit/), version: 0.9
  Using version 0.25 (newest of versions: 0.25, 0.23, 0.22, 0.21, 0.20, 0.19, 0.18, 0.17, 0.16, 0.15, 0.14, 0.13, 0.12, 0.11, 0.10, 0.9, 0.8, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1)
  Downloading from URL https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.25.tar.gz#md5=be64d70110358e937163e8fd548a00e0 (from https://pypi.python.org/simple/prompt-toolkit/)
  Running setup.py egg_info for package prompt-toolkit

    running egg_info
    creating pip-egg-info/prompt_toolkit.egg-info
    writing requirements to pip-egg-info/prompt_toolkit.egg-info/requires.txt
    writing pip-egg-info/prompt_toolkit.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/prompt_toolkit.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/prompt_toolkit.egg-info/dependency_links.txt
    writing entry points to pip-egg-info/prompt_toolkit.egg-info/entry_points.txt
    writing manifest file 'pip-egg-info/prompt_toolkit.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found


    reading manifest file 'pip-egg-info/prompt_toolkit.egg-info/SOURCES.txt'
    writing manifest file 'pip-egg-info/prompt_toolkit.egg-info/SOURCES.txt'
  Source in /private/var/folders/pd/xt410rg54rgf0595nx62wt6r0000gn/T/pip_build_samm/prompt-toolkit has version 0.25, which satisfies requirement prompt-toolkit (from pgcli)
  skipping extra ptipython
Downloading/unpacking psycopg2 (from pgcli)

  Getting page https://pypi.python.org/simple/psycopg2/
  URLs to search for versions for psycopg2 (from pgcli):
  * https://pypi.python.org/simple/psycopg2/
  Getting page http://initd.org/projects/psycopg2
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.10.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.11.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.12.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.13.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.14.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.2.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.3.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.4.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.5.1.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.6.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.7.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.8.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-2/psycopg2-2.2.0.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-2/psycopg2-2.2.1.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-2/psycopg2-2.2.2.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-3/psycopg2-2.3.0.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-3/psycopg2-2.3.1.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-3/psycopg2-2.3.2.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.1.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.2.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.3.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.4.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.5.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.6.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.1.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.2.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.3.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.4.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Skipping page http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.tar.gz (from https://pypi.python.org/simple/psycopg2/) because of Content-Type: application/x-gzip
  Analyzing links from page https://pypi.python.org/simple/psycopg2/
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.0.10.tar.gz#md5=2dc60d0fd90ad681e1e9106edef34e97 (from https://pypi.python.org/simple/psycopg2/), version: 2.0.10
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.0.11.tar.gz#md5=eec2a45bcea75a00cbf20a15ab1b8bae (from https://pypi.python.org/simple/psycopg2/), version: 2.0.11
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.0.12.tar.gz#md5=5c8080d0d0568479f041bb8534caf1f8 (from https://pypi.python.org/simple/psycopg2/), version: 2.0.12
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.0.13.tar.gz#md5=f520260595f4fcf035d26cfd57a75f19 (from https://pypi.python.org/simple/psycopg2/), version: 2.0.13
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.0.14.tar.gz#md5=30136c7753acc9cbdc36cc5c2448fdee (from https://pypi.python.org/simple/psycopg2/), version: 2.0.14
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.2.0.tar.gz#md5=4a69436dc8efbfe2859ae3aeed85d03e (from https://pypi.python.org/simple/psycopg2/), version: 2.2.0
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.2.1.tar.gz#md5=70b50773aefe5fb371ff4a018382012f (from https://pypi.python.org/simple/psycopg2/), version: 2.2.1
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.2.2.tar.gz#md5=571af2ad9dfeb522ee5f8553278a4c38 (from https://pypi.python.org/simple/psycopg2/), version: 2.2.2
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.3.0.tar.gz#md5=0b52101b47f1e73001c6412d9a476222 (from https://pypi.python.org/simple/psycopg2/), version: 2.3.0
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.3.1.tar.gz#md5=15d1c7f821f3a0306955d6cde3e762af (from https://pypi.python.org/simple/psycopg2/), version: 2.3.1
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.3.2.tar.gz#md5=11e8021a4fda49faa15495f8bea65f4d (from https://pypi.python.org/simple/psycopg2/), version: 2.3.2
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.1.tar.gz#md5=4e79c822ab75dd89d931ee627c66032f (from https://pypi.python.org/simple/psycopg2/), version: 2.4.1
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.2.tar.gz#md5=58cfd294d28b7e8ef059d72085d71ac2 (from https://pypi.python.org/simple/psycopg2/), version: 2.4.2
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.3.tar.gz#md5=5f67ca0c8b6c1ac5c4afd82811e0facc (from https://pypi.python.org/simple/psycopg2/), version: 2.4.3
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.4.tar.gz#md5=639e014ea9ce3aa3306724f12d16d79b (from https://pypi.python.org/simple/psycopg2/), version: 2.4.4
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.5.tar.gz#md5=075e4df465e9a863f288d5bdf6e6887e (from https://pypi.python.org/simple/psycopg2/), version: 2.4.5
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.6.tar.gz#md5=79d7f05e67bf70a0ecc6e9103ccece5f (from https://pypi.python.org/simple/psycopg2/), version: 2.4.6
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160 (from https://pypi.python.org/simple/psycopg2/), version: 2.4
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.5.1.tar.gz#md5=1b433f83d50d1bc61e09026e906d84c7 (from https://pypi.python.org/simple/psycopg2/), version: 2.5.1
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.5.2.tar.gz#md5=53d81793fbab8fee6e732a0425d50047 (from https://pypi.python.org/simple/psycopg2/), version: 2.5.2
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.5.3.tar.gz#md5=09dcec70f623a9ef774f1aef75690995 (from https://pypi.python.org/simple/psycopg2/), version: 2.5.3
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.5.4.tar.gz#md5=25216543a707eb33fd83aa8efb6e3f26 (from https://pypi.python.org/simple/psycopg2/), version: 2.5.4
    Found link https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.5.tar.gz#md5=facd82faa067e99b80146a0ee2f842f6 (from https://pypi.python.org/simple/psycopg2/), version: 2.5
    Skipping link http://initd.org/projects/psycopg2 (from https://pypi.python.org/simple/psycopg2/); not a file
    Skipping link http://initd.org/psycopg/ (from https://pypi.python.org/simple/psycopg2/); not a file
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.10.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.0.10
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.11.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.0.11
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.12.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.0.12
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.13.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.0.13
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.14.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.0.14
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.2.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.0.2
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.3.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.0.3
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.4.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.0.4
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.5.1.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.0.5.1
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.6.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.0.6
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.7.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.0.7
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-0/psycopg2-2.0.8.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.0.8
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-2/psycopg2-2.2.0.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.2.0
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-2/psycopg2-2.2.1.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.2.1
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-2/psycopg2-2.2.2.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.2.2
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-3/psycopg2-2.3.0.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.3.0
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-3/psycopg2-2.3.1.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.3.1
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-3/psycopg2-2.3.2.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.3.2
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.1.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.4.1
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.2.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.4.2
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.3.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.4.3
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.4.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.4.4
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.5.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.4.5
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.6.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.4.6
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.4
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.1.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.5.1
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.2.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.5.2
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.3.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.5.3
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.4.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.5.4
    Found link http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.tar.gz (from https://pypi.python.org/simple/psycopg2/), version: 2.5
  Analyzing links from page http://initd.org/psycopg/
    Skipping link http://initd.org/psycopg/download/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/docs/install.html (from http://initd.org/psycopg/); unknown archive format: .html
    Skipping link http://initd.org/psycopg/docs/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/articles/tag/news/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/articles/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/development/ (from http://initd.org/psycopg/); not a file
    Skipping link http://www.postgresql.org/ (from http://initd.org/psycopg/); not a file
    Skipping link http://www.python.org/ (from http://initd.org/psycopg/); not a file
    Skipping link http://www.python.org/dev/peps/pep-0249/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/license/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/features/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/docs/faq.html (from http://initd.org/psycopg/); unknown archive format: .html
    Skipping link http://initd.org/psycopg/articles/2014/08/30/psycopg-254-released/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/articles/author/piro/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/articles/tag/release/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/articles/2014/07/20/cancelling-postgresql-statements-python/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/articles/tag/recipe/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/articles/2014/05/13/psycopg-253-released/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/articles/2014/01/07/psycopg-252-released/ (from http://initd.org/psycopg/); not a file
    Skipping link http://initd.org/psycopg/articles/2013/06/23/psycopg-251-released/ (from http://initd.org/psycopg/); not a file
    Skipping link http://www.psycopg.org/ (from http://initd.org/psycopg/); not a file
    Skipping link http://www.stickpeople.com/projects/python/win-psycopg/ (from http://initd.org/psycopg/); not a file
    Skipping link https://github.com/psycopg/psycopg2/issues (from http://initd.org/psycopg/); not a file
    Skipping link http://mail.postgresql.org/mj/mj_wwwusr/domain=postgresql.org?func=lists-long-full&extra=psycopg (from http://initd.org/psycopg/); unknown archive format: .org
    Skipping link http://twitter.com/psycopg (from http://initd.org/psycopg/); not a file
    Skipping link http://search.twitter.com/search?q=%23psycopg2 (from http://initd.org/psycopg/); not a file
    Skipping link http://search.twitter.com/search?q=%23GitHub (from http://initd.org/psycopg/); not a file
    Skipping link https://t.co/sCAIy61t (from http://initd.org/psycopg/); not a file
    Skipping link http://twitter.com/mikeyk (from http://initd.org/psycopg/); not a file
    Skipping link http://t.co/gc76xQpw (from http://initd.org/psycopg/); not a file
    Skipping link http://twitter.com/mancho_z (from http://initd.org/psycopg/); not a file
    Skipping link http://twitter.com/fogzot (from http://initd.org/psycopg/); not a file
    Skipping link http://twitter.com/instagram (from http://initd.org/psycopg/); not a file
  Analyzing links from page http://initd.org/psycopg/
  Using version 2.5.4 (newest of versions: 2.5.4, 2.5.4, 2.5.3, 2.5.3, 2.5.2, 2.5.2, 2.5.1, 2.5.1, 2.5, 2.5, 2.4.6, 2.4.6, 2.4.5, 2.4.5, 2.4.4, 2.4.4, 2.4.3, 2.4.3, 2.4.2, 2.4.2, 2.4.1, 2.4.1, 2.4, 2.4, 2.3.2, 2.3.2, 2.3.1, 2.3.1, 2.3.0, 2.3.0, 2.2.2, 2.2.2, 2.2.1, 2.2.1, 2.2.0, 2.2.0, 2.0.14, 2.0.14, 2.0.13, 2.0.13, 2.0.12, 2.0.12, 2.0.11, 2.0.11, 2.0.10, 2.0.10, 2.0.8, 2.0.7, 2.0.6, 2.0.5.1, 2.0.4, 2.0.3, 2.0.2)
  Downloading from URL https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.5.4.tar.gz#md5=25216543a707eb33fd83aa8efb6e3f26 (from https://pypi.python.org/simple/psycopg2/)
  Running setup.py egg_info for package psycopg2

    running egg_info
    creating pip-egg-info/psycopg2.egg-info
    writing pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found


    Error: pg_config executable not found.



    Please add the directory containing pg_config to the PATH

    or specify the full executable path with the option:



        python setup.py build_ext --pg-config /path/to/pg_config build ...



    or with the pg_config option in 'setup.cfg'.

    Complete output from command python setup.py egg_info:

    running egg_info

creating pip-egg-info/psycopg2.egg-info

writing pip-egg-info/psycopg2.egg-info/PKG-INFO

writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt

writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt

writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

warning: manifest_maker: standard file '-c' not found



Error: pg_config executable not found.



Please add the directory containing pg_config to the PATH

or specify the full executable path with the option:



    python setup.py build_ext --pg-config /path/to/pg_config build ...



or with the pg_config option in 'setup.cfg'.

----------------------------------------

Cleaning up...

  Removing temporary dir /private/var/folders/pd/xt410rg54rgf0595nx62wt6r0000gn/T/pip_build_samm...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/pd/xt410rg54rgf0595nx62wt6r0000gn/T/pip_build_samm/psycopg2

Exception information:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-1.4.1-py2.7.egg/pip/basecommand.py", line 134, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-1.4.1-py2.7.egg/pip/commands/install.py", line 236, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Library/Python/2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 1134, in prepare_files
    req_to_install.run_egg_info()
  File "/Library/Python/2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 259, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/Library/Python/2.7/site-packages/pip-1.4.1-py2.7.egg/pip/util.py", line 670, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /private/var/folders/pd/xt410rg54rgf0595nx62wt6r0000gn/T/pip_build_samm/psycopg2

\dt schema.*

\dt *.* and \dt schema.* has no effect at all. its always show public schema tables.

Homebrew formula

I have a WIP formula, I just need to figure out how to write a proper test for it.

You can try it by running

brew install https://raw.githubusercontent.com/tvon/homebrew/pgcli/Library/Formula/pgcli.rb

Any feedback would be appreciated.

weird bugs after trying out pgcli

I just installed pgcli. Sometimes, \d works. Other times it doesn't.

giftgram_dev> \d sent_giftgrams
local variable 'indexdef' referenced before assignment

Also, \h doesn't work for me:

giftgram_dev> \h alter TABLE alter COLUMN
ERROR:  syntax error at or near "\"
LINE 1: \h alter TABLE alter COLUMN
        ^

Thanks for starting this project!

Can't connect to Greenplum server (psycopg2.ProgrammingError: column d.datcollate does not exist)

So, after getting past the jedi issue, I got pgcli to work on a local PostgreSQL instance. I'm now trying to connect to a Greenplum database (a distributed database built on top of PostgreSQL. Anything that can talk to vanilla Postgres should be able to talk to Greenplum...I've had no issues with, eg, pgAdmin or psycopg2). Here's what happens:

$ pgcli postgresql://[username]:[password]@[host]/[dbname]
Traceback (most recent call last):
  File "/usr/local/bin/pgcli", line 9, in <module>
    load_entry_point('pgcli==0.10.0', 'console_scripts', 'pgcli')()
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 610, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 590, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 416, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pgcli/main.py", line 86, in cli
    refresh_completions(pgexecute, completer)
  File "/usr/local/lib/python2.7/site-packages/pgcli/main.py", line 180, in refresh_completions
    completer.extend_database_names(pgexecute.databases())
  File "/usr/local/lib/python2.7/site-packages/pgcli/pgexecute.py", line 138, in databases
    cur.execute(self.databases_query)
psycopg2.ProgrammingError: column d.datcollate does not exist
LINE 4:        d.datcollate as "Collate",

Googling seems to turn up nothing.

Thanks again for your time.

Traceback on first run

Ubuntu 14.04, Python 2.7.3 (inside an activated virtualenv)
pgcli==0.10.0 (installed inside activated virtualenv)

I get the following...

665 18:30:11 [~/code/ottoman] J:0 venv λ customcart ▼ pgcli ottoman
Traceback (most recent call last):
  File "/home/vagrant/code/ottoman/venv/bin/pgcli", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/home/vagrant/code/ottoman/venv/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 2603, in <module>
  File "/home/vagrant/code/ottoman/venv/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 666, in require
  File "/home/vagrant/code/ottoman/venv/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 565, in resolve
pkg_resources.DistributionNotFound: Click
668 18:31:29 [~/code/ottoman] J:0 venv λ customcart ▼ psql ottoman
psql (9.3.5)
Type "help" for help.

ottoman=# \q

Automatically quote some arguments

For instance, my postgresql database has a column called "order" but obviously typing that in will result in a syntax error as it expects this to be the ORDER BY clause. You should detect some of these keywords which are actually columns and quote them with double quotes.

Error when running in python 3 (Windows)

Not sure if this is a problem with Windows x64, python 3.3, or the conda virtual environment, but I get this error immediately after connecting to a database. Everything works fine if I use a python 2.7 venv instead.

Traceback (most recent call last):
File "C:\Users\dg\Anaconda3\envs\pycli_py33\Scripts\pgcli-script.py", line 9,
in
load_entry_point('pgcli==0.10.0', 'console_scripts', 'pgcli')()
File "C:\Users\dg\Anaconda3\envs\pycli_py33\lib\site-packages\click\core.py",
line 610, in call
return self.main(args, *kwargs)
File "C:\Users\dg\Anaconda3\envs\pycli_py33\lib\site-packages\click\core.py",
line 590, in main
rv = self.invoke(ctx)
File "C:\Users\dg\Anaconda3\envs\pycli_py33\lib\site-packages\click\core.py",
line 782, in invoke
return ctx.invoke(self.callback, *ctx.params)
File "C:\Users\dg\Anaconda3\envs\pycli_py33\lib\site-packages\click\core.py",
line 416, in invoke
return callback(args, **kwargs)
File "C:\Users\dg\Anaconda3\envs\pycli_py33\lib\site-packages\pgcli\main.py",
line 95, in cli
document = cli.read_input(on_exit=AbortAction.RAISE_EXCEPTION)
File "C:\Users\dg\Anaconda3\envs\pycli_py33\lib\site-packages\prompt_toolkit

init
.py", line 243, in read_input
next(g)
File "C:\Users\dg\Anaconda3\envs\pycli_py33\lib\site-packages\prompt_toolkit

init
.py", line 295, in _read_input
self.redraw()
File "C:\Users\dg\Anaconda3\envs\pycli_py33\lib\site-packages\prompt_toolkit_
init
.py", line 182, in _redraw
self.renderer.render(self)
File "C:\Users\dg\Anaconda3\envs\pycli_py33\lib\site-packages\prompt_toolkit\r
enderer.py", line 465, in render
style=self._style, grayed=cli.is_aborting,
File "C:\Users\dg\Anaconda3\envs\pycli_py33\lib\site-packages\prompt_toolkit\r
enderer.py", line 345, in output_screen_diff
current_pos = move_cursor(screen.get_cursor_position())
File "C:\Users\dg\Anaconda3\envs\pycli_py33\lib\site-packages\prompt_toolkit\r
enderer.py", line 232, in move_cursor
output.cursor_up(current_y - new.y)
File "C:\Users\dg\Anaconda3\envs\pycli_py33\lib\site-packages\prompt_toolkit\t
erminal\win32_output.py", line 166, in cursor_up
sr = self._screen_buffer_info().dwCursorPosition
AttributeError: 'NoneType' object has no attribute 'dwCursorPosition'

No rows returned if a row contains unicode character

SQL queries returned empty row, found out that it was caused by unicode character.

create table my_table (val text);
insert into my_table (val) values ('a'), ('b'), ('unicode \u2013 is – here');
my-db> select * from my_table limit 2
+-------+
| val   |
|-------|
| a     |
| b     |
+-------+
SELECT 2
my-db> select * from my_table limit 3

my-db>

We get the expected rows if we use the row_to_json function

my-db> select row_to_json(row(val)) from my_table limit 3
+--------------------------------------------+
| row_to_json                                |
|--------------------------------------------|
| {u'f1': u'a'}                              |
| {u'f1': u'b'}                              |
| {u'f1': u'unicode \\u2013 is \u2013 here'} |
+--------------------------------------------+
SELECT 3
my-db>

Auto-complete view names

Much like table names, it would be nice to have the names of views (shown via \dv) included in the auto-complete list.

Add auto-completion for subqueries

When you want to write a subquery, part of it won't have auto-complete hints:

  • completion of select keyword in subquery,
  • completion of table name after from.

After you state a table, columns will be hinted correctly.

Minimum Pygments version

Cent 6 has a very outdated python-pygments package. (It was already installed on my system as a dep for an unrelated package.) I didn't dive in to the traceback to see if Pygments changed something or if SQL support is new (would be weird but maybe?). In any case the traceback is below. Upgrading Pygments (installed via pip) fixed the problem. Perhaps a pre-flight version check is needed?

$ pgcli
Traceback (most recent call last):
  File "/usr/bin/pgcli", line 9, in <module>
    load_entry_point('pgcli==0.10.0', 'console_scripts', 'pgcli')()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 299, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2229, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.6/site-packages/pgcli/main.py", line 16, in <module>
    from pygments.lexers.sql import SqlLexer
ImportError: No module named sql

Canceling slow query

When using psql, I can cancel a slow query (e.g. when I accidentally forgot a LIMIT clause) by pressing ctrl-c. This would be useful for pgcli, too.

Getting an error trying to run

Whenever I try to use the program I get a python error:

Traceback (most recent call last):
  File "/usr/local/bin/pgcli", line 9, in <module>
    load_entry_point('pgcli==0.10.0', 'console_scripts', 'pgcli')()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 610, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 590, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 416, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pgcli/main.py", line 86, in cli
    refresh_completions(pgexecute, completer)
  File "/usr/local/lib/python2.7/dist-packages/pgcli/main.py", line 176, in refresh_completions
    tables = pgexecute.tables()
  File "/usr/local/lib/python2.7/dist-packages/pgcli/pgexecute.py", line 120, in tables
    with self.conn.cursor() as cur:
AttributeError: __exit__

Using python 2.7 and psql 9.3.5 on Ubuntu 14.04.

Add support for several "\dX" commands

Standard pgsql supports a lot of \dX commands, for example \dn (to show schemas), \ds to show sequences, etc., but pgcli only seems to know about \d, \dv, \dt and \dt.

Any other \dX gives a syntax error:

postgres> \dn
ERROR:  syntax error at or near "\"
LINE 1: \dn
        ^

Config reading is failing when an option is missing

Steps to reproduce.

Open ~/.pgclirc, delete the line with multi-line option.

Launch pgcli and it crashes with the following error:

  File "/Users/amjith/.virtualenvs/pg-cli/bin/pgcli", line 9, in <module>
    load_entry_point('pgcli==0.8.1', 'console_scripts', 'pgcli')()
  File "/Users/amjith/.virtualenvs/pg-cli/lib/python2.7/site-packages/click/core.py", line 610, in __call__
    return self.main(*args, **kwargs)
  File "/Users/amjith/.virtualenvs/pg-cli/lib/python2.7/site-packages/click/core.py", line 590, in main
    rv = self.invoke(ctx)
  File "/Users/amjith/.virtualenvs/pg-cli/lib/python2.7/site-packages/click/core.py", line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/amjith/.virtualenvs/pg-cli/lib/python2.7/site-packages/click/core.py", line 416, in invoke
    return callback(*args, **kwargs)
  File "/Users/amjith/Dropbox/code/python/pgcli/pgcli/main.py", line 55, in cli
    multi_line = config.getboolean('main', 'multi_line')
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 368, in getboolean
    v = self.get(section, option)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 618, in get
    raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option u'multi_line' in section: u'main'

This is because the ConfigParser is reading a config option without providing a default value to fall back.

@j-bennet Would you mind taking a stab at this bug? If you don't have time, let me know.

Error with jedi dependency

I just installed using pip install pgcli (using Python + pip from Homebrew). I get this traceback error trying to run the pgcli command:

~ ❯ pgcli gadm
Traceback (most recent call last):
  File "/usr/local/bin/pgcli", line 5, in <module>
    from pkg_resources import load_entry_point
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources.py", line 2912, in <module>
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources.py", line 550, in _build_master
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources.py", line 563, in _build_from_requirements
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources.py", line 742, in resolve
pkg_resources.DistributionNotFound: jedi>=0.8.1

Looks like an issue with the jedi package, but it shows that it's installed:

~ ❯ pip show jedi                                                                                                                                                                  ⏎

---
Name: jedi
Version: 0.8.1-final0
Location: /usr/local/lib/python2.7/site-packages
Requires:

Cannot install without local Postgres

Installation on OSX using pip or easy_install fails with

Error: pg_config executable not found.

I have no local installation of Postgres. I'm using a Docker container to run the database.

Unicode chars in results cause query to return nothing

OS X Terminal.app. My environment:

# env | grep "LANG|LC" 
LANG=en_US.UTF-8

pgcli examples:

test> create table unicodechars (t text);
CREATE TABLE
test> insert into unicodechars (t) values ('e');
INSERT 0 1
test> insert into unicodechars (t) values ('é');
INSERT 0 1
test> select * from unicodechars limit 1;
+-----+
| t   |
|-----|
| e   |
+-----+
SELECT 1
test> select * from unicodechars;

test>

The last query returns nothing, not even an error. Also:

test> select 'e';
+------------+
| ?column?   |
|------------|
| e          |
+------------+
SELECT 1
test> select 'é';

test> select '😁';

test>

The prompt is also screwed up by UTF-8 chars. For example, using the up-arrow to go back leads to:

test> selecté';

Better error message for failed connections

$ psql mydb
psql: FATAL:  role "me" does not exist

vs

$ pgcli mydb
Traceback (most recent call last):
  File "/usr/local/bin/pgcli", line 9, in <module>
    load_entry_point('pgcli==0.10.0', 'console_scripts', 'pgcli')()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 572, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 552, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 744, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 388, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pgcli/main.py", line 76, in cli
    click.secho(e.message, err=True, fg='red')
  File "/usr/local/lib/python2.7/dist-packages/click/termui.py", line 381, in secho
    text = style(text, **styles)
TypeError: style() got an unexpected keyword argument 'err'

First thought: there is something wrong in my installation, too bad. I did a little googling then pgcli --help and rerun it as pgcli -U myuser mydb. That worked, nevertheless, as a low priority enhancement, try mimicking psql's error messages we are all familiar with.

\c invalid_database

Using \c with an invalid database name result in crash.

postgres> \c aaa
Traceback (most recent call last):
  File "/usr/local/bin/pgcli", line 9, in <module>
    load_entry_point('pgcli==0.10.2', 'console_scripts', 'pgcli')()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 610, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 590, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 416, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pgcli/main.py", line 119, in cli
    click.secho(e.pgerror, err=True, fg='red')
  File "/usr/local/lib/python2.7/dist-packages/click/termui.py", line 381, in secho
    text = style(text, **styles)
  File "/usr/local/lib/python2.7/dist-packages/click/termui.py", line 354, in style
    return ''.join(bits)
TypeError: sequence item 1: expected string, NoneType found

Commands with + at end fails

searchdb> \d+
ERROR: syntax error at or near ""
LINE 1: \d+
^

searchdb> \l+
ERROR: syntax error at or near ""
LINE 1: \l+
^
Looks like they are not properly parsed (Are you using Python "cmd" based REPL ?)
These are Python syntax errors clearly.

Multiple queries on the same line

Only the last query result is output.

Got:

$ pgcli -U postgres -h localhost _test_db
_test_db> select 1; select 2
+------------+
|   ?column? |
|------------|
|          2 |
+------------+
SELECT 1

Expected: PSQL

$ psql -U postgres -h localhost _test_db
psql (9.3.5)
Type "help" for help.

_test_db=# select 1; select 2;
 ?column? 
----------
        1
(1 row)

 ?column? 
----------
        2
(1 row)

ImportError: No module named sql

Here is the error I get when I try to run it on Ubuntu 12.04:

Traceback (most recent call last):
File "/usr/local/bin/pgcli", line 9, in
load_entry_point('pgcli==0.10.0', 'console_scripts', 'pgcli')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2279, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/usr/local/lib/python2.7/dist-packages/pgcli/main.py", line 16, in
from pygments.lexers.sql import SqlLexer
ImportError: No module named sql

Should understand -d param

I expected pgcli to understand all the params of psql, including -d/--dbname for database name. It would be a nice tweak if it could work as a drop in for psql as far as possible.

BIGSERIAL type printing

Using pgcli I get this:

digdb> select last_value from pages_id_seq;
+--------------+
|   last_value |
|--------------|
|  2.07641e+06 |
+--------------+
SELECT 1
digdb> 

With psql:

digdb=> select last_value from pages_id_seq;
 last_value 
------------
    2076410
(1 row)

digdb=> 

Can I get an output like which I got from psql or this won't fix?

handle CTRL+arrow sequences

You can jump to next word in psql with CTRL + right arrow sequence (or get back one word with left arrow). In pgcli this will produce bare sequence codes:

(arrow right, arrow left)

dev> sel[1;5D[1;5Cect * from 

Auto-complete double quotes for tables/columns with capital letters

Is it easy to include double quotes around tables or columns that contain capital letters for auto-complete? If quotes are not included, then postgres takes that name, puts it in all lowercase, does a case-sensitive comparison, and does not find the column or table. Put it in quotes, it skips the lowercase step and finds it.

install page

Hi,

there is an error on install page, it should be

sudo easy_install pip not sudo easy_install install pip

Database access in tests

It's currently quite hard to make sure that no new regressions are introduced while adding new functionality or fixing bugs.

I would propose adding support for a tests that have access to a running postgres instance and can use it to run commands against. If postgres is not running, such tests would be skipped.

Travis does have support for postgres and with some experimentation I'm sure turning it on in wouldn't be a problem.

@amjith, how do you feel about this? Would it be something that agrees with your plans for the project?

Support \x for Expanded Display

The tabulate output looks very pretty, but a feature I love from psql is the expanded display option (\x) for looking at rows in really wide tables (ie tables with rows that are too big to fit in one line on the terminal). However, this isn't yet supported in pgcli:

$ pgcli
[dbname]> \x
syntax error at or near "\"
LINE 1: \x
        ^

Not compatible with click 3.0-3.1

When an error happens, it calls click.termui.secho() with a keyword argument err.
This keyword argument has been introduced in the release 3.2 of click, so if a
version 3.0 or 3.1 is used, and any error happens, such as if I do:

$ pgcli mydb
mydb> invalid command;

I get a crash

Traceback (most recent call last):
  File "/usr/local/bin/pgcli", line 9, in <module>
    load_entry_point('pgcli==0.10.0', 'console_scripts', 'pgcli')()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 572, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 552, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 744, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 388, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pgcli-0.10.0-py2.7.egg/pgcli/main.py", line 119, in cli
    click.secho(e.pgerror, err=True, fg='red')
  File "/usr/local/lib/python2.7/dist-packages/click/termui.py", line 381, in secho
    text = style(text, **styles)
TypeError: style() got an unexpected keyword argument 'err'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.