Thread: cygwin and postgresql
This may not be the right place for this question but I am going to start here anyway. I have installed postgresql in cygwin on a MS-WinXPpro system. I wish to initialise a database instance. However, I cannot find any program file called initdb. In /usr/bin I can see files like: pg_config.exe, pg_dump.exe and pg_dumpall.exe but no initdb.exe anywhere. Is there something about initdb that I do not understand or some reason why it would not form part of the cygwin installation? -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB@Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
"James B. Byrne" <byrnejb@harte-lyne.ca> writes: > I have installed postgresql in cygwin on a MS-WinXPpro system. I > wish to initialise a database instance. However, I cannot find any > program file called initdb. In /usr/bin I can see files like: > pg_config.exe, pg_dump.exe and pg_dumpall.exe but no initdb.exe > anywhere. Is there something about initdb that I do not understand > or some reason why it would not form part of the cygwin > installation? That sounds suspiciously like a client-only installation. What package did you install exactly? Was there a -server package beside it? regards, tom lane
On Sun, June 14, 2009 13:34, Tom Lane wrote: > > That sounds suspiciously like a client-only installation. What > package did you install exactly? Was there a -server package > beside it? The packages that cygwin says I have installed are: 8.2.11-1 postgresql: PostgreSQL Data Base Management System 3,707k 8.2.11-1 postgresql-client: Front-end programs for PostgreSQL 8.x 972k 8.2.11-1 postgresql-contrib ... 373k 8.2.11-1 postgresql-devel: ... server side programs 488k 8.2.11-1 postgresql-doc 8.2.11-1 postgresql-plperl and that is all. There is not a package listed with "-server" in it. -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB@Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
"James B. Byrne" <byrnejb@harte-lyne.ca> writes: > The packages that cygwin says I have installed are: > 8.2.11-1 postgresql: PostgreSQL Data Base Management System 3,707k > 8.2.11-1 postgresql-client: Front-end programs for PostgreSQL 8.x 972k > 8.2.11-1 postgresql-contrib ... 373k > 8.2.11-1 postgresql-devel: ... server side programs 488k > 8.2.11-1 postgresql-doc > 8.2.11-1 postgresql-plperl > and that is all. > There is not a package listed with "-server" in it. Well, I don't know whose package set this is, but I'd bet there was supposed to be a -server package there too. That core package looks too small to include the server. regards, tom lane
On Sun, Jun 14, 2009 at 11:30 AM, James B. Byrne<byrnejb@harte-lyne.ca> wrote: > This may not be the right place for this question but I am going to > start here anyway. > > I have installed postgresql in cygwin on a MS-WinXPpro system. I > wish to initialise a database instance. However, I cannot find any > program file called initdb. In /usr/bin I can see files like: > pg_config.exe, pg_dump.exe and pg_dumpall.exe but no initdb.exe > anywhere. Is there something about initdb that I do not understand > or some reason why it would not form part of the cygwin > installation? Is there a reason you're not using the native windows postgresql packages?
On Sun, June 14, 2009 15:45, Scott Marlowe wrote: why it would not form part of the cygwin >> installation? > > Is there a reason you're not using the native windows postgresql > packages? > Because for some reason, processes running in the cygwin environment could not create databases in the postgresql instance running in windows. As I develop for Linux and use cygwin to (mostly) replicate that environment on my MS-Win laptop I thought that moving everything having to do with the development environment under cygwin would be best. -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB@Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
Found it. The cygwin executables for postgres are installed under /usr/sbin, which is NOT in the PATH thus the problem, and the obvious solution. -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB@Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
On 2009-06-14, James B. Byrne <byrnejb@harte-lyne.ca> wrote: > > On Sun, June 14, 2009 15:45, Scott Marlowe wrote: > why it would not form part of the cygwin >>> installation? >> >> Is there a reason you're not using the native windows postgresql >> packages? >> > > Because for some reason, processes running in the cygwin environment > could not create databases in the postgresql instance running in > windows. that's odd, were you specifying host=localhost, if not it may be that the cygwin processes were trying to use local sockets. (oner difference of the native windows postgres to linux is no local sockets) > As I develop for Linux and use cygwin to (mostly) > replicate that environment on my MS-Win laptop I thought that moving > everything having to do with the development environment under > cygwin would be best. I develop for windows on a linux desktop (exact opposite of what you do!)
On: 15 Jun 2009 12:08:22 GMT, Jasen Betts <jasen@xnet.co.nz> > > On Sun, June 14, 2009 15:45, Scott Marlowe wrote: >> >> Is there a reason you're not using the native windows postgresql >> packages? >> > > Because for some reason, processes running in the cygwin environment > could not create databases in the postgresql instance running in > windows. that's odd, were you specifying host=localhost, if not it may be that the cygwin processes were trying to use local sockets. (oner difference of the native windows postgres to linux is no local sockets) The cygwin processes had no trouble connecting to and operating on existing databases. They could even drop a database. They just could not recreate one after dropping it. As the database in question is the one used for integration testing and as it gets dropped and recreated on the fly at various points in the test suite this was a major annoyance. It could very well be that this behaviour is caused by some other issue but I have a nagging suspicion that NTFS security issues are at the root of it. As I have no other need to access pgsql on my laptop, I thought it best to bring everything under one roof, so to speak, and begin checking things out from that initial point. -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB@Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
On Mon, Jun 15, 2009 at 8:22 AM, James B. Byrne<byrnejb@harte-lyne.ca> wrote: > On: 15 Jun 2009 12:08:22 GMT, Jasen Betts <jasen@xnet.co.nz> >> >> On Sun, June 14, 2009 15:45, Scott Marlowe wrote: >>> >>> Is there a reason you're not using the native windows postgresql >>> packages? >>> >> >> Because for some reason, processes running in the cygwin environment >> could not create databases in the postgresql instance running in >> windows. > > that's odd, were you specifying host=localhost, if not it may be > that the cygwin processes were trying to use local sockets. > (oner difference of the native windows postgres to linux is no local > sockets) > > The cygwin processes had no trouble connecting to and operating on > existing databases. They could even drop a database. They just > could not recreate one after dropping it. As the database in > question is the one used for integration testing and as it gets > dropped and recreated on the fly at various points in the test suite > this was a major annoyance. > > It could very well be that this behaviour is caused by some other > issue but I have a nagging suspicion that NTFS security issues are > at the root of it. As I have no other need to access pgsql on my > laptop, I thought it best to bring everything under one roof, so to > speak, and begin checking things out from that initial point. So, for sure something like: alter user dbuser with createdb; didn't fix the problem?
On Mon, June 15, 2009 13:02, Scott Marlowe wrote: > > So, for sure something like: > > alter user dbuser with createdb; > > didn't fix the problem? > I have removed the windows installation and can no longer check this. I maintained the pg roles via pgadmin3 and, to the best of my ability to recollect, the owner of the development and test databases had dbcreate privileges. If the problem persists under the cygwin environment then I will revisit the native pg installation for testing. -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB@Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3