Thread: FreeBSD 7.1 Release, Postgres v8.3.7 and confusion on a howto
All, I'm following this howto: http://www.howtoforge.com/virtual_hosting_vsftpd_postgresql_freebsd and can't get past setting up the database. I've installed postgres, and it starts successfully after an initdb [1], but I come to a full stop after the following commands: it-kbuff-fbsd# su - pgsql $ psql system psql: FATAL: database "system" does not exist Huh? Is it a problem with the howto, or a mismatch between the howto and version of postgres I'm using, or am I performing a newb stunt? Any help appreciated. Thanks, Kurt [1] Results from initdb it-kbuff-fbsd# /usr/local/etc/rc.d/postgresql initdb The files belonging to this database system will be owned by user "pgsql". This user must also own the server process. The database cluster will be initialized with locale C. The default text search configuration will be set to "english". fixing permissions on existing directory /usr/local/pgsql/data ... ok creating subdirectories ... ok selecting default max_connections ... 40 selecting default shared_buffers/max_fsm_pages ... 28MB/179200 creating configuration files ... ok creating template1 database in /usr/local/pgsql/data/base/1 ... ok initializing pg_authid ... ok initializing dependencies ... ok creating system views ... ok loading system objects' descriptions ... ok creating conversions ... ok creating dictionaries ... ok setting privileges on built-in objects ... ok creating information schema ... ok vacuuming database template1 ... ok copying template1 to template0 ... ok copying template1 to postgres ... ok WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the -A option the next time you run initdb. Success. You can now start the database server using: /usr/local/bin/postgres -D /usr/local/pgsql/data or /usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
On Wed, 5 Aug 2009, Kurt Buff wrote: > All, > > I'm following this howto: > http://www.howtoforge.com/virtual_hosting_vsftpd_postgresql_freebsd > > and can't get past setting up the database. > > I've installed postgres, and it starts successfully after an initdb > [1], but I come to a full stop after the following commands: > > it-kbuff-fbsd# su - pgsql > $ psql system > psql: FATAL: database "system" does not exist > > Huh? Is it a problem with the howto, or a mismatch between the howto > and version of postgres I'm using, or am I performing a newb stunt? Actually, I'm not seeing anything in the howto that actually creates the database they have you trying to connect to. Perhaps doing a createdb system after the su but before the psql?
Sounds reasonable. I was assuming (yes, that bad habit!) that system was a built-in database, much like MS SQLServer has a master database. Thanks! Kurt On Wed, Aug 5, 2009 at 12:54, Lacey Powers<lacey.powers@commandprompt.com> wrote: > Hello Kurt, > > It looks like the howto is assuming that you've made a database/have a > database called "system". > > Looking over your initdb command....it looks like you have a template1 > database and trust authentication for local connections. > > Based on that, I'd recommend you try this command: > > psql template1 > > From there, if you can connect, you should be able to create the howto > mentioned "system" database (or whatever you choose), connect to that > database, and continue onward with the howto. =) > > Lacey >> >> All, >> >> I'm following this howto: >> http://www.howtoforge.com/virtual_hosting_vsftpd_postgresql_freebsd >> >> and can't get past setting up the database. >> >> I've installed postgres, and it starts successfully after an initdb >> [1], but I come to a full stop after the following commands: >> >> it-kbuff-fbsd# su - pgsql >> $ psql system >> psql: FATAL: database "system" does not exist >> >> Huh? Is it a problem with the howto, or a mismatch between the howto >> and version of postgres I'm using, or am I performing a newb stunt? >> >> Any help appreciated. >> >> Thanks, >> >> Kurt >> >> >> [1] Results from initdb >> it-kbuff-fbsd# /usr/local/etc/rc.d/postgresql initdb >> The files belonging to this database system will be owned by user "pgsql". >> This user must also own the server process. >> >> The database cluster will be initialized with locale C. >> The default text search configuration will be set to "english". >> >> fixing permissions on existing directory /usr/local/pgsql/data ... ok >> creating subdirectories ... ok >> selecting default max_connections ... 40 >> selecting default shared_buffers/max_fsm_pages ... 28MB/179200 >> creating configuration files ... ok >> creating template1 database in /usr/local/pgsql/data/base/1 ... ok >> initializing pg_authid ... ok >> initializing dependencies ... ok >> creating system views ... ok >> loading system objects' descriptions ... ok >> creating conversions ... ok >> creating dictionaries ... ok >> setting privileges on built-in objects ... ok >> creating information schema ... ok >> vacuuming database template1 ... ok >> copying template1 to template0 ... ok >> copying template1 to postgres ... ok >> >> WARNING: enabling "trust" authentication for local connections >> You can change this by editing pg_hba.conf or using the -A option the >> next time you run initdb. >> >> Success. You can now start the database server using: >> >> /usr/local/bin/postgres -D /usr/local/pgsql/data >> or >> /usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start >> >> > > > -- > Lacey Powers > > The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 ext 104 > PostgreSQL Replication, Consulting, Custom Development, 24x7 support > >
On Wed, Aug 5, 2009 at 12:56, Stephan Szabo<sszabo@megazone.bigpanda.com> wrote: > On Wed, 5 Aug 2009, Kurt Buff wrote: > >> All, >> >> I'm following this howto: >> http://www.howtoforge.com/virtual_hosting_vsftpd_postgresql_freebsd >> >> and can't get past setting up the database. >> >> I've installed postgres, and it starts successfully after an initdb >> [1], but I come to a full stop after the following commands: >> >> it-kbuff-fbsd# su - pgsql >> $ psql system >> psql: FATAL: database "system" does not exist >> >> Huh? Is it a problem with the howto, or a mismatch between the howto >> and version of postgres I'm using, or am I performing a newb stunt? > > Actually, I'm not seeing anything in the howto that actually creates the > database they have you trying to connect to. Perhaps doing a > createdb system > after the su but before the psql? I've changed the config files from 'system' to 'template1', and that seems to be working just fine. Kurt
Hello Kurt, It looks like the howto is assuming that you've made a database/have a database called "system". Looking over your initdb command....it looks like you have a template1 database and trust authentication for local connections. Based on that, I'd recommend you try this command: psql template1 From there, if you can connect, you should be able to create the howto mentioned "system" database (or whatever you choose), connect to that database, and continue onward with the howto. =) Lacey > All, > > I'm following this howto: > http://www.howtoforge.com/virtual_hosting_vsftpd_postgresql_freebsd > > and can't get past setting up the database. > > I've installed postgres, and it starts successfully after an initdb > [1], but I come to a full stop after the following commands: > > it-kbuff-fbsd# su - pgsql > $ psql system > psql: FATAL: database "system" does not exist > > Huh? Is it a problem with the howto, or a mismatch between the howto > and version of postgres I'm using, or am I performing a newb stunt? > > Any help appreciated. > > Thanks, > > Kurt > > > [1] Results from initdb > it-kbuff-fbsd# /usr/local/etc/rc.d/postgresql initdb > The files belonging to this database system will be owned by user "pgsql". > This user must also own the server process. > > The database cluster will be initialized with locale C. > The default text search configuration will be set to "english". > > fixing permissions on existing directory /usr/local/pgsql/data ... ok > creating subdirectories ... ok > selecting default max_connections ... 40 > selecting default shared_buffers/max_fsm_pages ... 28MB/179200 > creating configuration files ... ok > creating template1 database in /usr/local/pgsql/data/base/1 ... ok > initializing pg_authid ... ok > initializing dependencies ... ok > creating system views ... ok > loading system objects' descriptions ... ok > creating conversions ... ok > creating dictionaries ... ok > setting privileges on built-in objects ... ok > creating information schema ... ok > vacuuming database template1 ... ok > copying template1 to template0 ... ok > copying template1 to postgres ... ok > > WARNING: enabling "trust" authentication for local connections > You can change this by editing pg_hba.conf or using the -A option the > next time you run initdb. > > Success. You can now start the database server using: > > /usr/local/bin/postgres -D /usr/local/pgsql/data > or > /usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start > > -- Lacey Powers The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 ext 104 PostgreSQL Replication, Consulting, Custom Development, 24x7 support