error psql: warning: extra command-line argument [closed] - command-line

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have Ubuntu 14 server dockerized. All are good I guess, but when I'm going to dump a table:
psql -c -h myserver -p5433 mydb -t gr_service_plan_xxx > gr_service_plan_xxx.sql
an error occurs:
psql: warning: extra command-line argument
What does it mean? Am I missing something in the command line?

Judging from the command arguments you included, I think you intended to run pg_dump not psql:
pg_dump -c -h myserver -p 5433 mydb -t gr_service_plan_xxx > gr_service_plan_xxx.sql
Or you need to specify the command for psql, for example:
psql -h myserver -p5433 mydb -c 'SELECT * FROM gr_service_plan_xxx;' > gr_service_plan_xxx.sql

Related

what does docker build -f 12.Dockerfile -t docker.something.com/blah/postgresql:12 . mean? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I think the main question is complete. I am not familiar with docker and I would love if someone could break down for me the meaning of the following command:
docker build -f 12.Dockerfile -t docker.something.com/blah/postgresql:12 .
docker build -f 12.Dockerfile -t docker.something.com/blah/postgresql:12 .
Breaking it down:
docker build is using the docker cli to invoke the build command
-f 12.Dockerfile specifies the 12.Dockerfile file as the Dockerfile you are trying to build
-t docker.something.com/blah/postgresql:12 is specifying a tag which would be used to identify the build image
. is the docker context that tells docker that files and directories it would have access to, should it need to copy everything.
That said, you'd be better served by reading the documentation and familiarising yourself with these concepts

put automatically password of user in pg_restore command line windows [duplicate]

This question already has answers here:
How do I specify a password to 'psql' non-interactively?
(11 answers)
Closed 4 years ago.
I want to restore my database postgres using pg_restore in command line and i want to put the password of user directly in the command, I tried this command but doesn't work
pg_restore -h localhost -p 5432 -U postgres -W 123 -d my_db my_backup.backup
but the following message is displayed
pg_restore: too many arguments on the command line (the first being "-d")
Set the password as an environment variable: set "PGPASSWORD=123"
You can set other arguments this way as well: https://www.postgresql.org/docs/current/static/libpq-envars.html
-W is to force a password prompt, not to supply a password directly, thats why it says there are too many arguments.
Putting it all together:
set "PGPASSWORD=123"
pg_restore -h localhost -p 5432 -U postgres -d my_db my_backup.backup
Update: Thanks #aschipfl, I initially had incorrect quoting on set

import sql dump into postgres [duplicate]

This question already has answers here:
Import SQL dump into postgresql [closed]
(3 answers)
Closed 10 years ago.
when i run this command on ubuntu terminal:
psql -h localhost -U arwinder --password -f sh_cake_db_14_02_13.sql -d new_db
where "arwinder" is user name and "sh_cake_db_14_02_13.sql" is sql dump and "new_db" is database.
then while importing it shows following errors and in postgresql database I don't have all the tables. Tese are the errors:
invalid command \N
invalid command \
invalid command \
ERROR: syntax error at or near "27"
LINE 1: 27 Balaji Angan
There is a convert tool https://github.com/lanyrd/mysql-postgresql-converter ,or you can refer to postgressql's wiki http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL , see MySQL section and check your data types.

Command to uninstall .pkg in solaris server [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
How to uninstall .pkg in solaris?
We have command to install pkgadd -d one.pkg,. Similarly can we have command for uninstall?
There is no direct way as the name of the file containing the package can be anything.
You need to retrieve the package name to be able to remove it.
This can be done with that oneliner (ksh or bash):
# pkgrm $(pkginfo -d one.pkg | nawk '{print $2}')
pkgrm <pkg_name>
To know package name run below command
pkginfo -l <word_in_package_name>

Not able to import sql file onto PostgreSql in windows [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I tried importing a sql file using
psql.exe -U postgres -d development "d:\myprojects\ruby\HelloWorld\db\data.sql".
I get a message
"extra command line arguement d:\myprojects\ruby\HelloWorld\db\data.sql ignored"
Any help on this ?
Either
psql.exe -U postgres -d development < "d:\myprojects\ruby\HelloWorld\db\data.sql"
or
psql.exe -U postgres -d development -f "d:\myprojects\ruby\HelloWorld\db\data.sql"