Postgres Creating Schema in a specific database

Viewed 14036

I got one suggestion form stackoverflow.com to create schema in a specific database as follows:

CREATE DATABASE foo; 
 \connect foo; 
CREATE SCHEMA yourschema; 

But I am getting error as follows:

ERROR: syntax error at or near "\" LINE 2: \connect foo; ^

*** Error ***

ERROR: syntax error at or near "\"

Situation :

Login as postgress
create user u1
create database db1 with owner u1
\connect u1
create schema s1

Please help me in creating schema in a specific db.

1 Answers
Related