Thread: Fwd: How to run query by command prompt in Postgres

Fwd: How to run query by command prompt in Postgres

From
"Kapil Kr. Khandelwal"
Date:


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


Re: Fwd: How to run query by command prompt in Postgres

From
Raymond O'Donnell
Date:
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




Re: Fwd: How to run query by command prompt in Postgres

From
"Kapil Kr. Khandelwal"
Date:
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



Re: Fwd: How to run query by command prompt in Postgres

From
Julien Rouhaud
Date:
Le 27 juin 2012 =E0 14:06, "Kapil Kr. Khandelwal" <kapilk@cscape.in> a =E9c=
rit :

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:

> 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
>
>
>

Re: Fwd: How to run query by command prompt in Postgres

From
"Kapil Kr. Khandelwal"
Date:
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:


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:
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




Re: Fwd: How to run query by command prompt in Postgres

From
Julien Rouhaud
Date:


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:
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



Re: Fwd: How to run query by command prompt in Postgres

From
"Kapil Kr. Khandelwal"
Date:
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:
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



Re: Fwd: How to run query by command prompt in Postgres

From
"Kapil Kr. Khandelwal"
Date:
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:


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:
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




Re: Fwd: How to run query by command prompt in Postgres

From
Julien Rouhaud
Date:


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




Re: Fwd: How to run query by command prompt in Postgres

From
"Kapil Kr. Khandelwal"
Date:
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:
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



Re: Fwd: How to run query by command prompt in Postgres

From
"Kapil Kr. Khandelwal"
Date:
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:


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





Re: How to run query by command prompt in Postgres

From
"Kapil Kr. Khandelwal"
Date:
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:


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



Re: Fwd: How to run query by command prompt in Postgres

From
"Kapil Kr. Khandelwal"
Date:
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:
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




Re: Fwd: How to run query by command prompt in Postgres

From
Craig Ringer
Date:
<div class="moz-cite-prefix">On 03/20/2013 08:21 PM, Kapil Kr. Khandelwal wrote:<br /></div><blockquote
cite="mid:CAMDMQnBfyhzvua-j=FeKJvh7jpOBf2w+Quwo=CU5746tPs5HXA@mail.gmail.com"type="cite"><div dir="ltr"><span
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">DearTeam</span><div
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br/></div><div
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">I want to a favour from your side. I want to
implementclustering in postgres on windows server.  Please provide the list of steps. I want the  answers of followings
doubts. </div><divstyle="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br /></div><div
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">1.How to write archive command<br
/></div></div></blockquote><a
href="http://www.postgresql.org/docs/9.2/static/runtime-config-wal.html#GUC-ARCHIVE-COMMAND">http://www.postgresql.org/docs/current/static/runtime-config-wal.html#GUC-ARCHIVE-COMMAND</a><br
/><br/> The cmd.exe "copy" command is one option. Any  Windows command that'll do what you want and doesn't require
userinteraction can be invoked there, including custom-written scripts in vbscript, Python, Perl, etc. If in doubt, ask
Googlehow do do what you want.<br /><blockquote
cite="mid:CAMDMQnBfyhzvua-j=FeKJvh7jpOBf2w+Quwo=CU5746tPs5HXA@mail.gmail.com"type="cite"><div dir="ltr"><div
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">2.How to log shipping from primary to stand by
server</div></div></blockquote><a
href="http://www.postgresql.org/docs/9.2/static/warm-standby.html">http://www.postgresql.org/docs/current/static/warm-standby.html</a><blockquote
cite="mid:CAMDMQnBfyhzvua-j=FeKJvh7jpOBf2w+Quwo=CU5746tPs5HXA@mail.gmail.com"type="cite"><div dir="ltr"><div
style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">3.how to restore database at stand by server
fromarchived files<br /></div></div></blockquote> Also in <a
href="http://www.postgresql.org/docs/9.2/static/warm-standby.html">http://www.postgresql.org/docs/current/static/warm-standby.html</a><br
/><br/> If you're having trouble understanding something in the documentation please explain what you've already tried,
whereyou're getting stuck, and the SPECIFIC problem you're having in a post to the pgsql-general mailing list.<br /><br
/><preclass="moz-signature" cols="72">-- Craig Ringer                   <a class="moz-txt-link-freetext"
href="http://www.2ndQuadrant.com/">http://www.2ndQuadrant.com/</a>PostgreSQLDevelopment, 24x7 Support, Training &
Services</pre>