Benas
Benas

Reputation: 2332

PostgreSQL delimiter to separate multiple queries in queries file

I have file with multiple queries. How can I separate them using DELIMITER? I tried it like in mysql but it didn't copile:

DELIMITER %

CREATE SEQUENCE logins_seq
  INCREMENT BY 1
  START WITH 1
%

CREATE TABLE logins (
  login_name VARCHAR(64) NOT NULL
)
%

without delimiter it throws error:

CREATE SEQUENCE logins_seq
  INCREMENT BY 1
  START WITH 1


CREATE TABLE logins (
  login_name VARCHAR(64) NOT NULL
)

Upvotes: 1

Views: 3354

Answers (2)

esel
esel

Reputation: 983

The default delimiter that separates statements is by ;, so your queries should already be separated in your file and there is no need to define a delimiter.

Upvotes: 6

Roman Marusyk
Roman Marusyk

Reputation: 24609

Why do you want to use delimiter % in postgresql? You already have delimiter ;

Upvotes: 2

Related Questions