Re: [GENERAL] CREATE DATABASE Š [ TEMPLATE [=] template ] [ TABLESPACE [=] tablespace_name ]

2013-09-26 Thread Giuseppe Broccolo
Il 26/09/2013 13:27, Tim Kane ha scritto: I have a question regarding the behaviour of CREATE DATABASE when used with TEMPLATE and TABLESPACE options together. The documentation describes the tablespace parameter as: The name of the tablespace that will be associated with the new da

Re: [GENERAL] create database from template requires the source database to be unused

2012-06-28 Thread Tom Lane
Alban Hertroys writes: >> I've read that postgres uses MVCC for transactions, and that it creates >> snapshots of the database for each transaction.  Couldn't the create >> database command just use that snapshot? > Database creation cannot be done inside a transaction (one of the few > DDL state

Re: [GENERAL] create database from template requires the source database to be unused

2012-06-28 Thread Alban Hertroys
> I've read that postgres uses MVCC for transactions, and that it creates > snapshots of the database for each transaction.  Couldn't the create > database command just use that snapshot? Database creation cannot be done inside a transaction (one of the few DDL statements that can't), so no. --

Re: [GENERAL] create database from template requires the source database to be unused

2012-06-28 Thread Haszlakiewicz, Eric
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > It'd be really interesting to relax that limitation to "... other > non-read-only transaction ... " and have a database that's being cloned > block or reject > DML, UPDATE, etc. There are some issues wi

Re: [GENERAL] create database from template requires the source database to be unused

2012-06-27 Thread Alban Hertroys
On 28 Jun 2012, at 5:11, Tim Uckun wrote: > I am sure this is intended behavior but it seems odd (and inconvenient) to me. > > create database tim_test_copy template tim_test > > ERROR: source database "tim_test" is being accessed by other users > DETAIL: There are 1 other session(s) using the

Re: [GENERAL] create database from template requires the source database to be unused

2012-06-27 Thread Craig Ringer
On 06/28/2012 11:11 AM, Tim Uckun wrote: I am sure this is intended behavior but it seems odd (and inconvenient) to me. create database tim_test_copy template tim_test ERROR: source database "tim_test" is being accessed by other users DETAIL: There are 1 other session(s) using the database.

Re: [GENERAL] Create database without entering password at command line

2008-05-19 Thread Chris
Nathan Thatcher wrote: > I am trying to automatically create a database right after installing > postgres. I launch the silent install (Windows) from my own executable > and once it is done I need to create a database, tables, etc. I am > trying to find a way to do this without having to explicitly

Re: [GENERAL] CREATE DATABASE

2006-08-04 Thread Rafal Pietrak
On Fri, 2006-08-04 at 00:44 +0400, Nikolay Samokhvalov wrote: > But the logic is clear, isn't it? Connection is not client operation. > I think that Rafal's proposal is quite interesting (I experience the > same difficulties every time. There was several wrong DROP DATABASE in > my career... :-) )

Re: [GENERAL] CREATE DATABASE

2006-08-03 Thread Nikolay Samokhvalov
Thanks. 'connect to' cannot be sent to server as plain text, surely. I'm stupid :-( On 8/4/06, Stephan Szabo <[EMAIL PROTECTED]> wrote: On Fri, 4 Aug 2006, Nikolay Samokhvalov wrote: > On 8/4/06, Nikolay Samokhvalov <[EMAIL PROTECTED]> wrote: > [...] > > BTW, difference vanishes due to expres

Re: [GENERAL] CREATE DATABASE

2006-08-03 Thread Stephan Szabo
On Fri, 4 Aug 2006, Nikolay Samokhvalov wrote: > On 8/4/06, Nikolay Samokhvalov <[EMAIL PROTECTED]> wrote: > [...] > > BTW, difference vanishes due to expression power of SQL - > > it supports session comands in the same context as DDL commands and > > data manipulation stmts (SQL:200n, 4.33.2.5

Re: [GENERAL] CREATE DATABASE

2006-08-03 Thread Nikolay Samokhvalov
On 8/4/06, Nikolay Samokhvalov <[EMAIL PROTECTED]> wrote: [...] BTW, difference vanishes due to expression power of SQL - it supports session comands in the same context as DDL commands and data manipulation stmts (SQL:200n, 4.33.2.5 'SQL-connection statements'). Sorry, I already see my failure

Re: [GENERAL] CREATE DATABASE

2006-08-03 Thread Nikolay Samokhvalov
On 8/4/06, Tom Lane <[EMAIL PROTECTED]> wrote: The reason neither of these are going to happen is that you're confusing a server-side SQL command (viz CREATE DATABASE) with a client-side operation (viz choosing to drop the server connection and make a new one to a different database). Hmm.. I a

Re: [GENERAL] CREATE DATABASE

2006-08-03 Thread Tom Lane
Rafal Pietrak <[EMAIL PROTECTED]> writes: > To put it the other way around: I don't remember me creating a database > and *needing* to stay within the initiator (like template1) - that's why > I've ventured the feature request. If not a 'CONNECT' option, may be z > "SET parameter" for a session use

Re: [GENERAL] CREATE DATABASE

2006-08-03 Thread Rafal Pietrak
On Thu, 2006-08-03 at 18:07 +0100, Richard Huxton wrote: > Rafal Pietrak wrote: > > When working on a new database application I quite frequently: > > --- > > test_xx# \c template1 > > template1# DROP DATABASE test_xx; > > template1# CREATE DATABASE test_xx T

Re: [GENERAL] CREATE DATABASE

2006-08-03 Thread Richard Huxton
Rafal Pietrak wrote: Hi All, I'd like to cast a small 'feature request' here for discussion/ evaluation. The case is the following: When working on a new database application I quite frequently: --- test_xx# \c template1 template1# DROP DATABASE test_

Re: [GENERAL] CREATE DATABASE question.

2006-07-26 Thread Eric Faulhaber
Karen Hill wrote: > I have an sql file that doesn' t work properly when I do: psql < > mysql.sql . I cannot get it to connect to the database. > > Here what I'd like it to do: > > CREATE DATABASE testdb; > \c testdb; > CREATE TABLE tableTest(var varchar); > > But I get an error on the second li

Re: [GENERAL] Create database bug in 8.1.3 ?

2006-04-11 Thread Florian G. Pflug
Milen Kulev wrote: Hi Listers, I have the following problem (OS= RHELU2 , PG version= 8.1.3) when I try to Create a database : postgres=# CREATE DATABASE world3 TEMPLATE=template1 ENCODING='UTF8' TABLESPACE=tbs1 ; CREATE DATABASE Then I am backup-ing the database (a small toy DB) with pg_

Re: [GENERAL] Create database bug in 8.1.3 ? -> solved

2006-04-09 Thread Tom Lane
Douglas McNaught <[EMAIL PROTECTED]> writes: > "Milen Kulev" <[EMAIL PROTECTED]> writes: >> I can not understand why pg_dump, pg_dumpall have hard-coded "template0" ? > The reason is this: any extra stuff that your database inherited from > template1 (or whatever template you used) will be dumped

Re: [GENERAL] Create database bug in 8.1.3 ? -> solved

2006-04-09 Thread Milen Kulev
McNaught Sent: Sunday, April 09, 2006 4:05 PM To: Milen Kulev Cc: 'William ZHANG'; pgsql-general@postgresql.org Subject: Re: [GENERAL] Create database bug in 8.1.3 ? -> solved "Milen Kulev" <[EMAIL PROTECTED]> writes: > Hi Wiliam, > Than you very much f

Re: [GENERAL] Create database bug in 8.1.3 ? -> solved

2006-04-09 Thread Douglas McNaught
"Milen Kulev" <[EMAIL PROTECTED]> writes: > Hi Wiliam, > Than you very much for your prompt reply. > > I can not understand why pg_dump, pg_dumpall have hard-coded "template0" ? The reason is this: any extra stuff that your database inherited from template1 (or whatever template you used) will b

Re: [GENERAL] Create database bug in 8.1.3 ? -> solved

2006-04-09 Thread Milen Kulev
ODING = 'UTF8' TABLESPACE = tbs1; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of William ZHANG Sent: Sunday, April 09, 2006 2:37 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Create database bug in 8.1.3 ? The backend does

Re: [GENERAL] Create database bug in 8.1.3 ?

2006-04-09 Thread William ZHANG
The backend doesnot save the name of the template database used by "CREATE DATABASE". pg_dump, pg_dumpall have hard code like this: appendPQExpBuffer(buf, " WITH TEMPLATE = template0"); That's why you found the template database is always `template0`. If the backend saves the name of the temp

Re: [GENERAL] CREATE DATABASE on the heap with PostgreSQL?

2004-06-07 Thread Albretch
Gaetano Mendola <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > If you access a table more frequently then other and you have enough > RAM your OS will mantain that table on RAM, don't you think ? > BTW if you trust on your UPS I'm sure you are able to create a RAM > disk and pla

Re: [GENERAL] CREATE DATABASE on the heap with PostgreSQL?

2004-06-06 Thread Gaetano Mendola
Albretch wrote: After RTFM and googling for this piece of info, I think PostgreSQL has no such a feature. Why not? . Isn't RAM cheap enough nowadays? RAM is indeed so cheap that you could design diskless combinations of OS + firewall + web servers entirely running off RAM. Anything needing per