Обсуждение: pgadmin 4 v1.5 - Import CSV

Поиск
Список
Период
Сортировка

pgadmin 4 v1.5 - Import CSV

От
Kenny
Дата:

First off ... I'm a newbie so please feel free to suspect anything I say as incorrect.

Here's what I think I know.

I'm running Ubuntu Server 16.04

To install I created a user pgadmin

cd
virtualenv pgadmin4
cd pgadmin4
source bin/activate
wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v1.5/pip/pgadmin4-1.5-py2.py3-none-any.whl
pip install ./pgadmin4-1.5-py2.py3-none-any.whl

It asked me for a username/password during setup.

I changed nothing else and can run the webserver as follows:

python ~/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

I can access the application as expected at 127.0.0.1:5050.

So without changing anything else or creating a config_local.py or running setup.py ... everything seems working?

I can make tables, perform queries ... and it's beautiful btw!

I uploaded a CSV ... and the file was placed in:

/home/pgadmin/.pgadmin/storage/pgadmin

I tried to import that same file thru pgadmin and got an error that I just don't know what to do with.

snippet:
"/usr/bin/psql/psl" -command ... blablabla ... FROM '<STORAGE_DIR>/abbr.csv'

It looks to me like the <STORAGE_DIR> replacement variable is just not being replaced?

-please see attached (if I can attach an image that is ... we'll find out!) -

Thanks!

Вложения

Re: pgadmin 4 v1.5 - Import CSV

От
Richard Greenwood
Дата:
I don't think the fact that it says <STORAGE_DIR> means that it failed to evaluate STORAGE_DIR because I just did a successful csv import and the output's "Running command" looks like this:

"/usr/lib/postgresql/9.4/bin/psql" --command " "\\copy treas.tscombination (tscombinationid, combination, description, milllevy) FROM '<STORAGE_DIR>/w2/gis/Wyoming/22_Teton/scripts/dump/treas/tscombination.csv' DELIMITER ',' CSV HEADER QUOTE '\"' ESCAPE '''';""

Which doesn't look significantly different than yours.

I'd suggest pasting your "Running command" into a shell with appropriate environment variables set and see if you get more useful error info from psql. "appropriate environment variables" might look something like:
export PGHOST=localhost
export PGPORT=5432
export PGDATABASE=your_database
export PGUSER=postgres
export PGPASSWORD=password
and of course change <STORAGE_DIR> to /home/pgadmin/.pgadmin/storage/pgadmin/

I'm guessing permissions problems. Are you 'potgres' when you run it? And do you have access to /home/pgadmin/.pgadmin/storage/pgadmin/? For me I'm putting my stuff in my home dir, so: /home/rich/.pgadmin/storage/rich/

Let us know...
Rich



  

On Tue, Jun 27, 2017 at 9:51 AM, Kenny <modeltwelve@vinacs.com> wrote:

First off ... I'm a newbie so please feel free to suspect anything I say as incorrect.

Here's what I think I know.

I'm running Ubuntu Server 16.04

To install I created a user pgadmin

cd
virtualenv pgadmin4
cd pgadmin4
source bin/activate
wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v1.5/pip/pgadmin4-1.5-py2.py3-none-any.whl
pip install ./pgadmin4-1.5-py2.py3-none-any.whl

It asked me for a username/password during setup.

I changed nothing else and can run the webserver as follows:

python ~/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

I can access the application as expected at 127.0.0.1:5050.

So without changing anything else or creating a config_local.py or running setup.py ... everything seems working?

I can make tables, perform queries ... and it's beautiful btw!

I uploaded a CSV ... and the file was placed in:

/home/pgadmin/.pgadmin/storage/pgadmin

I tried to import that same file thru pgadmin and got an error that I just don't know what to do with.

snippet:
"/usr/bin/psql/psl" -command ... blablabla ... FROM '<STORAGE_DIR>/abbr.csv'

It looks to me like the <STORAGE_DIR> replacement variable is just not being replaced?

-please see attached (if I can attach an image that is ... we'll find out!) -

Thanks!




--
Richard W. Greenwood, PLS
www.greenwoodmap.com

Re: pgadmin 4 v1.5 - Import CSV

От
Murtuza Zabuawala
Дата:
Hi,

Also check logs for any errors,
Log location: ~/.pgadmin/pgadmin4.log

You can also try changing log level follow the steps from post Link and try re-producing the issue (First delete/rename older log file).

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


On Wed, Jun 28, 2017 at 6:44 AM, Richard Greenwood <richard.greenwood@gmail.com> wrote:
I don't think the fact that it says <STORAGE_DIR> means that it failed to evaluate STORAGE_DIR because I just did a successful csv import and the output's "Running command" looks like this:

"/usr/lib/postgresql/9.4/bin/psql" --command " "\\copy treas.tscombination (tscombinationid, combination, description, milllevy) FROM '<STORAGE_DIR>/w2/gis/Wyoming/22_Teton/scripts/dump/treas/tscombination.csv' DELIMITER ',' CSV HEADER QUOTE '\"' ESCAPE '''';""

Which doesn't look significantly different than yours.

I'd suggest pasting your "Running command" into a shell with appropriate environment variables set and see if you get more useful error info from psql. "appropriate environment variables" might look something like:
export PGHOST=localhost
export PGPORT=5432
export PGDATABASE=your_database
export PGUSER=postgres
export PGPASSWORD=password
and of course change <STORAGE_DIR> to /home/pgadmin/.pgadmin/storage/pgadmin/

I'm guessing permissions problems. Are you 'potgres' when you run it? And do you have access to /home/pgadmin/.pgadmin/storage/pgadmin/? For me I'm putting my stuff in my home dir, so: /home/rich/.pgadmin/storage/rich/

Let us know...
Rich



  

On Tue, Jun 27, 2017 at 9:51 AM, Kenny <modeltwelve@vinacs.com> wrote:

First off ... I'm a newbie so please feel free to suspect anything I say as incorrect.

Here's what I think I know.

I'm running Ubuntu Server 16.04

To install I created a user pgadmin

cd
virtualenv pgadmin4
cd pgadmin4
source bin/activate
wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v1.5/pip/pgadmin4-1.5-py2.py3-none-any.whl
pip install ./pgadmin4-1.5-py2.py3-none-any.whl

It asked me for a username/password during setup.

I changed nothing else and can run the webserver as follows:

python ~/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

I can access the application as expected at 127.0.0.1:5050.

So without changing anything else or creating a config_local.py or running setup.py ... everything seems working?

I can make tables, perform queries ... and it's beautiful btw!

I uploaded a CSV ... and the file was placed in:

/home/pgadmin/.pgadmin/storage/pgadmin

I tried to import that same file thru pgadmin and got an error that I just don't know what to do with.

snippet:
"/usr/bin/psql/psl" -command ... blablabla ... FROM '<STORAGE_DIR>/abbr.csv'

It looks to me like the <STORAGE_DIR> replacement variable is just not being replaced?

-please see attached (if I can attach an image that is ... we'll find out!) -

Thanks!




--
Richard W. Greenwood, PLS
www.greenwoodmap.com

Re: pgadmin 4 v1.5 - Import CSV

От
Kenny
Дата:
OMGoodness ... sorry to waste everyone's time and thanks for the replies 
... it was all me ...

I entered:

/usr/bin/psql as the path but it only wanted the directory ... /usr/bin

and of course it added the psql itself ... dang.

I probably wouldn't have seen that maybe never ... so thanks again for 
making me look via the command line!

It works ... w00t!

PS: Hope everyone has a great day!