Reputation: 1512
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?
Upvotes: 15
Views: 27584
Reputation: 263913
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);
Upvotes: 23