I've a script:
CREATE DATABASE ahop
GO
CREATE TABLE shop.dbo.TABLE1 ( 
); 
CREATE TABLE shop.dbo.TABLEN ( 
); 
But it doesn't seem to work in PostgreSQL. Error message: "error near GO". I dont get it, how to create scripts in Postgresql?
A single Postgres server process can manage multiple databases at the same time. Each database is stored as a separate set of files in its own directory within the server's data directory. To view all of the defined databases on the server you can use the \list meta-command or its shortcut \l .
Replace the T-SQL batch terminator GO with the PostgreSQL batch terminator ;.GO is not supported in postgreSQL
you need to connect on the database using \. eg,
 CREATE DATABASE testdatabase; 
 \c testdatabase 
 CREATE TABLE testtable (testcolumn int); 
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With