pg.ddx.io pgsql-jdbc@postgresql.org mailing list archivehelp / color / mirror / Atom feed
Help me start postmaster on a default installation of PostgreSQL. 7+ messages / 5 participants [nested] [flat]
* Help me start postmaster on a default installation of PostgreSQL. @ 2011-07-06 10:34 Lord Voldemort <murderthemuggles@yahoo.co.in> 0 siblings, 1 reply; 7+ messages in thread From: Lord Voldemort @ 2011-07-06 10:34 UTC (permalink / raw) To: pgsql-jdbc Hi! I'm running Ubuntu 10.10 and I have installed PostgreSQL and JDBC drivers form the repository. I have not changed any default settings. I want to run the postmaster service to access database from a Java program. I've read around a bit about and it has not helped. I don't want to go in great depth about how to do this because right now I'm focusing on learning Java and I don't really have enough time to read hundreds of pages of docs. I've added /usr/lib/postgresql/8.4/bin to my PATH variable. Command "pg_ctl start" or "postmaster" gives an error about not being able to find "postgresql.conf" in the directory specified by PGDATA or my home folder if it's blank. I found this file (postgresql.con) in /etc/postgresql/8.4/main/ and created a shortcut to it in my home folder. Now I'm getting error 2011-07-06 09:56:57 GMT FATAL: data directory "/var/lib/postgresql/8.4/main" has wrong ownership 2011-07-06 09:56:57 GMT HINT: The server must be started by the user that owns the data directory. This data directory is owned by postgres. I read somewhere that this postmaster has to be run by the user postgres but I don't know how to do that. Apart from that my installation is working fine. I've already created a user for myself and a small trial database too. Please help me. ^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Help me start postmaster on a default installation of PostgreSQL. @ 2011-07-06 17:10 Kevin Grittner <Kevin.Grittner@wicourts.gov> parent: Lord Voldemort <murderthemuggles@yahoo.co.in> 0 siblings, 1 reply; 7+ messages in thread From: Kevin Grittner @ 2011-07-06 17:10 UTC (permalink / raw) To: pgsql-jdbc; Lord Voldemort <murderthemuggles@yahoo.co.in> Lord Voldemort <murderthemuggles@yahoo.co.in> wrote: > I'm running Ubuntu 10.10 and I have installed PostgreSQL and JDBC > drivers form the repository. What repository do you mean? Ubuntu's? > I have not changed any default settings. > Command "pg_ctl start" or "postmaster" gives an error about not > being able to find "postgresql.conf" in the directory specified by > PGDATA or my home folder if it's blank. If you used Ubuntu's version, shouldn't you be using the `service` command to control it? I'm not sure what version comes with 10.10, but on my older kubuntu machine, it's: sudo service postgresql-8.4 start > Apart from that my installation is working fine. I've already > created a user for myself and a small trial database too. Without successfully starting the database server??? If the above suggestion doesn't help, please read this and post a more detailed message: http://wiki.postgresql.org/wiki/Guide_to_reporting_problems It's easier for people to help if your post isn't such a, er, Riddle.... ;-) -Kevin ^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Help me start postmaster on a default installation of PostgreSQL. @ 2011-07-06 17:15 Maciek Sakrejda <msakrejda@truviso.com> parent: Kevin Grittner <Kevin.Grittner@wicourts.gov> 0 siblings, 1 reply; 7+ messages in thread From: Maciek Sakrejda @ 2011-07-06 17:15 UTC (permalink / raw) To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-jdbc@postgresql.org, Lord Voldemort <murderthemuggles@yahoo.co.in> Also, since your post is not really jdbc related, you may want to try the pgsql-general list. --- Maciek Sakrejda | System Architect | Truviso 1065 E. Hillsdale Blvd., Suite 215 Foster City, CA 94404 (650) 242-3500 Main www.truviso.com ^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Help me start postmaster on a default installation of PostgreSQL. @ 2011-07-07 05:35 Lord Voldemort <murderthemuggles@yahoo.co.in> 0 siblings, 0 replies; 7+ messages in thread From: Lord Voldemort @ 2011-07-07 05:35 UTC (permalink / raw) To: pgsql-jdbc -------- Original Message -------- Subject: Re: [JDBC] Help me start postmaster on a default installation of PostgreSQL. Date: Thu, 07 Jul 2011 11:03:03 +0530 From: Lord Voldemort <murderthemuggles@yahoo.co.in> To: Kevin Grittner <Kevin.Grittner@wicourts.gov> Thanks for taking interest Kevin. Here's a re-statement of my problem: What I'm trying to achieve:- To run postmaster service, so that I can access database using JDBC. I am a student learning Java and I don't want a very customized setup. Anything that's sufficient for demo programs will do. EXACT PostgreSQL version:- PostgreSQL 8.4.8 on i686-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5, 32-bit I downloaded PostgreSQL package from http://archive.ubuntu.com/ubuntu/ maverick-updates/main i386 Packages. That's the maverick-updates repository. Changes made to the settings in the postgresql.conf file: None OS details: Ubuntu 10.10 Linux 2.6.35-30-generic As per your suggestion giving the command sudo service postgresql-8.4 start results in postgresql-8.4: unrecognized service Actually I did start the server using pgAdminIII. I read about that somewhere. Please help me 'coz I'm trying hard without any success. Most of the reference materials/tutorials I've looked up refer to folders that don't even exist on my system (eg. /usr/local/pgsql). ^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Help me start postmaster on a default installation of PostgreSQL. @ 2011-07-07 10:36 Lord Voldemort <murderthemuggles@yahoo.co.in> parent: Maciek Sakrejda <msakrejda@truviso.com> 0 siblings, 1 reply; 7+ messages in thread From: Lord Voldemort @ 2011-07-07 10:36 UTC (permalink / raw) To: pgsql-jdbc I've sorted out things myself. Firstly IMHO this list is the appropriate place for my query as you'd see that what I really want is to use JDBC with PostgreSQL. Running postmaster was supposed to be a way to accomplish that. But as it turns out, newer versions of PostgreSQL have done away with postmaster completely. After default installation nothing needs to be changed. Services necessary for backend database access are started automatically at boot-up. After installing libpg-java (that's the JDBC driver package for postgreSQL) all that needs to be done is to add /usr/share/java/postgresql.jar to the java library. I use NetBeans so that was easy for me. I don't know how to do that when running applications from command line using "java /classname/" though. If you'd still maintain that I'm posting at the wrong place, please forgive me 'coz I was ill-advised and I'm not so bright either ;-) Cheers!! ^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Help me start postmaster on a default installation of PostgreSQL. @ 2011-07-07 12:04 Craig Ringer <craig@postnewspapers.com.au> parent: Lord Voldemort <murderthemuggles@yahoo.co.in> 0 siblings, 1 reply; 7+ messages in thread From: Craig Ringer @ 2011-07-07 12:04 UTC (permalink / raw) To: Lord Voldemort <murderthemuggles@yahoo.co.in>; +Cc: pgsql-jdbc On 7/07/2011 6:36 PM, Lord Voldemort wrote: > I've sorted out things myself. > > Firstly IMHO this list is the appropriate place for my query as you'd > see that what I really want is to use JDBC with PostgreSQL. Running > postmaster was supposed to be a way to accomplish that. > > But as it turns out, newer versions of PostgreSQL have done away with > postmaster completely. Say what? No, there's still a postmaster. You wouldn't ever be invoking it directly, though; you use pg_ctl to control PostgreSQL if you installed from source or from the EnterpriseDB packages. For distro packages of PostgreSQL you use your distro's service management mechanism: the "service" command, /etc/init.d/ scripts, etc. If you're using distro packages of PostgreSQL, stick to the distro's management methods. > After default installation nothing needs to be > changed. Services necessary for backend database access are started > automatically at boot-up. Note that PostgreSQL probably only listens on 127.0.0.1 or it may have TCP/IP disabled so it only uses UNIX sockets. You may need to alter postgresql.conf if you want to listen on other interfaces. > After installing libpg-java (that's the JDBC > driver package for postgreSQL) all that needs to be done is to add > /usr/share/java/postgresql.jar to the java library. I use NetBeans so > that was easy for me. I don't know how to do that when running > applications from command line using "java /classname/" though. Use the -classpath argument to the JVM. Typically, though, you bundle the PostgreSQL JDBC driver within your executable JAR and run it with "java -jar myapp.jar", using a Main-class: entry in META-INF/MANIFEST.MF to tell Java what the entry point class is. This is all basic Java stuff and has nothing to do with PostgreSQL, though. -- Craig Ringer POST Newspapers 276 Onslow Rd, Shenton Park Ph: 08 9381 3088 Fax: 08 9388 2258 ABN: 50 008 917 717 http://www.postnewspapers.com.au/ ^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Help me start postmaster on a default installation of PostgreSQL. @ 2011-07-07 13:34 Radosław Smogura <rsmogura@softperience.eu> parent: Craig Ringer <craig@postnewspapers.com.au> 0 siblings, 0 replies; 7+ messages in thread From: Radosław Smogura @ 2011-07-07 13:34 UTC (permalink / raw) To: Craig Ringer <craig@postnewspapers.com.au>; +Cc: Lord Voldemort <murderthemuggles@yahoo.co.in>; pgsql-jdbc On Thu, 07 Jul 2011 20:04:33 +0800, Craig Ringer wrote: > On 7/07/2011 6:36 PM, Lord Voldemort wrote: >> I've sorted out things myself. >> >> Firstly IMHO this list is the appropriate place for my query as >> you'd >> see that what I really want is to use JDBC with PostgreSQL. Running >> postmaster was supposed to be a way to accomplish that. >> >> But as it turns out, newer versions of PostgreSQL have done away >> with >> postmaster completely. > > Say what? > > No, there's still a postmaster. You wouldn't ever be invoking it > directly, though; you use pg_ctl to control PostgreSQL if you > installed from source or from the EnterpriseDB packages. For distro > packages of PostgreSQL you use your distro's service management > mechanism: the "service" command, /etc/init.d/ scripts, etc. > > If you're using distro packages of PostgreSQL, stick to the distro's > management methods. > >> After default installation nothing needs to be >> changed. Services necessary for backend database access are started >> automatically at boot-up. > > Note that PostgreSQL probably only listens on 127.0.0.1 or it may > have TCP/IP disabled so it only uses UNIX sockets. You may need to > alter postgresql.conf if you want to listen on other interfaces. > >> After installing libpg-java (that's the JDBC >> driver package for postgreSQL) all that needs to be done is to add >> /usr/share/java/postgresql.jar to the java library. I use NetBeans >> so >> that was easy for me. I don't know how to do that when running >> applications from command line using "java /classname/" though. > > Use the -classpath argument to the JVM. > > Typically, though, you bundle the PostgreSQL JDBC driver within your > executable JAR and run it with "java -jar myapp.jar", using a > Main-class: entry in META-INF/MANIFEST.MF to tell Java what the entry > point class is. This is all basic Java stuff and has nothing to do > with PostgreSQL, though. ...and for more advanced tasks use urlclassloader, refer to JavaDoc. Regards, Radek > -- > Craig Ringer > > POST Newspapers > 276 Onslow Rd, Shenton Park > Ph: 08 9381 3088 Fax: 08 9388 2258 > ABN: 50 008 917 717 > http://www.postnewspapers.com.au/ ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2011-07-07 13:34 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2011-07-06 10:34 Help me start postmaster on a default installation of PostgreSQL. Lord Voldemort <murderthemuggles@yahoo.co.in> 2011-07-06 17:10 ` Kevin Grittner <Kevin.Grittner@wicourts.gov> 2011-07-06 17:15 ` Maciek Sakrejda <msakrejda@truviso.com> 2011-07-07 10:36 ` Lord Voldemort <murderthemuggles@yahoo.co.in> 2011-07-07 12:04 ` Craig Ringer <craig@postnewspapers.com.au> 2011-07-07 13:34 ` Radosław Smogura <rsmogura@softperience.eu> 2011-07-07 05:35 Re: Help me start postmaster on a default installation of PostgreSQL. Lord Voldemort <murderthemuggles@yahoo.co.in>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox