agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
Create db fails using utility tool
6+ messages / 2 participants
[nested] [flat]

* Create db fails using utility tool
@ 2016-02-04 07:23  Shashank Dutt Jha <shashank.dj@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Shashank Dutt Jha @ 2016-02-04 07:23 UTC (permalink / raw)
  To: pgsql-sql

c:\Program Files\PostgreSQL\9.5\bin>createdb.exe testdb
createdb: could not connect to database template1: could not connect to
server:
Connection refused (0x0000274D/10061)
        Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "localhost" (127.0.0.1) and accepting
        TCP/IP connections on port 5432?

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Create db fails using utility tool
@ 2016-02-04 16:40  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Shashank Dutt Jha <shashank.dj@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Adrian Klaver @ 2016-02-04 16:40 UTC (permalink / raw)
  To: Shashank Dutt Jha <shashank.dj@gmail.com>; pgsql-sql

On 02/03/2016 11:23 PM, Shashank Dutt Jha wrote:
> c:\Program Files\PostgreSQL\9.5\bin>createdb.exe testdb
> createdb: could not connect to database template1: could not connect to
> server:
> Connection refused (0x0000274D/10061)
>          Is the server running on host "localhost" (::1) and accepting
>          TCP/IP connections on port 5432?
> could not connect to server: Connection refused (0x0000274D/10061)
>          Is the server running on host "localhost" (127.0.0.1) and accepting
>          TCP/IP connections on port 5432?
>
>


Well the error is pretty specific, so is the server running and if so 
does it have the parameters set as above?



-- 
Adrian Klaver
adrian.klaver@aklaver.com


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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Create db fails using utility tool
@ 2016-02-04 17:45  Shashank Dutt Jha <shashank.dj@gmail.com>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Shashank Dutt Jha @ 2016-02-04 17:45 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-sql

Yes server is running on the local host and default port. I can connect to it using UI pgsql client



> On Feb 4, 2016, at 10:10 PM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> 
>> On 02/03/2016 11:23 PM, Shashank Dutt Jha wrote:
>> c:\Program Files\PostgreSQL\9.5\bin>createdb.exe testdb
>> createdb: could not connect to database template1: could not connect to
>> server:
>> Connection refused (0x0000274D/10061)
>>         Is the server running on host "localhost" (::1) and accepting
>>         TCP/IP connections on port 5432?
>> could not connect to server: Connection refused (0x0000274D/10061)
>>         Is the server running on host "localhost" (127.0.0.1) and accepting
>>         TCP/IP connections on port 5432?
> 
> 
> Well the error is pretty specific, so is the server running and if so does it have the parameters set as above?
> 
> 
> 
> -- 
> Adrian Klaver
> adrian.klaver@aklaver.com


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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Create db fails using utility tool
@ 2016-02-04 18:04  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Shashank Dutt Jha <shashank.dj@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Adrian Klaver @ 2016-02-04 18:04 UTC (permalink / raw)
  To: Shashank Dutt Jha <shashank.dj@gmail.com>; +Cc: pgsql-sql

On 02/04/2016 09:45 AM, Shashank Dutt Jha wrote:
> Yes server is running on the local host and default port. I can connect to it using UI pgsql client

Do you mean pgAdmin or the SQL shell command?

In either case are you running createdb.exe on the same machine?

What happens if you run createdb.exe with explicit options:

createdb.exe -h localhost -p 5432 -U <some_superuser>

>
>
>
>> On Feb 4, 2016, at 10:10 PM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>>
>>> On 02/03/2016 11:23 PM, Shashank Dutt Jha wrote:
>>> c:\Program Files\PostgreSQL\9.5\bin>createdb.exe testdb
>>> createdb: could not connect to database template1: could not connect to
>>> server:
>>> Connection refused (0x0000274D/10061)
>>>          Is the server running on host "localhost" (::1) and accepting
>>>          TCP/IP connections on port 5432?
>>> could not connect to server: Connection refused (0x0000274D/10061)
>>>          Is the server running on host "localhost" (127.0.0.1) and accepting
>>>          TCP/IP connections on port 5432?
>>
>>
>> Well the error is pretty specific, so is the server running and if so does it have the parameters set as above?
>>
>>
>>
>> --
>> Adrian Klaver
>> adrian.klaver@aklaver.com
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com


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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Create db fails using utility tool
@ 2016-02-05 04:15  Shashank Dutt Jha <shashank.dj@gmail.com>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Shashank Dutt Jha @ 2016-02-05 04:15 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-sql

