SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 33
  1. #1
    ********* Articles ArticleBot's Avatar
    Join Date
    Apr 2001
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Discussion thread for Use PostgreSQL and PHP on Windows

    This is a dedicated thread for discussing the SitePoint article 'Use PostgreSQL and PHP on Windows'

  2. #2
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After looking at various other tutorials for getting PostgreSQL working under Win98SE I thought "Not another tutorial huh ?"

    Anyways, views aside I read on and thinking that this tutorial was a bit more indepth that the others I read, I reinstalled cygwin again [4th time] and continued...

    Well, here is what I got once I clicked on the setup.exe file

    Explicits have been removed so not to cause offence

    Quote:

    "Copying skeleton files.
    These files are for the user to personalise
    their cygwin experience.

    These will never be overwritten.

    `./.bash_profile' -> `/home/Docter//.bash_profile'
    `./.bashrc' -> `/home/Docter//.bashrc'
    `./.inputrc' -> `/home/Docter//.inputrc'
    $ ipc-daemon2 --install-as-service
    $ net user developer groovy /add
    The command USER is unknown. For a list of valid commands, type NET HELP at
    the command prompt.
    For help, type NET /? at the command prompt.
    $"

    Umm... Doesn't look too good does it ? Maybe someone who follows through with this tutorial and has some thoughts on the matter ?

    Ideas and solutions are most welcome folks

    Apart from that though, good article btw; more indepth that a lot of other's I've read recently

  3. #3
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Get pgsql working on Win9x/ME?
    Quote Originally Posted by postgresql-7.3.4.README
    1. Start the cygipc ipc-daemon2:
    $ ipc-daemon2 &
    2. Initialize PostgreSQL:
    $ initdb -D /usr/share/postgresql/data
    3. Start the PostgreSQL postmaster:
    $ postmaster -D /usr/share/postgresql/data &
    4. Connect to PostgreSQL:
    $ psql template1
    I guess it's quite impossible to use the NT services installation procedure on Wintendo95 & Co

  4. #4
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jofa -

    All Okay upto this point...

    $ postmaster -D /usr/share/postgresql/data
    postmaster does not find the database system.
    Expected to find it in the PGDATA directory "/usr/share/postgresql/data",
    but unable to open file "/usr/share/postgresql/data/global/pg_control": No such
    file or directory
    This part I can understand ? The variable required, ie PGDATA [and it's sister variables] all belong to WinNT/Pro2000

    (Which I've had PostgreSQL running under that OS for a while - before my machine crashed and I reinstalled Win98SE;

    Unable in re-install Win2000Pro as I forgot to format that partition; ie D:

    Would need to format C: and repeat again which I'm not prepared to do)

    Anyways, Win98SE doesn't have this variable thus I got the above error message;

    Any ideas on this though ? The first steps have got me further than what the said article stipulates

    Thanks btw.

    --EDIT--

    $ ipc-daemon2 &
    [1] 573193
    $ initdb -D /usr/share/postgresql/data
    The files belonging to this database system will be owned by user "Docter".
    This user must also own the server process.

    The database cluster will be initialized with locale C.

    initdb: The directory /usr/share/postgresql/data exists but is not empty.
    If you want to create a new database system, either remove or empty
    the directory /usr/share/postgresql/data or run initdb with
    an argument other than /usr/share/postgresql/data.
    [1]+ Done ipc-daemon2
    $ postmaster -D /usr/share/postgresql/data &
    [1] 461553
    $ postmaster does not find the database system.
    Expected to find it in the PGDATA directory "/usr/share/postgresql/data",
    but unable to open file "/usr/share/postgresql/data/global/pg_control": No such
    file or directory
    Umm.... Still looking
    Last edited by Dr Livingston; Oct 15, 2003 at 11:59.

  5. #5
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Finally ?

    Fixing permissions on existing directory /usr/share/postgresql/data.
    creating directory /usr/share/postgresql/data/base... ok
    creating directory /usr/share/postgresql/data/global... ok
    creating directory /usr/share/postgresql/data/pg_xlog... ok
    creating directory /usr/share/postgresql/data/pg_clog... ok
    creating template1 database in /usr/share/postgresql/data/base/1...
    creating configuration files... ok
    initializing pg_shadow... ok
    enabling unlimited row size for system tables... ok
    initializing pg_depend... ok
    creating system views... ok
    loading pg_description... ok
    creating conversions... ok
    setting privileges on built-in objects... ok
    vacuuming database template1... ok
    copying template1 to template0... ok

    Success. You can now start the database server using:

    /usr/bin/postmaster -D /usr/share/postgresql/data
    or
    /usr/bin/pg_ctl -D /usr/share/postgresql/data -l logfile start



    [2]+ Exit 1 postmaster -D /usr/share/postgresql/data
    $ psql template1
    Welcome to psql 7.3.4, the PostgreSQL interactive terminal.

    Type: \copyright for distribution terms
    \h for help with SQL commands
    \? for help on internal slash commands
    \g or terminate with semicolon to execute query
    \q to quit

    template1=#
    I'm good to go yes ?

  6. #6
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Start your newly-installed Cygwin Bash Shell and complete these steps:
    Install ipc-daemon2 as an NT service
    As you remember from the Cygwin installation, Cygipc is the interprocess communication daemon that PostgreSQL depends on.
    ipc-daemon2 --install-as-service


    bash: /etc/profile: Permission denied
    bash-2.05b$ ipc-daemon2 --install-as-service
    bash: ipc-daemon2: command not found
    bash-2.05b$

    Is what i get. Anyone care to offer their greatly appreciated wisdom?

  7. #7
    Anonymous
    SitePoint Community Guest
    The PostgreSQL Global Development group has pushed back native windows support until 7.5, due out sometime in 2004. For more information about current windows options, check out: http://techdocs.postgresql.org/guides/Windows

    If you would like to help with PostgreSQL win32 development, there is a status page available at:
    http://candle.pha.pa.us/main/writings/pgsql/win32.html

  8. #8
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sn2
    ...Permission denied...
    My guess: Insufficient permissions?

  9. #9
    Anonymous
    SitePoint Community Guest
    Postgres installs fine on windows without cygwin, why go to the extra trouble?

  10. #10
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure though from what I remember of what documentation I'd read (PeerDirect) you need to be the owner yes ?

    In Win2000 for example, this'd be the Administrator, though sorry I'm not sure of Win98SE though;

    On my version whenever I now initialise a database I get a message saying that the user *myself* owns the database etc ?

    Not sure myself, since I've only just begun to use Postgre myself

    Sorry, I'd really like to help since I've had a lot of problems installing this database myself but I don't know enough yet

  11. #11
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jofa
    My guess: Insufficient permissions?
    I'm logged on as an administrator...

  12. #12
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likewise Though I have found that by default when using this

    PHP Code:
    postmaster -/usr/share/postgresql/data 
    This it's self doesn't include networking so you are unable to connect to TCP/IP ? You have to use this instead...

    PHP Code:
    $ /usr/bin/pg_ctl -/usr/share/postgresql/data -l logfile --i start 
    Hope this'll help someone, now if only I knew how to create a user with a password ? ...

    Postgres installs fine on windows without cygwin
    PeerDirect on Win2000Pro which I've had running, there is another project which branches off from PostgreSQL which I can't remember ?

    Doesn't matter since continued development has been halted On Win98SE you do need cygwin though ?

  13. #13
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Anonymous
    Postgres installs fine on windows without cygwin, why go to the extra trouble?
    More details please.

    Installs fine on Windows == can be compiled natively under Windows?
    I don't think that's the best option for everyone.

    PostgreSQL by dbExperts ← US$235.00
    PowerGres by Software Research Associatess ← beta
    UltraSQL by PeerDirect ← beta

    Not sure what Anonymous means with "installs fine on windows"

  14. #14
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    > Postgres installs fine on windows without cygwin,
    > why go to the extra trouble?
    I want to be part of the chorus me too,
    so more details would be appreciated!

    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03

  15. #15
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jofa
    UltraSQL by PeerDirect
    I attempted to install this very thing on another machine Win98SE on Monday and no cheese folks; Win98SE does not have the environment variables you need,

    ie PGDATA for example ?

    You find these with WinNT and Win2000Pro though I'm a bit lost as well as to that statement myself

  16. #16
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone tried this: O'Reilly: PostgreSQL on Windows without that cygwin business

    Bet that's what "Anonymous" is talking about.
    It's on my list of things to try. :-)
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  17. #17
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by samsm
    Quote Originally Posted by jofa
    UltraSQL by PeerDirect ← beta
    Quote Originally Posted by www.oreillynet.com
    ... They have a beta of a port which seems to be working well for me, and will hold me over until PostgreSQL v. 7.4 which is meant to have native windows support!
    ...seems to be working well...
    Native Windows support in v 7.4? No...

  18. #18
    Anonymous
    SitePoint Community Guest
    PostgreSql is indeed a very powerfull database, but they have to implement a native Windows version. The Windows version is still and still delayed. I moved to Firebird database, but I found PostgreSql very actractive.

  19. #19
    Anonymous
    SitePoint Community Guest
    This is a pretty good tutorial, insofar as it got PostgreSQL up and running under XP for me. However, it took a little research and tweaking to get initdb to run.

    First, making the directory /usr/share/postgresql/data in Cygwin was a BAD IDEA. It resulted in all sorts of nasty permissions errors (couldn't create any files). Creating it in Windows took care of that.

    Second, initdb was still having permissions issues when setting up pg_shadow (whatever that is). A little research revealed that the following commands take care of this problem:

    chown 544 /usr/bin
    chmod 755 /usr/bin
    chmod +x+r+w /usr/bin/postgres.exe

    Hope this helps someone

  20. #20
    Anonymous
    SitePoint Community Guest
    pgAdmin III (http://www.pgadmin.org) does not require any ODBC driver to connect to PostgreSQL. It is a fully multi-platform application available under Win32, GNU/Linux and FreeBSD.

  21. #21
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Anonymous
    pgAdmin III (http://www.pgadmin.org) does not require any ODBC driver to connect to PostgreSQL. ...
    No, the ODBC driver is needed if you "...use MS Access ... as a front-end for PostgreSQL..."

  22. #22
    Anonymous
    SitePoint Community Guest
    From http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=utf-8&selm=8806a44b.0401270751.214995a1%40posting.google.com

    You need to install the Cygwin
    encrypt/decrypt library. Run the Cygwin setup.exe, in "Selected
    Packages" choose
    Libs -> "crypt: Encryption / Decryption utility and library", complete
    the setup. Now you should have the cygcrypt-0.dll on your cygwin/bin
    folder and you should be able to run postgresql.


  23. #23
    Anonymous
    SitePoint Community Guest
    net start postmaster

    gives this error message:

    System error 2069 has occurred. The service did not start due to a logon failure. I followed the tutorial step by step, and was able to login under windows as postgres/postgres, yet the postmaster service did/will not start. As a result, pgsql will not start either...

    any help? (i've tried to run net start postmaster as both postgres, and normal admin user, as logged in by windows, neither work)

    -john

  24. #24
    Anonymous
    SitePoint Community Guest
    Hey, this is John again...

    I fixed that error, my problem was that somehow the user 'postgres' didn't have rights ?, whatever...

    but I fixed that, by going into services... right clicked postmaster, properties... Logon tab... and put in the password again... it prompted me that he didn't have rights, should they be given, answer yes...

    BUT.. now I have a different problem...

    I get this error when I run `net start postmaster` (OR start from the services window):

    Could not start the postmaster service on Local Computer. Error 1067: The process terminated unexpectedly

    When I do this from command line, I get this:

    $ net start postmaster
    The postmaster service is starting.
    The postmaster service could not be started.

    A system error has occurred.

    System error 1067 has occurred.

    The process terminated unexpectedly.

    ---
    ultimately the same error, but perhaps more clues. I've done the standard 'restarting windows fixes all problems' a few times now, no such luck. Anyone else with any clues?

    Thanks

    -John

  25. #25
    Anonymous
    SitePoint Community Guest
    John again,

    Got it working! I found the /var/logs/postmaster error log, checked it out, that pg_control didn't exist.

    So I figured that if it didn't exist, that was a problem..

    tried running `initdb -D /usr/share/postgresql/data` again, told me to clean out the data dir... so I did.. ran it, it worked.. and now
    ...

    PostgreSql works!

    -John

    hope my mistakes helped someone else


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •