Database schema
Hi All,
I have created a database name '"ofbiz". then the default schema name "public " created automatically. I want to create schema name ofbiz in the database "ofbiz"
when I create database name "ofbiz" then the schema name "ofbiz" will create automatically.
how it is possible if yes,
Thanks
Dhiraj Gupta
Import Notes
Reply to msg id not found: fb270f9537f2.50bc394b@nic.inReference msg id not found: fb270f9537f2.50bc394b@nic.in
I have created a database name '"ofbiz". then the default schema name
"public " created automatically. I want to create schema name ofbiz in the
database "ofbiz"
when I create database name "ofbiz" then the schema name "ofbiz" will
create automatically.
how it is possible if yes,
Pre-create the schema in the database that's used as a template when
creating database ofbiz.
It's all in the docs.
Karsten
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Dhiraj Gupta wrote:
I have created a database name '"ofbiz". then the default schema name "public "
created automatically. I want to create schema name ofbiz in the database "ofbiz"
when I create database name "ofbiz" then the schema name "ofbiz" will create automatically.
how it is possible if yes,
There is no way to automatically create a schema when you create a database.
Connect to the newly created database and create it with CREATE SCHEMA.
You can DROP SCHEMA public if you don't need it.
Yours,
Laurenz Albe
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Dhiraj --
________________________________
From: Dhiraj Gupta <dhiraj.g@nic.in>
To: pgsql-general@postgresql.org
Sent: Sunday, December 2, 2012 9:35 PM
Subject: [GENERAL] Database schemaHi All,
I have created a database name '"ofbiz". then the default schema name "public " created automatically. I want to create schema name ofbiz in the database "ofbiz"
when I create database name "ofbiz" then the schema name "ofbiz" will create automatically.
how it is possible if yes,Thanks
Dhiraj Gupta
When a new database is created, the template is the builtin database called "template1".
If you create the schema in that database, that schema will be made part of any new database you make. You could also make a new template database, create the schema in that one, and then create your new databases using the "WITH TEMPLATE = " option in CREATE DATABASE. So if you have need of different schemas with different databases, that would be more extensible by making new templates, onjhe3 for each type./.
HTH,
Greg Williamson
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
Dhiraj Gupta wrote:
I have� created a database name '"ofbiz". then the default� schema name "public "
created automatically. I want to create schema name ofbiz in the database "ofbiz"
�when I create database name "ofbiz" then the schema name "ofbiz" will create automatically.
how it is possible if yes,There is no way to automatically create a schema when you create a database.
Connect to the newly created database and create it with CREATE SCHEMA.
You can DROP SCHEMA public if you don't need it.
There is a way to create a so called schema in every new created
database: create that schema in the template1, or create a new template
database and use this template to create a new database.
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082�, E 13.56889�
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Andreas Kretschmer wrote:
Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
Dhiraj Gupta wrote:
I have created a database name '"ofbiz". then the default schema name "public "
created automatically. I want to create schema name ofbiz in the database "ofbiz"
when I create database name "ofbiz" then the schema name "ofbiz" will create automatically.
how it is possible if yes,There is no way to automatically create a schema when you create a database.
Connect to the newly created database and create it with CREATE SCHEMA.
You can DROP SCHEMA public if you don't need it.There is a way to create a so called schema in every new created
database: create that schema in the template1, or create a new template
database and use this template to create a new database.
Technically you are right, but from the original question I assumed
that the schema should have the same name as the database.
Yours,
Laurenz Albe
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general