pgAdmin tool.

Yes running both on same machine.

With explicit options, as suggested, it is able to create db.

Thanks for help



On Thu, Feb 4, 2016 at 11:34 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

> On 02/04/2016 09:45 AM, Shashank Dutt Jha wrote:
>
>> Yes server is running on the local host and default port. I can connect
>> to it using UI pgsql client
>>
>
> Do you mean pgAdmin or the SQL shell command?
>
> In either case are you running createdb.exe on the same machine?
>
> What happens if you run createdb.exe with explicit options:
>
> createdb.exe -h localhost -p 5432 -U <some_superuser>
>
>
>
>>
>>
>> On Feb 4, 2016, at 10:10 PM, Adrian Klaver <adrian.klaver@aklaver.com>
>>> wrote:
>>>
>>> On 02/03/2016 11:23 PM, Shashank Dutt Jha wrote:
>>>> c:\Program Files\PostgreSQL\9.5\bin>createdb.exe testdb
>>>> createdb: could not connect to database template1: could not connect to
>>>> server:
>>>> Connection refused (0x0000274D/10061)
>>>>          Is the server running on host "localhost" (::1) and accepting
>>>>          TCP/IP connections on port 5432?
>>>> could not connect to server: Connection refused (0x0000274D/10061)
>>>>          Is the server running on host "localhost" (127.0.0.1) and
>>>> accepting
>>>>          TCP/IP connections on port 5432?
>>>>
>>>
>>>
>>> Well the error is pretty specific, so is the server running and if so
>>> does it have the parameters set as above?
>>>
>>>
>>>
>>> --
>>> Adrian Klaver
>>> adrian.klaver@aklaver.com
>>>
>>
>>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Create db fails using utility tool
@ 2016-02-05 06:08  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Shashank Dutt Jha <shashank.dj@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Adrian Klaver @ 2016-02-05 06:08 UTC (permalink / raw)
  To: Shashank Dutt Jha <shashank.dj@gmail.com>; +Cc: pgsql-sql

On 02/04/2016 08:15 PM, Shashank Dutt Jha wrote:
> pgAdmin tool.
>
> Yes running both on same machine.
>
> With explicit options, as suggested, it is able to create db.

Probably because this is on Windows. When you run createdb without -h it 
assumes you want to connect to a socket. On Windows that is not possible 
so Postgres substitutes localhost in for the socket. I am not exactly 
how that is done, but I suspect the manner in which is done is causing a 
Windows anti-virus or firewall program to block the connection. FYI, 
createdb is just a command line wrapper around the SQL command CREATE 
DATABASE:

http://www.postgresql.org/docs/9.5/interactive/sql-createdatabase.html

so you can do the same thing in psql or pgAdmin.


>
> Thanks for help
>
>
>
Adrian Klaver
adrian.klaver@aklaver.com


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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2016-02-05 06:08 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-02-04 07:23 Create db fails using utility tool Shashank Dutt Jha <shashank.dj@gmail.com>
2016-02-04 16:40 ` Adrian Klaver <adrian.klaver@aklaver.com>
2016-02-04 17:45   ` Shashank Dutt Jha <shashank.dj@gmail.com>
2016-02-04 18:04     ` Adrian Klaver <adrian.klaver@aklaver.com>
2016-02-05 04:15       ` Shashank Dutt Jha <shashank.dj@gmail.com>
2016-02-05 06:08         ` Adrian Klaver <adrian.klaver@aklaver.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox