Thread: RE: tourble migrating from linux/Apache/postgresql/perl to win200 0/IIS/postgresql/perl
RE: tourble migrating from linux/Apache/postgresql/perl to win200 0/IIS/postgresql/perl
From
Rishi Sharma
Date:
Just a little more info for you: When trying to build the latest postgresql-7.1.2 I get the following error: bash-2.05$ make make -C doc all make[1]: Entering directory `/usr/src/postgresql-7.1.2/doc' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/usr/src/postgresql-7.1.2/doc' make -C src all make[1]: Entering directory `/usr/src/postgresql-7.1.2/src' make -C backend all make[2]: Entering directory `/usr/src/postgresql-7.1.2/src/backend' prereqdir=`cd parser/ >/dev/null && pwd` && \ cd ../../src/include/parser/ && rm -f parse.h && \ ln -s $prereqdir/parse.h . make -C utils fmgroids.h make[3]: Entering directory `/usr/src/postgresql-7.1.2/src/backend/utils' CPP='gcc -E' AWK='gawk' /bin/sh.exe Gen_fmgrtab.sh ../../../src/include/catalog/ pg_proc.h -nThe system cannot find the file specified. cpp0.exe: output pipe has been closed Gen_fmgrtab.sh failed make[3]: *** [fmgroids.h] Error 1 make[3]: Leaving directory `/usr/src/postgresql-7.1.2/src/backend/utils' make[2]: *** [utils/fmgroids.h] Error 2 make[2]: Leaving directory `/usr/src/postgresql-7.1.2/src/backend' make[1]: *** [all] Error 2 make[1]: Leaving directory `/usr/src/postgresql-7.1.2/src' make: *** [all] Error 2 bash-2.05$ where is fmgroids.h? -----Original Message----- From: Rishi Sharma To: 'Jason Tishler ' Cc: 'Pgsql-Cygwin ' ' Sent: 6/9/01 5:15 PM Subject: tourble migrating from linux/Apache/postgresql/perl to win2000/IIS/postgresql/perl Hello Jason, We previously communicated on the following post about a week ago: http://fts.postgresql.org/db/mw/msg.html?mid=121056 I am still running into setup/config issues with postgresql and perl under IIS. I hope this new thread will find answers from people that have done something similar in the past. Just to recap: - cygwin/cygipc are setup properly. - I have taken the postgresql7.0 prebuilt NT binaries from http://www.ca.postgresql.org/ftpsite/binary/v7.0/NT. (I could not get the lastest source to compile on our IIS box because some include files were not part of the tar I downloaded. Perhaps there are external dependencies (visual c++?) that were not incluced in the tar. If someone has been able to compile the latest source for win32, please tell me where I can get it prebuilt.) - the database has been restored from my old linux box over to the IIS box and I can see data using psql. - old perl scripts have been moved over and configured to run under IIS - Fred Yankowski pointed me to www.php.net, however, I belive if I take that route, the perl cgi's I'm trying to migrate over to win2000 will need to be re-written using php. I think it's probabaly best to avoid re-writing code for this migration - any way to avoid this if I use php? ISSUES: - I am not able to load the perl module in my cgi scripts. There are many posts regarding this issue... See http://fts.postgresql.org/db/mw/msg.html?mid=120905 for more information. I belive the problem is the prebuilt postgresql7.0 NT binary I downloaded. There should be a libpq.dll (win32) library in this package but I only see a libpq.a (unix) library. I don't think the Pg.pm module can be loaded properly w/o this library - but as I noted above, I'm not able to build it myself on my IIS box. Another possibility is that my environment may not have the path to right Pg.pm module. I can see the Pg.pm module in my d:\cygin\usr\src\postgresql-7.1.1\src\interfaces\perl5\Pg.pm - Is this the right place for this module? If I pring out my the @INC array - the path seems to be in there. -------- #here is a test cgi I am testing with test.cgi: #!/usr/bin/perl # -*- perl -*- to tell emacs that this is a perl script # Include any additional modules push (@INC, "d:\\cygwin\\usr\\src\\postgresql-7.1.1\\src\\interfaces\\perl5"); #also trying forward slash... #push (@INC, "d:\/cygwin\/usr\/src\/postgresql-7.1.1\/src\/interfaces\/perl5"); use CGI; $q = new CGI; print $q->header; # Enable access to the SQL database #use Pg; print "INC=" . "@INC\n"; ## Close the current script exit (0); -------- #here is the output INC=D:/Perl/lib D:/Perl/site/lib . d:\cygwin\usr\src\postgresql-7.1.1\src\interfaces\perl5 -------- I also saw some references to building an ODBC driver for postgresql - do I need ODBC if I'm using cgi's? I though that is necessary for clients that are going via TCP/IP to the db (?)... Can you help? I will continue trying to find a solution to this in the meantime. Best Regards, -rishi
Re: RE: tourble migrating from linux/Apache/postgresql/perl to win2000/IIS/postgresql/perl
From
s0lao@netscape.net (S. L.)
Date:
Rishi Sharma <rsharma@Bigstep.net> wrote: > > Just a little more info for you: > [...] > make[3]: Entering directory `/usr/src/postgresql-7.1.2/src/backend/utils' > CPP='gcc -E' AWK='gawk' /bin/sh.exe Gen_fmgrtab.sh > ../../../src/include/catalog/ > pg_proc.h > -nThe system cannot find the file specified. > cpp0.exe: output pipe has been closed > Gen_fmgrtab.sh failed [...] > > where is fmgroids.h? It's obvious that it hasn't been created, as far as the script used to generate it failed. Maybe your cygwin environmentisn't properly configured? > -----Original Message----- [...] You should decide to use a single notation for cygwin paths in your scripts -- either the windowish way, addapted to un*xports, e.g. c:/cygwin/usr/bin, or the un*x way, /usr/bin. In a hybrid environment as your IIS & postgresql/perl lookslike, it's a good thing to initialize the PATH environment variable with a value to satisfy both the win32 and the cygwinapps. A good test would be to try the printenv or test-cgi scripts from apache distribution, adapted to your IIS. A specific advice would be to put #!c:/cygwin/local/bin/perl instead #!/usr/local/bin/perl at the begining of your scripts-- although your IIS knows to do a c:\cygwin\local\bin\perl.exe on the *.cgi files. Also if your scripts are in perl, you need the Pg.dll library, which builds OOTB for PostgreSQL'n'perl/cygwin. SLao __________________________________________________________________ Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/
Re: RE: tourble migrating from linux/Apache/postgresql/perl to win2000/IIS/postgresql/perl
From
s0lao@netscape.net (S. L.)
Date:
[After the previous reply I've noticed your posts in pgsql-general] To quote one of the answers there, Pg and DBD::Pg are completely different. You weren't very clear what interface your scriptsuse. If you used DBI/DBD postgres interface for your scripts, you don't need any perl tweak to your PostgreSQL build.For a Pg module, you should either find a binary distro which has it included (very hard -- as this should be a solverbuild -- like in openoffice -- including the prebuild source tree) or to build it yourself. As a last comment, DBD::Pg would be a better bet, because its build is not based on PostgreSQL source, but on a working binarydistribution, with libpq.dll and headers included. If you have problems with CPAN direct access using Perl, there'salways the ftp/http download alternative -- don't forget the DBI module also. SLao __________________________________________________________________ Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/
Folks, I'm just trying to get started on setting up postgreSQL on a Windows 2000 box, and I'm horribly confused. I've tried both techinqiues: compile natively using Visual C++, and install cygwin and run the "Unix" version. I'm to the point where I'm running a bash shell and am trying to start the "easy" installation instrucitons. However, when I type in "./configure" I get hte error: configure: error: installation or configuration problem: C compiler cannot create executables. I tried changing the permissions on the postgresql-7.1.2 directory but that didn't seem to help. Any ideas? Stuck but hopeful, Robby
Robby, If you don't want to compile it, you can just use the binary that comes with cygwin look at the postmaster and initdb man pages to get you started. - make sure you also get cygipc (http://www.neuro.gatech.edu/users/cwilson/cygutils/V1.1/cygipc/) Russell ----- Original Message ----- From: "Robby Slaughter" <webmaster@robbyslaughter.com> To: <pgsql-cygwin@postgresql.org> Sent: Monday, June 11, 2001 5:36 PM Subject: [CYGWIN] Getting started on W2K installation of postgreSQL > Folks, > > I'm just trying to get started on setting up postgreSQL on a Windows 2000 > box, and I'm horribly confused. I've tried both techinqiues: compile > natively using Visual C++, and install cygwin and run the "Unix" version. > > I'm to the point where I'm running a bash shell and am trying to start the > "easy" installation instrucitons. However, when I type in "./configure" > I get hte error: > > configure: error: installation or configuration problem: C compiler cannot > create executables. > > I tried changing the permissions on the postgresql-7.1.2 directory but > that didn't seem to help. Any ideas? > > Stuck but hopeful, > Robby > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster
Solved my own problems. To the other novices just getting started, you need (1) run initdb from the command prompt, which creates a database. Then you need to (2) start up the postmaster, using an environment variable or just postmaster -D ./ if you're already in the same directory as the DB. Then, (3) you need to create a database (I know, again!) using the createdb utility (try "createdb mydb"). Finally, (4) run the psql utility with the parameter of whatever database name you specified ("psql mydb" in the case above). Now you can run SQL commands to your heart's content! Relieved and now in the world of ODBC, -Robby -----Original Message----- From: pgsql-cygwin-owner@postgresql.org [mailto:pgsql-cygwin-owner@postgresql.org]On Behalf Of Russell Black Sent: Monday, June 11, 2001 7:08 PM To: webmaster@robbyslaughter.com; pgsql-cygwin@postgresql.org Subject: Re: [CYGWIN] Getting started on W2K installation of postgreSQL Robby, If you don't want to compile it, you can just use the binary that comes with cygwin look at the postmaster and initdb man pages to get you started. - make sure you also get cygipc (http://www.neuro.gatech.edu/users/cwilson/cygutils/V1.1/cygipc/) Russell ----- Original Message ----- From: "Robby Slaughter" <webmaster@robbyslaughter.com> To: <pgsql-cygwin@postgresql.org> Sent: Monday, June 11, 2001 5:36 PM Subject: [CYGWIN] Getting started on W2K installation of postgreSQL > Folks, > > I'm just trying to get started on setting up postgreSQL on a Windows 2000 > box, and I'm horribly confused. I've tried both techinqiues: compile > natively using Visual C++, and install cygwin and run the "Unix" version. > > I'm to the point where I'm running a bash shell and am trying to start the > "easy" installation instrucitons. However, when I type in "./configure" > I get hte error: > > configure: error: installation or configuration problem: C compiler cannot > create executables. > > I tried changing the permissions on the postgresql-7.1.2 directory but > that didn't seem to help. Any ideas? > > Stuck but hopeful, > Robby > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster