Re: [GENERAL] setting up PostgreSQL on Linux RHL9 to allow ODBC
Thanks to William and everyone else who answered this. It works like a charm!! PostgreSQL rules! Susan William Yu <[EMAIL PROTECTED]> To: pgsql-general@postgresql.org Sent by: cc: Subject: Re: [GENERAL] setting up PostgreSQL on Linux RHL9 to allow ODBC connections [EMAIL PROTECTED] |---| tgresql.org | [ ] Expand Groups | |---| 06/22/2005 08:56 PM There's nothing on the server side that needs to be configured for Windows clients to access Postgres via ODBC. As long as TCP/IP is turned on. Just add a data source and configure the server ip/name/port/database/etc. [EMAIL PROTECTED] wrote: > Hi, > I have seen a bunch of different documentation on how to set up to allow > ODBC, but I am a little confused about how much/what has to be set up to > allow an ODBC connection from Windows (mostly 2003, some XP) to an existing > PostgreSQL (7.4.6) database on Linux (RedHat 9 version 2.4.20-6smp). > > Most of the documentation is talking about setting up Unix to Unix odbc, or > Windows to Windows, not Windows to Unix/Linux. > > Some documentation talks about installing the "full" distribution on > Windows, but I just want to allow some Windows software that "speaks" ODBC > (SilkTest) to be able to connect to an existing database. > > > In the document > http://gborg.postgresql.org/project/psqlodbc/genpage.php?howto-redhat, it > says to download rpms and install them, but I don't really see any rpms for > this. I see source distributions at > http://www.postgresql.org/ftp/odbc/versions/src/, but nothing for version > 7.4, just 7.3 and 8.0. I am reluctant to upgrade to 8.0, as I am not sure > it is stable yet, and my installation is running so well. > > > The howto-redhat document also talks about running: > > > > >psql -d template1 -f /usr/share/pgsql/odbc.sql > > > > > > to modify template1, but what about existing databases? > > I'm somewhat nervous about doing anything to potentially mess up anything > on my Linux server, as this is a production database. > > Then, you have to set up the iodbc driver manager, etc. On this server, I > have had some issues with using rpm's in the past, and have often had to > resort to building things myself (configure, make, etc.) > > I'm also not sure about how to specify a DSN to do the connection from the > Windows side (I'm primarily a Unix/Linux person). > > Does anyone have any specific advice/experiences to offer on setting this > up as simply as possible? > > Thanks, > Susan > > > > > -- > See our award-winning line of tape and disk-based > backup & recovery solutions at http://www.overlandstorage.com > -- > > > ---(end of broadcast)--- > TIP 3: if posting/reading through Usenet, please send an appropriate >subscribe-nomail command to [EMAIL PROTECTED] so that
Re: [GENERAL] setting up PostgreSQL on Linux RHL9 to allow ODBC connections from Windows
hi, if the client machine is another linux , what is the correct way to configure ODBC thanks Hugo Hi,All you need is the Windows ODBC driver, which you install on the client machine, and then configure it to talk to the Linux server onport 5432 (set by default).--Ray.>> Most of the documentation is talking about setting up Unix to Unix odbc, or> Windows to Windows, not Windows to Unix/Linux. >> Some documentation talks about installing the "full" distribution on> Windows, but I just want to allow some Windows software that "speaks" ODBC> (SilkTest) to be able to connect to an existing database. >>> In the document> http://gborg.postgresql.org/project/psqlodbc/genpage.php?howto-redhat, it> says to download rpms and install them, but I don't really see any rpms for > this. I see source distributions at> http://www.postgresql.org/ftp/odbc/versions/src/, but nothing for version> 7.4, just 7.3 and 8.0. I am reluctant to upgrade to 8.0, as I am not sure> it is stable yet, and my installation is running so well.>>> The howto-redhat document also talks about running:>psql -d template1 -f /usr/share/pgsql/odbc.sql >> to modify template1, but what about existing databases?>> I'm somewhat nervous about doing anything to potentially mess up anything> on my Linux server, as this is a production database. >> Then, you have to set up the iodbc driver manager, etc. On this server, I> have had some issues with using rpm's in the past, and have often had to> resort to building things myself (configure, make, etc.) >> I'm also not sure about how to specify a DSN to do the connection from the> Windows side (I'm primarily a Unix/Linux person).>> Does anyone have any specific advice/experiences to offer on setting this > up as simply as possible?>> Thanks,> Susan> --> See our award-winning line of tape and disk-based > backup & recovery solutions at http://www.overlandstorage.com> -- >>> ---(end of broadcast)---> TIP 3: if posting/reading through Usenet, please send an appropriate>subscribe-nomail command to [EMAIL PROTECTED] so that your>message can get through to the mailing list cleanly>-Raymond O'Donnell http://www.galwaycathedral.org/recitals[EMAIL PROTECTED] Galway Cathedral Recitals(end of broadcast)---TIP 7: don't forget to increase your free space map settings
Re: [GENERAL] setting up PostgreSQL on Linux RHL9 to allow ODBC connections
Not quite correct. TCP needs to be turned on AND an according entry in pg_hba.conf needs to be set up - otherwise the server will just decline to talk to the client. Also - if you're on XP you might want to check the "firewall" settings - which if configured wrong could potentially block connections on port 5432. If you have a default setup of XP it should be fine though. On Wednesday 22 June 2005 08:56 pm, William Yu wrote: > There's nothing on the server side that needs to be configured for > Windows clients to access Postgres via ODBC. As long as TCP/IP is turned > on. Just add a data source and configure the server > ip/name/port/database/etc. > > [EMAIL PROTECTED] wrote: > > Hi, > > I have seen a bunch of different documentation on how to set up to allow > > ODBC, but I am a little confused about how much/what has to be set up to > > allow an ODBC connection from Windows (mostly 2003, some XP) to an > > existing PostgreSQL (7.4.6) database on Linux (RedHat 9 version > > 2.4.20-6smp). > > > > Most of the documentation is talking about setting up Unix to Unix odbc, > > or Windows to Windows, not Windows to Unix/Linux. > > > > Some documentation talks about installing the "full" distribution on > > Windows, but I just want to allow some Windows software that "speaks" > > ODBC (SilkTest) to be able to connect to an existing database. > > > > > > In the document > > http://gborg.postgresql.org/project/psqlodbc/genpage.php?howto-redhat, > > it says to download rpms and install them, but I don't really see any > > rpms for this. I see source distributions at > > http://www.postgresql.org/ftp/odbc/versions/src/, but nothing for version > > 7.4, just 7.3 and 8.0. I am reluctant to upgrade to 8.0, as I am not > > sure it is stable yet, and my installation is running so well. > > > > > > The howto-redhat document also talks about running: > > > > > > > > > >psql -d template1 -f /usr/share/pgsql/odbc.sql > > > > > > > > > > > > to modify template1, but what about existing databases? > > > > I'm somewhat nervous about doing anything to potentially mess up anything > > on my Linux server, as this is a production database. > > > > Then, you have to set up the iodbc driver manager, etc. On this server, > > I have had some issues with using rpm's in the past, and have often had > > to resort to building things myself (configure, make, etc.) > > > > I'm also not sure about how to specify a DSN to do the connection from > > the Windows side (I'm primarily a Unix/Linux person). > > > > Does anyone have any specific advice/experiences to offer on setting this > > up as simply as possible? > > > > Thanks, > > Susan > > > > > > > > > > - > >- See our award-winning line of tape and disk-based > > backup & recovery solutions at http://www.overlandstorage.com > > - > >- > > > > > > ---(end of broadcast)--- > > TIP 3: if posting/reading through Usenet, please send an appropriate > >subscribe-nomail command to [EMAIL PROTECTED] so that your > >message can get through to the mailing list cleanly > > ---(end of broadcast)--- > TIP 3: if posting/reading through Usenet, please send an appropriate >subscribe-nomail command to [EMAIL PROTECTED] so that your >message can get through to the mailing list cleanly -- UC -- Open Source Solutions 4U, LLC 2570 Fleetwood Drive Phone: +1 650 872 2425 San Bruno, CA 94066 Cell: +1 650 302 2405 United States Fax:+1 650 872 2417 ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [GENERAL] setting up PostgreSQL on Linux RHL9 to allow ODBC connections from Windows
On 22 Jun 2005 at 8:59, [EMAIL PROTECTED] wrote: > I have seen a bunch of different documentation on how to set up to > allow ODBC, but I am a little confused about how much/what has to be > set up to allow an ODBC connection from Windows (mostly 2003, some XP) > to an existing PostgreSQL (7.4.6) database on Linux (RedHat 9 version > 2.4.20-6smp). Hi, All you need is the Windows ODBC driver, which you install on the client machine, and then configure it to talk to the Linux server on port 5432 (set by default). --Ray. > > Most of the documentation is talking about setting up Unix to Unix odbc, or > Windows to Windows, not Windows to Unix/Linux. > > Some documentation talks about installing the "full" distribution on > Windows, but I just want to allow some Windows software that "speaks" ODBC > (SilkTest) to be able to connect to an existing database. > > > In the document > http://gborg.postgresql.org/project/psqlodbc/genpage.php?howto-redhat, it > says to download rpms and install them, but I don't really see any rpms for > this. I see source distributions at > http://www.postgresql.org/ftp/odbc/versions/src/, but nothing for version > 7.4, just 7.3 and 8.0. I am reluctant to upgrade to 8.0, as I am not sure > it is stable yet, and my installation is running so well. > > > The howto-redhat document also talks about running: > > > > >psql -d template1 -f /usr/share/pgsql/odbc.sql > > > > > > to modify template1, but what about existing databases? > > I'm somewhat nervous about doing anything to potentially mess up anything > on my Linux server, as this is a production database. > > Then, you have to set up the iodbc driver manager, etc. On this server, I > have had some issues with using rpm's in the past, and have often had to > resort to building things myself (configure, make, etc.) > > I'm also not sure about how to specify a DSN to do the connection from the > Windows side (I'm primarily a Unix/Linux person). > > Does anyone have any specific advice/experiences to offer on setting this > up as simply as possible? > > Thanks, > Susan > > > > > -- > See our award-winning line of tape and disk-based > backup & recovery solutions at http://www.overlandstorage.com > -- > > > ---(end of broadcast)--- > TIP 3: if posting/reading through Usenet, please send an appropriate >subscribe-nomail command to [EMAIL PROTECTED] so that your >message can get through to the mailing list cleanly > - Raymond O'Donnell http://www.galwaycathedral.org/recitals [EMAIL PROTECTED] Galway Cathedral Recitals - ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
Re: [GENERAL] setting up PostgreSQL on Linux RHL9 to allow ODBC connections
There's nothing on the server side that needs to be configured for Windows clients to access Postgres via ODBC. As long as TCP/IP is turned on. Just add a data source and configure the server ip/name/port/database/etc. [EMAIL PROTECTED] wrote: Hi, I have seen a bunch of different documentation on how to set up to allow ODBC, but I am a little confused about how much/what has to be set up to allow an ODBC connection from Windows (mostly 2003, some XP) to an existing PostgreSQL (7.4.6) database on Linux (RedHat 9 version 2.4.20-6smp). Most of the documentation is talking about setting up Unix to Unix odbc, or Windows to Windows, not Windows to Unix/Linux. Some documentation talks about installing the "full" distribution on Windows, but I just want to allow some Windows software that "speaks" ODBC (SilkTest) to be able to connect to an existing database. In the document http://gborg.postgresql.org/project/psqlodbc/genpage.php?howto-redhat, it says to download rpms and install them, but I don't really see any rpms for this. I see source distributions at http://www.postgresql.org/ftp/odbc/versions/src/, but nothing for version 7.4, just 7.3 and 8.0. I am reluctant to upgrade to 8.0, as I am not sure it is stable yet, and my installation is running so well. The howto-redhat document also talks about running: psql -d template1 -f /usr/share/pgsql/odbc.sql to modify template1, but what about existing databases? I'm somewhat nervous about doing anything to potentially mess up anything on my Linux server, as this is a production database. Then, you have to set up the iodbc driver manager, etc. On this server, I have had some issues with using rpm's in the past, and have often had to resort to building things myself (configure, make, etc.) I'm also not sure about how to specify a DSN to do the connection from the Windows side (I'm primarily a Unix/Linux person). Does anyone have any specific advice/experiences to offer on setting this up as simply as possible? Thanks, Susan -- See our award-winning line of tape and disk-based backup & recovery solutions at http://www.overlandstorage.com -- ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[GENERAL] setting up PostgreSQL on Linux RHL9 to allow ODBC connections from Windows
Hi, I have seen a bunch of different documentation on how to set up to allow ODBC, but I am a little confused about how much/what has to be set up to allow an ODBC connection from Windows (mostly 2003, some XP) to an existing PostgreSQL (7.4.6) database on Linux (RedHat 9 version 2.4.20-6smp). Most of the documentation is talking about setting up Unix to Unix odbc, or Windows to Windows, not Windows to Unix/Linux. Some documentation talks about installing the "full" distribution on Windows, but I just want to allow some Windows software that "speaks" ODBC (SilkTest) to be able to connect to an existing database. In the document http://gborg.postgresql.org/project/psqlodbc/genpage.php?howto-redhat, it says to download rpms and install them, but I don't really see any rpms for this. I see source distributions at http://www.postgresql.org/ftp/odbc/versions/src/, but nothing for version 7.4, just 7.3 and 8.0. I am reluctant to upgrade to 8.0, as I am not sure it is stable yet, and my installation is running so well. The howto-redhat document also talks about running: psql -d template1 -f /usr/share/pgsql/odbc.sql to modify template1, but what about existing databases? I'm somewhat nervous about doing anything to potentially mess up anything on my Linux server, as this is a production database. Then, you have to set up the iodbc driver manager, etc. On this server, I have had some issues with using rpm's in the past, and have often had to resort to building things myself (configure, make, etc.) I'm also not sure about how to specify a DSN to do the connection from the Windows side (I'm primarily a Unix/Linux person). Does anyone have any specific advice/experiences to offer on setting this up as simply as possible? Thanks, Susan -- See our award-winning line of tape and disk-based backup & recovery solutions at http://www.overlandstorage.com -- ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [GENERAL] Setting up Postgresql on Linux
On 01/03/2004 23:22 Phil Campaigne wrote: Hello, I originally installed postgresql as root user and now I am setting up a development environment with cvs and a java ide and tomcat. I have everything with the exception of postgresql integreted using a non-root user. THe process I am using is to logon as postges and start the database and do queries from the command line using psql. Then I logoff and logon as phil and start tomcat and my java ide. 1.Is there a better way to start the database and the web application? Start PostgreSQL off as service (it's probably there already but configured to start on power-up/reboot). In a production environment I set tomcat up as a service as well. In a developmemt environment, I install/run it under my user. 2. During setup of postgresql I chown and ghgrp the /usr/local/pgsql directoy tree to postgres? 3.However my development environment(i.e. jdbc connection from my application) doesn't seem to have permission to access to all the files it needs in postgres? It doesn't need any postgres files. It communicates via tcp/ip. Keith has already posted the config changes you need to make. 4. Is is best to install postgresql as user "phil" in order to gain access for my integrated develoment environment? See above. -- Paul Thomas +--+-+ | Thomas Micro Systems Limited | Software Solutions for the Smaller Business | | Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk | +--+-+ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [GENERAL] Setting up Postgresql on Linux
On Thu, 4 Mar 2004, phil campaigne wrote: > Hello, > when I login to linux and check the env's I see: > PATH=/usr/local/pgsql/bin:/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/home/postgres/bin:/opt/IBMJava2-14/bin:/opt/IBMJava2-14/jre/bin:/usr/local/pgsql/bin > LD_LIBRARY_PATH=/usr/local/pgsql/lib > > However after I successfully start postgresql using > /etc/init.d/postgres start > /etc/init.d/postgres status > > I cannot execute the following: > psql testdb > psql: relocation error: psql: undefined symbol: PQgetssl > > Then if I execute from the command line: > LD_LIBRARY_PATH=/usr/local/pgsql/lib > export LD_LIBRARY_PATH > > PATH=/usr/local/pgsql/bin:$PATH > export PATH > > then psql testdb works! > > What's going on??? Are you exporting those same settings in your .bash_profile or whatever is setting up your environ? ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [GENERAL] Setting up Postgresql on Linux
Phil Campaigne wrote: Hi Ron, I had a couple of questions on your instructions: 1. what is this for? >#make install-all-headers According to the docs you need it if you are going to create your own functions, however the documentation is a bit *vague*. "If you plan to do any server-side program development (such as custom functions or data types written in C), then you may want to install the entire PostgreSQL include tree into your target include directory." I am working under the assumption that "custom functions" include any functions you create in plpgsql, sql, c, etc and not just C functions. I would recommend using this if you will be working with the database a lot, because you will probably eventually want to create some of your own functions. 2. is it advisable for me to use UNICODE for defalt encoding? > initdb -E UNICODE -D /usr/local/psql/data Some of our databases were originally encoded using SQL-ASCII and we still occasionally have problems when someone enters a character with an accent (eg in cafe). The jdbc driver won't convert it and the app 'breaks' wrt that data set. So I would recommend that you UNICODE, I don't believe that it really adds much in the way of overhead, etc. 3. My version of postgresql's linux script file instructs me to create symbolic links to: /etc/rc.d/rc2.d/K02postgresql /etc/rc.d/rc3.d/S98postgresql However the init script file for starting up the PostgreSQL server that I have is K15postgresql. Is it ok that I substitute a link to K15postgresql for rc2.d and rc3.d? I suppose that's okay. My very limited understanding of these directories is that they are used during startup/shutdown to ensure that services are started and stopped correctly and in the proper order. thanks, Phil Please respond to the list for more questions and cc me (or vice versa) if you have more questions. This way if anyone else is in a similar predicament they can read this, and others can contribute and/or correct me. Ron ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
[GENERAL] Setting up Postgresql on Linux
On Mon, 1 Mar 2004, phil campaigne wrote: Nigel J. Andrews wrote: >On Mon, 1 Mar 2004, Phil Campaigne wrote: > > > >>Hello, >>I originally installed postgresql as root user and now I am setting up a >>development environment with cvs and a java ide and tomcat. I have >>everything with the exception of postgresql integreted using a non-root >>user. >>THe process I am using is to logon as postges and start the database >>and do queries from the command line using psql. Then I logoff and logon >>as phil and start tomcat and my java ide. >> >> > >I'm a little confused as to what you are trying to accomplish. > > > >>1.Is there a better way to start the database and the web application? >> >> > >Can't you just start postgresql and tomcat? > > > >>2. During setup of postgresql I chown and ghgrp the /usr/local/pgsql >>directoy tree to postgres? >> >> > >A little strange but perfectly acceptable if that's how you want it; I install >all software under /usr/local as a special software manager, although I'm not >sure if I'd bother chown-ing an existing directory tree to non-root. > > > >>3.However my development environment(i.e. jdbc connection from my >>application) doesn't seem to have permission to access to all the files >>it needs in postgres? >> >> > >What's the error message? I'm not a jdbc person but I suspect from the >preceding comments that you're not running the postmaster or jdbc requires a >tcp connection and you haven't configured postgresql to allow that. > > > >>4. Is is best to install postgresql as user "phil" in order to gain >>access for my integrated develoment environment? >> >> > >You can install postgresql as whatever user you want, all it requires is that >it runs as a non-root user, and has the proper ownership etc on it's data >directory. > >First, I would do a: ps axu | grep post >and see if the postmaster is running. If not nad this is not supposed to run as >a normal service use: > >pg_ctl -l /path/to/a/logfile \ > -D /path/to/data/directory/initialised/with/initdb \ > start > >Start Tomcat. If after doing whatever to setup and use jdbc to access your >database (for testing you may want to createdb testdb) you still don't get any >connection set tcpip_socket to true in postgres.conf in the data directory and >stop and start postgresql using pg_ctl. Also look in the Tomcat logs and in >/path/to/a/logfile. While editing postgres.conf you may also want to look at >the log_ settings and enable a few to see what is happening in more detail. > >The postgresql documentation is at http://www.postgresql.org/doc/ and >unfortunately I can't be more specific with urls since the domain falls into to >large IP block I block completely due to the excessive number of speculative >probes of my systems (not postgresql.org addresses I hasten to add). In deed, >this email will probably not reach the list, I wish I know what causes the >switch from that working to not working. > > > > Hi Nigel, I have had a devil oaf a time with file permissions. I don't think I know how to set them up for application that have been installed by root user. Here's what I have done to make things work for user postgres: change in /usr/local/pgsql/data/postgresql.conf #tcpip_socket = true LD_LIBRARY_PATH=/usr/local/pgsql/lib export LD_LIBRARY_PATH PATH=/usr/local/pgsql/bin:$PATH export PATH touch /tmp/postgresql.log set permissions on /tmp/postgresql.log to postgres mkdir /usr/local/pgsql/data chown -R postgres:postgres /usr/local/pgsql/data chown -R postgres:postgres /usr/local/pgsql/lib su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data pg_ctl start -D /usr/local/pgsql/data -o "-i" -l /tmp/postgresql.log /usr/local/pgsql/bin/createdb -h localhost -U postgres hardwoodthunder psql -h localhost -U postgres hardwoodthunder Now if I try to run my web app from user phil in my ide using tomcat I think I am getting file permission errors. Phil, backtrack a bit...you can't edit postgres.conf until you've done an initdb because initdb initialises the data directory, including postgres.conf, pg_hba.conf and all the other files associated with a postgresql database cluster. So starting from the beginning: su to your desired user for postgresql, ie. postgres Don't bother chowning anything. Don't create a data directory; rename /usr/local/pgsql/data to something (just in case it is wanted later however unlikely that seems). _Do_ run: initdb -D /usr/local/pgsql/data _Do_ run pg_ctl to start the server but don't use the -o '-i' switch. _Do_ run createuser to create a database user of the same name as the user running the Tomcat etc. processes (user phil?) _Do_ run createdb -O hardwoodthunder Return/su to the Tomcat etc. user and try accessing the database with: psql hardwoodthunder Create schema, insert data, whatever. Use you IDE, Tomcat etc. If Tomcat etc. can't make a database c
[GENERAL] Setting up Postgresql on Linux
Thanks for the great response. I will try all of your ideas and get back with the results in a couple of days. thanks, again, Phil ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
Re: [GENERAL] Setting up Postgresql on Linux
Phil Campaigne wrote: Hello, I originally installed postgresql as root user and now I am setting up a development environment with cvs and a java ide and tomcat. I have everything with the exception of postgresql integreted using a non-root user. THe process I am using is to logon as postges and start the database and do queries from the command line using psql. Then I logoff and logon as phil and start tomcat and my java ide. 1.Is there a better way to start the database and the web application? 2. During setup of postgresql I chown and ghgrp the /usr/local/pgsql directoy tree to postgres? 3.However my development environment(i.e. jdbc connection from my application) doesn't seem to have permission to access to all the files it needs in postgres? 4. Is is best to install postgresql as user "phil" in order to gain access for my integrated develoment environment? thanks, Phil ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly For aditional reference you can check out the docs at http://www.postgresql.org/docs/7.4/static/postmaster-start.html especially section 16.3 as it pertains to linux (assuming that's your os). Below are some of the steps I use when I install postgres on a new machine, check out steps 10 and 11 specifically: my instructions 8. Install: # cd /usr/local/postgresql-7.x # make install # make install-all-headers # cd /usr/local # chown -R postgres.postgres pgsql 9. Initialize the database as user postgres: # su - postgres # initdb -E UNICODE -D /usr/local/pgsql/data 10. Configure (as root) the PostgreSQL SysV Script. This script is useful for starting, stopping, and checking the status of PostgreSQL. # cd /usr/local/src/postgresql-7.x # cp contrib/start-scripts/linux /etc/init.d/postgres # chmod 755 /etc/init.d/postgres To have PostgreSQL start automatically when the computer boots add symbolic links from the correct /etc/rc*.d/ directories to /etc/init.d/postgres. If the normal runlevel is 3 then you really only need to add it to rc3.d: # ln -s /etc/init.d/postgres /etc/rc2.d/S85postgres # ln -s /etc/init.d/postgres /etc/rc3.d/S85postgres etc ... 11. Start PostgreSQL for the first time: # /etc/init.d/postgres start 12. Create a new db: # su - postgres $ createdb testdb $ psql testdb \ my instructions Ron *Note:* these are taken from the book Practical Postgres by Worsley and Drake and are slightly(? can't remember, it's been so long since I made the list) modified. ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [GENERAL] Setting up Postgresql on Linux
On Mon, 1 Mar 2004, Phil Campaigne wrote: > Hello, > I originally installed postgresql as root user and now I am setting up a > development environment with cvs and a java ide and tomcat. I have > everything with the exception of postgresql integreted using a non-root > user. > THe process I am using is to logon as postges and start the database > and do queries from the command line using psql. Then I logoff and logon > as phil and start tomcat and my java ide. > > 1.Is there a better way to start the database and the web application? Yes, you can edit your /etc/rc.d/rc.local file and add lines something like this: su - postgres -c -- 'pg_ctl start -l $PGDATA/pgsql.log' su - httpd -c -- 'apachectl start' etc... > 2. During setup of postgresql I chown and ghgrp the /usr/local/pgsql > directoy tree to postgres? Not necessary. You just need to chown postgres.postgres whatever directory you're putting in $PGDATA. > 3.However my development environment(i.e. jdbc connection from my > application) doesn't seem to have permission to access to all the files > it needs in postgres? Someone else mentioned it, it's in pg_hba.conf. Also check your firewall installation. > 4. Is is best to install postgresql as user "phil" in order to gain > access for my integrated develoment environment? Not needed. If you createuser as the postgres superuser the user phil and assign him the power to add users, you make him a superuser and he will have every bit as much power as the postgres user. You might want to make two accounts, one for you as a superuser, and one for the application which is just a normal user with security to keep it in place. Enjoy! ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match