I' m running postgres in a docker image:. Exec( ` create database $ 1`, " foo" ) / / _, err : = db. go run / tmp/ db. go pq: syntax error at or near " $ 1". ERROR: syntax error at or near " $ ". LINE 1: CREATE ROLE. postgres= # ALTER ROLE log_ user CREATEROLE CREATEDB;. In case of difficulty, see DROP DATABASE and psql for discussions of potential problems and error messages. The database server must be running at the. postgres- # creatdb test postgres- # \ list List of databases Name | Owner.
postgres= # createdb test; ERROR: syntax error at or near " createdb" LINE 1: createdb. To create a database from psql, use the create database statement like so:. postgres= > createdb foobar; ERROR: syntax error at or near. postgres= # CREATE DATABASE u1- app- be; ERROR: syntax error at or near " - " LINE 1: CREATE DATABASE u1- app- be;. Tried changing to. CREATE DATABASE creates a new PostgreSQL database. Errors along the line of " could not initialize database directory" are most likely related to insufficient. The specified locale and encoding settings must match, or an error will be reported. This works fine: postgres= # create table hosts ( type varchar( 20), name varchar( 20) ) ; CREATE TABLE postgres= # \ q psql - c " insert into.