public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* postgresql - Cannot initialize new Postgres database on Cygwin - Super User
@ 2017-01-11 22:02 Chloe
  2017-01-12 12:10 ` Marco Atzeri
  0 siblings, 1 reply; 2+ messages in thread
From: Chloe @ 2017-01-11 22:02 UTC (permalink / raw)
  To: cygwin

When I try to initialize a new database, I get an error:

    $ /usr/sbin/pg_ctl init
    no data was returned by command ""/usr/sbin/initdb.exe" -V"
    The program "initdb" is needed by pg_ctl but was not found in the
    same directory as "/usr/sbin/pg_ctl".
    Check your installation.
   
    $ /usr/sbin/initdb.exe -V
    initdb (PostgreSQL) 9.6.1
   
    $ "/usr/sbin/initdb.exe" -V
    initdb (PostgreSQL) 9.6.1
   
    $ /usr/sbin/initdb.exe -D /usr/share/postgresql
    no data was returned by command ""/usr/sbin/postgres.exe" -V"
    The program "postgres" is needed by initdb but was not found in the
    same directory as "/usr/sbin/initdb".
    Check your installation.
   
    $ /usr/sbin/postgres -V
    postgres (PostgreSQL) 9.6.1

Cygwin 2.6.1, Postgres 9.6.1


http://superuser.com/questions/1166177/cannot-initialize-new-postgres-database-on-cygwin


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: postgresql - Cannot initialize new Postgres database on Cygwin - Super User
  2017-01-11 22:02 postgresql - Cannot initialize new Postgres database on Cygwin - Super User Chloe
@ 2017-01-12 12:10 ` Marco Atzeri
  0 siblings, 0 replies; 2+ messages in thread
From: Marco Atzeri @ 2017-01-12 12:10 UTC (permalink / raw)
  To: cygwin

On 11/01/2017 23:02, Chloe wrote:
> When I try to initialize a new database, I get an error:
>
>     $ /usr/sbin/pg_ctl init
>     no data was returned by command ""/usr/sbin/initdb.exe" -V"
>     The program "initdb" is needed by pg_ctl but was not found in the
>     same directory as "/usr/sbin/pg_ctl".
>     Check your installation.
>
>     $ /usr/sbin/initdb.exe -V
>     initdb (PostgreSQL) 9.6.1
>
>     $ "/usr/sbin/initdb.exe" -V
>     initdb (PostgreSQL) 9.6.1
>
>     $ /usr/sbin/initdb.exe -D /usr/share/postgresql
>     no data was returned by command ""/usr/sbin/postgres.exe" -V"
>     The program "postgres" is needed by initdb but was not found in the
>     same directory as "/usr/sbin/initdb".
>     Check your installation.
>
>     $ /usr/sbin/postgres -V
>     postgres (PostgreSQL) 9.6.1
>
> Cygwin 2.6.1, Postgres 9.6.1
>
>
> http://superuser.com/questions/1166177/cannot-initialize-new-postgres-database-on-cygwin
>

Inizialization works for me

$ cygrunsrv -S cygserver

$ /usr/sbin/initdb -D /usr/local/pgsql/data
The files belonging to this database system will be owned by user "marco".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 30
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... sysv
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

     pg_ctl -D /usr/local/pgsql/data -l logfile start

$ pg_ctl -D /usr/local/pgsql/data -l logfile start
server starting

$ psql -l
                               List of databases
    Name    | Owner | Encoding |   Collate   |    Ctype    | Access 
privileges
-----------+-------+----------+-------------+-------------+-------------------
  postgres  | marco | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
  template0 | marco | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/marco 
      +
            |       |          |             |             | marco=CTc/marco
  template1 | marco | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/marco 
      +
            |       |          |             |             | marco=CTc/marco
(3 rows)


can you provide your cygcheck.out ?
https://www.cygwin.com/problems.html

Regards
Marco





--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2017-01-12 12:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-11 22:02 postgresql - Cannot initialize new Postgres database on Cygwin - Super User Chloe
2017-01-12 12:10 ` Marco Atzeri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).