How to run query by command prompt in Postgres

Started by Kapil Kr. Khandelwalalmost 14 years ago21 messagesbugs
Jump to latest
#1Kapil Kr. Khandelwal
kapilk@cscape.in

Dear Team

I want to a favour from your side. I want to know, how to run sql query by
command prompt in postgres sql.

I ma waiting for your positive response.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

#2Kapil Kr. Khandelwal
kapilk@cscape.in
In reply to: Kapil Kr. Khandelwal (#1)
Fwd: How to run query by command prompt in Postgres

Dear Team

I want to a favour from your side. I want to know, how to run sql query by
command prompt in postgres sql.

I am waiting for your positive response. Thanks in advance.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

In reply to: Kapil Kr. Khandelwal (#2)
Re: Fwd: How to run query by command prompt in Postgres

On 27/06/2012 12:18, Kapil Kr. Khandelwal wrote:

Dear Team

I want to a favour from your side. I want to know, how to run sql query
by command prompt in postgres sql.

psql -f file-with-query.sql your-database

http://www.postgresql.org/docs/9.1/static/app-psql.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

#4Kapil Kr. Khandelwal
kapilk@cscape.in
In reply to: Raymond O'Donnell (#3)
Re: Fwd: How to run query by command prompt in Postgres

Dear Sir

I want to run sql query, without any file. I have connected the db, but not
getting success run sql query.

I can run by file, if you can provide me steps of this.

Looking forward to positive response from your side. Thanks in advance.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 5:21 PM, Raymond O'Donnell <rod@iol.ie> wrote:

Show quoted text

On 27/06/2012 12:18, Kapil Kr. Khandelwal wrote:

Dear Team

I want to a favour from your side. I want to know, how to run sql query
by command prompt in postgres sql.

psql -f file-with-query.sql your-database

http://www.postgresql.org/docs/9.1/static/app-psql.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

#5Julien Rouhaud
rjuju123@gmail.com
In reply to: Kapil Kr. Khandelwal (#4)
Re: Fwd: How to run query by command prompt in Postgres

Le 27 juin 2012 à 14:06, "Kapil Kr. Khandelwal" <kapilk@cscape.in> a écrit :

Dear Sir

I want to run sql query, without any file. I have connected the db, but not
getting success run sql query.

Did you end your input with a ;
Without it, pressing return will just add another line to your query

I can run by file, if you can provide me steps of this.

Looking forward to positive response from your side. Thanks in advance.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 5:21 PM, Raymond O'Donnell <rod@iol.ie> wrote:

Show quoted text

On 27/06/2012 12:18, Kapil Kr. Khandelwal wrote:

Dear Team

I want to a favour from your side. I want to know, how to run sql query
by command prompt in postgres sql.

psql -f file-with-query.sql your-database

http://www.postgresql.org/docs/9.1/static/app-psql.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

#6Kapil Kr. Khandelwal
kapilk@cscape.in
In reply to: Julien Rouhaud (#5)
Re: Fwd: How to run query by command prompt in Postgres

Thanks to your prompt support...It really helpful for me.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 5:41 PM, Julien Rouhaud <rjuju123@gmail.com> wrote:

Show quoted text

Le 27 juin 2012 à 14:06, "Kapil Kr. Khandelwal" <kapilk@cscape.in> a
écrit :

Dear Sir

I want to run sql query, without any file. I have connected the db, but
not getting success run sql query.

Did you end your input with a ;
Without it, pressing return will just add another line to your query

I can run by file, if you can provide me steps of this.

Looking forward to positive response from your side. Thanks in advance.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 5:21 PM, Raymond O'Donnell < <rod@iol.ie>
rod@iol.ie> wrote:

On 27/06/2012 12:18, Kapil Kr. Khandelwal wrote:

Dear Team

I want to a favour from your side. I want to know, how to run sql query
by command prompt in postgres sql.

psql -f file-with-query.sql your-database

<http://www.postgresql.org/docs/9.1/static/app-psql.html&gt;
http://www.postgresql.org/docs/9.1/static/app-psql.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
<rod@iol.ie>rod@iol.ie

#7Chris Browne
cbbrowne@acm.org
In reply to: Kapil Kr. Khandelwal (#1)
Re: How to run query by command prompt in Postgres

On Wed, Jun 27, 2012 at 7:15 AM, Kapil Kr. Khandelwal <kapilk@cscape.in> wrote:

I want to a favour from your side. I want to know, how to run sql query by
command prompt in postgres sql.

This doesn't sound like a bug, and this mailing list is intended to
capture bugs discovered in Postgres.

Perhaps you should avail yourself of the documentation. The following
links seem as though they may be relevant:

http://www.postgresql.org/docs/9.1/static/tutorial-accessdb.html
http://www.postgresql.org/docs/9.1/static/app-psql.html
--
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"

#8Kapil Kr. Khandelwal
kapilk@cscape.in
In reply to: Chris Browne (#7)
Re: How to run query by command prompt in Postgres

Dear Sir

Thanks for your response. My problem has solved.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 8:30 PM, Christopher Browne <cbbrowne@gmail.com>wrote:

Show quoted text

On Wed, Jun 27, 2012 at 7:15 AM, Kapil Kr. Khandelwal <kapilk@cscape.in>
wrote:

I want to a favour from your side. I want to know, how to run sql query

by

command prompt in postgres sql.

This doesn't sound like a bug, and this mailing list is intended to
capture bugs discovered in Postgres.

Perhaps you should avail yourself of the documentation. The following
links seem as though they may be relevant:

http://www.postgresql.org/docs/9.1/static/tutorial-accessdb.html
http://www.postgresql.org/docs/9.1/static/app-psql.html
--
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"

#9Craig Ringer
craig@2ndquadrant.com
In reply to: Kapil Kr. Khandelwal (#1)
Re: How to run query by command prompt in Postgres

On 06/27/2012 07:15 PM, Kapil Kr. Khandelwal wrote:

Dear Team

I want to a favour from your side. I want to know, how to run sql
query by command prompt in postgres sql.

psql

http://www.postgresql.org/docs/9.1/static/app-psql.html

--
Craig Ringer

#10Kapil Kr. Khandelwal
kapilk@cscape.in
In reply to: Kapil Kr. Khandelwal (#1)
Re: How to run query by command prompt in Postgres

Dear Team

When I restarted the postgres9.0 service by windows then getting following
error message. Plz help me.

*Error Message(Error 1053) : The service did not respond start or control
requested in timely fashion. *
*
*
Please suggest me. Thanks in advance.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 4:45 PM, Kapil Kr. Khandelwal <kapilk@cscape.in>wrote:

Show quoted text

Dear Team

I want to a favour from your side. I want to know, how to run sql query by
command prompt in postgres sql.

I ma waiting for your positive response.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

#11Kapil Kr. Khandelwal
kapilk@cscape.in
In reply to: Raymond O'Donnell (#3)
Re: Fwd: How to run query by command prompt in Postgres

Dear Team

When I restarted the postgres9.0 service by windows then getting following
error message. Plz help me.

*Error Message(Error 1053) : The service did not respond start or control
requested in timely fashion. *
*
*
Please suggest me. Thanks in advance.
Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 5:21 PM, Raymond O'Donnell <rod@iol.ie> wrote:

Show quoted text

On 27/06/2012 12:18, Kapil Kr. Khandelwal wrote:

Dear Team

I want to a favour from your side. I want to know, how to run sql query
by command prompt in postgres sql.

psql -f file-with-query.sql your-database

http://www.postgresql.org/docs/9.1/static/app-psql.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

#12Kapil Kr. Khandelwal
kapilk@cscape.in
In reply to: Julien Rouhaud (#5)
Re: Fwd: How to run query by command prompt in Postgres

Dear Team

When I restarted the postgres9.0 service by windows then getting following
error message. Plz help me.

*Error Message(Error 1053) : The service did not respond start or control
requested in timely fashion. *
*
*
Please suggest me. Thanks in advance.
Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 5:41 PM, Julien Rouhaud <rjuju123@gmail.com> wrote:

Show quoted text

Le 27 juin 2012 à 14:06, "Kapil Kr. Khandelwal" <kapilk@cscape.in> a
écrit :

Dear Sir

I want to run sql query, without any file. I have connected the db, but
not getting success run sql query.

Did you end your input with a ;
Without it, pressing return will just add another line to your query

I can run by file, if you can provide me steps of this.

Looking forward to positive response from your side. Thanks in advance.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 5:21 PM, Raymond O'Donnell < <rod@iol.ie>
rod@iol.ie> wrote:

On 27/06/2012 12:18, Kapil Kr. Khandelwal wrote:

Dear Team

I want to a favour from your side. I want to know, how to run sql query
by command prompt in postgres sql.

psql -f file-with-query.sql your-database

<http://www.postgresql.org/docs/9.1/static/app-psql.html&gt;
http://www.postgresql.org/docs/9.1/static/app-psql.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
<rod@iol.ie>rod@iol.ie

#13Julien Rouhaud
rjuju123@gmail.com
In reply to: Kapil Kr. Khandelwal (#11)
Re: Fwd: How to run query by command prompt in Postgres

On Thu, Jun 28, 2012 at 8:56 AM, Kapil Kr. Khandelwal <kapilk@cscape.in>wrote:

Dear Team

When I restarted the postgres9.0 service by windows then getting following
error message. Plz help me.

*Error Message(Error 1053) : The service did not respond start or
control requested in timely fashion. *
*
*

You should have in "event viewer" -> "application" logs about your service
error. Please post event related to you postgresql service so we can help
you.

**

Show quoted text

Please suggest me. Thanks in advance.
Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 5:21 PM, Raymond O'Donnell <rod@iol.ie> wrote:

On 27/06/2012 12:18, Kapil Kr. Khandelwal wrote:

Dear Team

I want to a favour from your side. I want to know, how to run sql query
by command prompt in postgres sql.

psql -f file-with-query.sql your-database

http://www.postgresql.org/docs/9.1/static/app-psql.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

#14Daniel Farina
daniel@heroku.com
In reply to: Kapil Kr. Khandelwal (#1)
Re: How to run query by command prompt in Postgres

On Jun 28, 2012 7:44 AM, "Kapil Kr. Khandelwal" <kapilk@cscape.in> wrote:

Dear Team

When I restarted the postgres9.0 service by windows then getting

following error message. Plz help me.

Error Message(Error 1053) : The service did not respond start or control

requested in timely fashion.

Please suggest me. Thanks in advance

Please post general requests for help in pgsql-general or pgsql-novice. If
the cause of this problem is obscure and looks like a bug, then it would be
appropriate to post it here.

This list is for tracking clear and precise defects in Postgres. Please do
not discuss other things here.

#15Kapil Kr. Khandelwal
kapilk@cscape.in
In reply to: Raymond O'Donnell (#3)
Re: Fwd: How to run query by command prompt in Postgres

Dear Team

I want to a favor from your side. I want to implement clustering in
postgressql 8.x on Windows OS. I have completed till archive command. I am
getting archive files. After that, I am facing issues. Kindly explain more
steps.

Thanks in Advance. Looking forward to hearing from you.

Regards
Kapil Kr. Khandelwal
CodeScape Consultant Pvt Ltd
+91 969 417 9109
+91 141 400 2993
www.codescape.in

On Wed, Jun 27, 2012 at 5:21 PM, Raymond O'Donnell <rod@iol.ie> wrote:

Show quoted text

On 27/06/2012 12:18, Kapil Kr. Khandelwal wrote:

Dear Team

I want to a favour from your side. I want to know, how to run sql query
by command prompt in postgres sql.

psql -f file-with-query.sql your-database

http://www.postgresql.org/docs/9.1/static/app-psql.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

#16Kapil Kr. Khandelwal
kapilk@cscape.in
In reply to: Julien Rouhaud (#13)
Re: Fwd: How to run query by command prompt in Postgres

Dear Team

I want to a favor from your side. I want to implement clustering in
postgressql 8.x on Windows OS. I have completed till archive command. I am
getting archive files. After that, I am facing issues. Kindly explain more
steps.

Thanks in Advance. Looking forward to hearing from you.

Regards
Kapil Kr. Khandelwal
CodeScape Consultant Pvt Ltd
+91 969 417 9109
+91 141 400 2993
www.codescape.in

On Thu, Jun 28, 2012 at 8:27 PM, Julien Rouhaud <rjuju123@gmail.com> wrote:

Show quoted text

On Thu, Jun 28, 2012 at 8:56 AM, Kapil Kr. Khandelwal <kapilk@cscape.in>wrote:

Dear Team

When I restarted the postgres9.0 service by windows then getting
following error message. Plz help me.

*Error Message(Error 1053) : The service did not respond start or
control requested in timely fashion. *
*
*

You should have in "event viewer" -> "application" logs about your service
error. Please post event related to you postgresql service so we can help
you.

**

Please suggest me. Thanks in advance.
Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 5:21 PM, Raymond O'Donnell <rod@iol.ie> wrote:

On 27/06/2012 12:18, Kapil Kr. Khandelwal wrote:

Dear Team

I want to a favour from your side. I want to know, how to run sql query
by command prompt in postgres sql.

psql -f file-with-query.sql your-database

http://www.postgresql.org/docs/9.1/static/app-psql.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

#17Kapil Kr. Khandelwal
kapilk@cscape.in
In reply to: Kapil Kr. Khandelwal (#2)
Re: How to run query by command prompt in Postgres

Dear Team

I want to a favour from your side. I want to implement clustering in
postgres on windows server. Please provide the list of steps. I want the
answers of followings doubts.

1. How to write archive command
2. How to log shipping from primary to stand by server
3. how to restore database at stand by server from archived files

I am waiting for your positive response. Thanks in advance.

Regards
Kapil Kr. Khandelwal
CodeScape Consultant Pvt Ltd
+91 969 417 9109
+91 141 400 2993
www.codescape.in

*Think before printing. Turn off Systems before leaving. Conserve Energy,
Save our Environment.*

On Wed, Jun 27, 2012 at 4:48 PM, Kapil Kr. Khandelwal <kapilk@cscape.in>wrote:

Show quoted text

Dear Team

I want to a favour from your side. I want to know, how to run sql query by
command prompt in postgres sql.

I am waiting for your positive response. Thanks in advance.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

#18Kapil Kr. Khandelwal
kapilk@cscape.in
In reply to: Kapil Kr. Khandelwal (#4)
Re: Fwd: How to run query by command prompt in Postgres

Dear Team

I want to a favour from your side. I want to implement clustering in
postgres on windows server. Please provide the list of steps. I want the
answers of followings doubts.

1. How to write archive command
2. How to log shipping from primary to stand by server
3. how to restore database at stand by server from archived files

I am waiting for your positive response. Thanks in advance.

Regards
Kapil Kr. Khandelwal
CodeScape Consultant Pvt Ltd
+91 969 417 9109
+91 141 400 2993
www.codescape.in

*Think before printing. Turn off Systems before leaving. Conserve Energy,
Save our Environment.*

On Wed, Jun 27, 2012 at 5:29 PM, Kapil Kr. Khandelwal <kapilk@cscape.in>wrote:

Show quoted text

Dear Sir

I want to run sql query, without any file. I have connected the db, but
not getting success run sql query.

I can run by file, if you can provide me steps of this.

Looking forward to positive response from your side. Thanks in advance.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 5:21 PM, Raymond O'Donnell <rod@iol.ie> wrote:

On 27/06/2012 12:18, Kapil Kr. Khandelwal wrote:

Dear Team

I want to a favour from your side. I want to know, how to run sql query
by command prompt in postgres sql.

psql -f file-with-query.sql your-database

http://www.postgresql.org/docs/9.1/static/app-psql.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

#19Kapil Kr. Khandelwal
kapilk@cscape.in
In reply to: Kapil Kr. Khandelwal (#8)
Re: How to run query by command prompt in Postgres

Dear Team

I want to a favour from your side. I want to implement clustering in
postgres on windows server. Please provide the list of steps. I want the
answers of followings doubts.

1. How to write archive command
2. How to log shipping from primary to stand by server
3. how to restore database at stand by server from archived files

I am waiting for your positive response. Thanks in advance.

Regards
Kapil Kr. Khandelwal
CodeScape Consultant Pvt Ltd
+91 969 417 9109
+91 141 400 2993
www.codescape.in

*Think before printing. Turn off Systems before leaving. Conserve Energy,
Save our Environment.*

On Wed, Jun 27, 2012 at 9:10 PM, Kapil Kr. Khandelwal <kapilk@cscape.in>wrote:

Show quoted text

Dear Sir

Thanks for your response. My problem has solved.

Thanks & Regards

Kapil Kr. Khandelwal
M: 09694179109
CodeScape Consultants, Jaipur

On Wed, Jun 27, 2012 at 8:30 PM, Christopher Browne <cbbrowne@gmail.com>wrote:

On Wed, Jun 27, 2012 at 7:15 AM, Kapil Kr. Khandelwal <kapilk@cscape.in>
wrote:

I want to a favour from your side. I want to know, how to run sql query

by

command prompt in postgres sql.

This doesn't sound like a bug, and this mailing list is intended to
capture bugs discovered in Postgres.

Perhaps you should avail yourself of the documentation. The following
links seem as though they may be relevant:

http://www.postgresql.org/docs/9.1/static/tutorial-accessdb.html
http://www.postgresql.org/docs/9.1/static/app-psql.html
--
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"

#20Chris Browne
cbbrowne@acm.org
In reply to: Kapil Kr. Khandelwal (#19)
Re: How to run query by command prompt in Postgres

On Wed, Mar 20, 2013 at 8:22 AM, Kapil Kr. Khandelwal <kapilk@cscape.in> wrote:

Dear Team

I want to a favour from your side. I want to implement clustering in
postgres on windows server. Please provide the list of steps. I want the
answers of followings doubts.

1. How to write archive command
2. How to log shipping from primary to stand by server
3. how to restore database at stand by server from archived files

I am waiting for your positive response. Thanks in advance.

Again, these do not sound like they are bugs in PostgreSQL that
should be reported here.

They could indicate bugs in the documentation if the documentation was
specifically deficient, but it is not evident that you have reviewed the
documentation, as I would expect different "doubts."

I don't know what version of PostgreSQL you are using; if you were
running 9.2, then the following might be relevant documentation:
<http://www.postgresql.org/docs/9.2/static/continuous-archiving.html&gt;

That seems to describe the things you seem to be asking about.
If it is, then you should avail yourself of the documentation.

It is decidedly not a bug in PostgreSQL for you to fail to read the
documentation, and you should not report such things on this
mailing list.
--
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#21Craig Ringer
craig@2ndquadrant.com
In reply to: Kapil Kr. Khandelwal (#18)