![]() The IP address or hostname of the server that the database server is installed on. The name of the database that you created in Step 2. Media Server uses this string to connect to the database server. The PostgreSQL Unicode ODBC Driver (psqlODBC) Setup dialog box opens.Ĭomplete the data source information fields: Data Source Select the PostgreSQL Unicode driver from the list and click Finish. The Create New Data Source dialog box opens. The ODBC Data Source Administrator dialog box opens. In the Windows Control Panel, click System and Security. Is the user name that Media Server will connect as. Is the name of the database that you created. GRANT USAGE ON ALL SEQUENCES IN SCHEMA public TO userName GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO userName GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO userName If security is not a consideration you could grant all privileges, but the required privileges are: Databaseįor example: GRANT TEMP ON DATABASE databaseName TO userName Grant privileges to the user that Media Server will connect as. The psql command-line tool does not recognize backslashes in file paths. Replace backslashes in the file path with forward slashes. Run the script using the command: \i 'path/postgres.sql' Micro Focus recommends running the following command to ensure that the script stops running if it encounters an error: \set ON_ERROR_STOP on The schema is inserted inside the public schema. This script sets up the database schema that Media Server requires. Run the postgres.sql script provided in the Media Server installation directory. Database nameĪny that is compatible with the encoding.įor example: CREATE DATABASE myDatabase WITH ENCODING 'UTF8' LC_COLLATE='English_United Kingdom' LC_CTYPE='English_United Kingdom' Ĭonnect to the new database using the command: \c databaseName Run a CREATE DATABASE command to create a new database. In the Windows Command Prompt, run the command: psql -U userName If the directory path is not added to the PATH variable, you must specify the psql.exe file path in the Command Prompt to start psql. Once a database is created using either of the above-mentioned methods, you can check it in the list of databases using \l, i.e.This step enables you to use the command psql to start the PostgreSQL command-line tool (psql) from the Windows Command Prompt. Hence, provide a password and proceed to create your new database The above given command will prompt you for password of the PostgreSQL admin user, which is postgres, by default. Go to the bin directory and execute the following command to create a database.Ĭreatedb -h localhost -p 5432 -U postgres testdb Open the command prompt and go to the directory where PostgreSQL is installed. ![]() ![]() Specifies the TCP port or the local Unix domain socket file extension on which the server is listening for connections.įorce createdb to prompt for a password before connecting to a database. Specifies the host name of the machine on which the server is running. Show help about createdb command line arguments, and exit. Specifies the template database from which to build this database. Specifies the locale to be used in this database. Specifies the character encoding scheme to be used in this database. Specifies the default tablespace for the database.Įcho the commands that createdb generates and sends to the server. The following table lists the command line arguments createdb accepts − S. Specifies a comment to be associated with the newly created database.Ĭommand-line arguments, which createdb accepts. The table given below lists the parameters with their descriptions. The syntax for createdb is as shown below −Ĭreatedb ] The only difference between this command and SQL command CREATE DATABASE is that the former can be directly run from the command line and it allows a comment to be added into the database, all in one command. PostgreSQL command line executable createdb is a wrapper around the SQL command CREATE DATABASE. The following is a simple example, which will create testdb in your PostgreSQL schema Where dbname is the name of a database to create. The basic syntax of CREATE DATABASE statement is as follows − By default, the new database will be created by cloning the standard system database template1. This command will create a database from PostgreSQL shell prompt, but you should have appropriate privilege to create a database. Using createdb a command-line executable.PostgreSQL provides two ways of creating a new database − This chapter discusses about how to create a new database in your PostgreSQL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |