Business web site - CHAPTER 28 FROM DATABASES TO DATATYPES ]$
CHAPTER 28 FROM DATABASES TO DATATYPES ]$ dropdb company DROP DATABASE ]$ Modifying Existing Databases You can also modify certain aspects of a database by using the ALTER DATABASE command. One such example would be that of renaming an existing database: template1=# ALTER DATABASE company RENAME TO testing; ALTER DATABASE template1=# As with the DROP DATABASE command, you cannot rename a database that has any active connections. Although you can modify other attributes of a database, the ALTER DATABASE command has contained different options in every release since it was added in 7.3, and there will be additional changes in 8.1 as well, so we will refer you to the documentation for your specific version for a complete list of options. Tip You may have noticed that this text often uses all uppercase text for SQL keywords such as ALTER, DATABASE, and RENAME. This is not mandatory; you could accomplish all of the examples in this book using lowercase commands. However, using all uppercase is fairly common practice, and your code will be much more readable if you follow this convention. Working with Schemas Schemas contain a collection of tables, views, functions, and other types of objects, within a single database. Unlike with multiple databases, multiple schemas within a database are designed to allow any user to easily access any of the objects within any of the schemas in the database, as long as they have the proper permissions. A few of the reasons you might want to use schemas include: To organize database objects into logical groups to make them more manageable To allow multiple users to work within one database without interfering with each other To put third-party applications into separate schemas so that they do not collide with the names of existing objects in your database The commands discussed in this section will help you get started using schemas. Creating Schemas You can use the CREATESCHEMA command to create new schemas: CREATE SCHEMA rob;
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.