No Image
No Image
No Image
Installing PostgreSQL for BlitzMax Print E-mail
Sunday, 22 June 2008

Here's another of my permanent reminder web sticky notes, covering how to set up a PostgreSQL database for Blitzmax in Windows.

My settings were:

Account name: postgres
domain: DAVIDDECAND6915
pass: postgresql_pass
port: 5432
UTF8 encoding for server and client

Localhost connections only (no remote connections)

superuser name: postgres
pass: superuser_pass

  • Navigate to Control Panel/System/Advanced/Environment Variables and add the PostgreSQL bin location to the end of your PATH. Mine looked like this: ;C:\Program Files\PostgreSQL\8.3\bin 
  • Download Brucey's BAH.Database and BAH.dbpostgreSQL.mod
  • Place them in the folder as such: Blitzmax/mod/bah.mod/database.mod and Blitzmax/mod/bah.mod/dbpostgresql.mod
  • Navigate to BlitzMax\mod\bah.mod\dbpostgresql.mod\lib and copy libpg.a and paste it in BlitzMax\lib
  • Restart Windows to let the environment variables PATH settings take effect
  • Load up and run the test files in BlitzMax\mod\bah.mod\dbpostgresql.mod\tests
  • Edit the LoadDatabase call with your own databae specifics. My LoadDatabase call looked like this:

 Local db:TDBConnection = LoadDatabase("POSTGRESQL", "postgres", "localhost", 5432, "postgres", "superuser_pass")

  •  Ctrl-D in Blitzmax to compile the new modules and then Compile and run the test.bmx file.
  • If all is well, it should spit out something like:
DebugLog:1. Name = Alfred Aho
DebugLog: 2. Name = Brian Kernighan
DebugLog:3. Name = Peter Weinberger
NOTICE: CREATE TABLE/PRIMARY KEY well create implicit index "person_pkey" for table "person"
 
Next >
No Image
No Image No Image No Image
No Image
© 2009 Gibbon Games
No Image