vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On a fresh installation of postgrsql 8.1 if you drop the 'postgres' database, psql, createdb, etc. no longer works. psql -l; ignores -dtemplate1, and createdb doesn't have such an option. Maybe it should fallback to template1 if the postgres database doesn't exist? .... John ---------------------------(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 |
| |||
| On Fri, Nov 18, 2005 at 12:01:31AM +1100, John Hansen wrote: > On a fresh installation of postgrsql 8.1 if you drop the > 'postgres' database, > psql, createdb, etc. no longer works. > > psql -l; ignores -dtemplate1, and createdb doesn't have such an option. What distribution? I've never seen this "postgres" database you speak of. It certainly not on any systems I've used. Do you have a PGDATABASE variable in your environment? Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQFDfItYIB7bNG8LQkwRAu0lAJ91us4xz7gD86y6jkmhxe u54+GNzwCeOwGm f7B+z8DaGrAVXTWFjlkgPPo= =rCW0 -----END PGP SIGNATURE----- |
| |||
| Martijn van Oosterhout wrote: > What distribution? I've never seen this "postgres" database you speak > of. It certainly not on any systems I've used. It's new in 8.1 and is used as the default connection database for createdb, etc. Best Regards, Michael Paesold ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| |||
| Martijn van Oosterhout wrote: >On Fri, Nov 18, 2005 at 12:01:31AM +1100, John Hansen wrote: > > >>On a fresh installation of postgrsql 8.1 if you drop the >>'postgres' database, >>psql, createdb, etc. no longer works. >> >>psql -l; ignores -dtemplate1, and createdb doesn't have such an option. >> >> > >What distribution? I've never seen this "postgres" database you speak >of. It certainly not on any systems I've used. Do you have a PGDATABASE >variable in your environment? > > > The 8.1 release notes have this: * Make initdb create a new standard database called postgres, and convert utilities to use postgres rather than template1 for standard lookups (Dave) In prior releases, template1 was used both as a default connection for utilities like createuser, and as a template for new databases. This caused CREATE DATABASE to sometimes fail, because a new database cannot be created if anyone else is in the template database. With this change, the default connection database is now postgres, meaning it is much less likely someone will be using template1 during CREATE DATABASE. cheers andrew ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| |||
| On 11/17/05, Martijn van Oosterhout <kleptog@svana.org> wrote: > On Fri, Nov 18, 2005 at 12:01:31AM +1100, John Hansen wrote: > > On a fresh installation of postgrsql 8.1 if you drop the > > 'postgres' database, > > psql, createdb, etc. no longer works. > > > > psql -l; ignores -dtemplate1, and createdb doesn't have such an option. > > What distribution? I've never seen this "postgres" database you speak > of. It certainly not on any systems I've used. Do you have a PGDATABASE > variable in your environment? > > Have a nice day, > -- > Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > > tool for doing 5% of the work and then sitting around waiting for someone > > else to do the other 95% so you can sue them. > > That database exists beginning with 8.1... I don't think it's optional... i remember a comments from Tom telling that this database will be used to connect to for CREATE DATABASE porpouses: http://archives.postgresql.org/pgsql...6/msg00302.php -- regards, Jaime Casanova (DBA: DataBase Aniquilator ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| |||
| "John Hansen" <john@geeknet.com.au> writes: > Maybe it should fallback to template1 if the postgres database doesn't > exist? [ shrug... ] template1 can be dropped, too. More to the point, if they fall back to connecting to template1, then we lose the very thing we wanted to gain, which is that there aren't transient connections to template1 that might draw CREATE DATABASE's ire. None of these programs are essential -- you can always do "psql mydb" and then execute the operations from within mydb -- so I don't see a pressing need to complicate them to deal with nonstandard environments. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| |||
| John Hansen wrote: > On a fresh installation of postgrsql 8.1 if you drop the > 'postgres' database, > psql, createdb, etc. no longer works. > > psql -l; ignores -dtemplate1, and createdb doesn't have such an option. > I can't test createdb here but on the psql... what happens if you just: psql -Upostgres template1? > Maybe it should fallback to template1 if the postgres database doesn't > exist? > > ... John > > > ---------------------------(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 > ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |
| |||
| Joshua D. Drake wrote: >> psql -l; ignores -dtemplate1, and createdb doesn't have such an option. >> > I can't test createdb here but on the psql... what happens if you just: > > psql -Upostgres template1? It's the '-l' option (list all databases) that does not honor the database given on the command line. This does not work, if the postgres database is dropped in 8.1: psql -l template1 psql -l -d template1 of course "psql template1" will just work fine. Best Regards, Michael Paesold ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| |||
| "Michael Paesold" <mpaesold@gmx.at> writes: > It's the '-l' option (list all databases) that does not honor the database > given on the command line. > This does not work, if the postgres database is dropped in 8.1: > psql -l template1 It does seem a bit inconsistent that psql wouldn't connect to the specified database in order to do -l, if one is specified. Anyone want to look and see if it's easy to change? regards, tom lane ---------------------------(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 |
| ||||
| Tom Lane wrote: >"Michael Paesold" <mpaesold@gmx.at> writes: > > >>It's the '-l' option (list all databases) that does not honor the database >>given on the command line. >>This does not work, if the postgres database is dropped in 8.1: >> >> > > > >>psql -l template1 >> >> > >It does seem a bit inconsistent that psql wouldn't connect to the >specified database in order to do -l, if one is specified. >Anyone want to look and see if it's easy to change? > > The relevant code in startup.c reads: pset.db = PQsetdbLogin(options.host, options.port, NULL, NULL, options.action == ACT_LIST_DB ? "postgres" : options.dbname, username, password); I think we could probably just change the expression to something like: options.action == ACT_LIST_DB && options.dbname == NULL ? "postgres" : options.dbname cheers andrew ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |