Postgres: How to create index concurrently using liquibase
up vote
3
down vote
favorite
Looking at the liquibase documention http://www.liquibase.org/documentation/changes/create_index.html, CIC is not possible with create index, as liquibase doesn't have a tag to specify concurrent option.
Is there a way to create index concurrently with liquibase?
indexing liquibase
add a comment |
up vote
3
down vote
favorite
Looking at the liquibase documention http://www.liquibase.org/documentation/changes/create_index.html, CIC is not possible with create index, as liquibase doesn't have a tag to specify concurrent option.
Is there a way to create index concurrently with liquibase?
indexing liquibase
You need a<sql>
tag with the appropriateCREATE INDEX
statement
– a_horse_with_no_name
Mar 15 at 13:26
I see this error CREATE INDEX CONCURRENTLY cannot run inside a transaction block. I'm assuming migrations are run in transaction to rollback if necessary. Is there something I'm doing wrong?
– user4988095
Mar 15 at 16:30
@user4988095 yes, each changeset is executed in transaction
– dbf
Mar 17 at 7:23
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
Looking at the liquibase documention http://www.liquibase.org/documentation/changes/create_index.html, CIC is not possible with create index, as liquibase doesn't have a tag to specify concurrent option.
Is there a way to create index concurrently with liquibase?
indexing liquibase
Looking at the liquibase documention http://www.liquibase.org/documentation/changes/create_index.html, CIC is not possible with create index, as liquibase doesn't have a tag to specify concurrent option.
Is there a way to create index concurrently with liquibase?
indexing liquibase
indexing liquibase
asked Mar 15 at 13:20
user4988095
163
163
You need a<sql>
tag with the appropriateCREATE INDEX
statement
– a_horse_with_no_name
Mar 15 at 13:26
I see this error CREATE INDEX CONCURRENTLY cannot run inside a transaction block. I'm assuming migrations are run in transaction to rollback if necessary. Is there something I'm doing wrong?
– user4988095
Mar 15 at 16:30
@user4988095 yes, each changeset is executed in transaction
– dbf
Mar 17 at 7:23
add a comment |
You need a<sql>
tag with the appropriateCREATE INDEX
statement
– a_horse_with_no_name
Mar 15 at 13:26
I see this error CREATE INDEX CONCURRENTLY cannot run inside a transaction block. I'm assuming migrations are run in transaction to rollback if necessary. Is there something I'm doing wrong?
– user4988095
Mar 15 at 16:30
@user4988095 yes, each changeset is executed in transaction
– dbf
Mar 17 at 7:23
You need a
<sql>
tag with the appropriate CREATE INDEX
statement– a_horse_with_no_name
Mar 15 at 13:26
You need a
<sql>
tag with the appropriate CREATE INDEX
statement– a_horse_with_no_name
Mar 15 at 13:26
I see this error CREATE INDEX CONCURRENTLY cannot run inside a transaction block. I'm assuming migrations are run in transaction to rollback if necessary. Is there something I'm doing wrong?
– user4988095
Mar 15 at 16:30
I see this error CREATE INDEX CONCURRENTLY cannot run inside a transaction block. I'm assuming migrations are run in transaction to rollback if necessary. Is there something I'm doing wrong?
– user4988095
Mar 15 at 16:30
@user4988095 yes, each changeset is executed in transaction
– dbf
Mar 17 at 7:23
@user4988095 yes, each changeset is executed in transaction
– dbf
Mar 17 at 7:23
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
You can specify runInTransaction
as false
to create the index concurrently.
add a comment |
up vote
0
down vote
Creating a concurrent index must be done with the arbitrary sql change:
<changeSet runInTransaction="false" id="10-add-widgets-kind-index" author="username">
<sql dbms="postgresql">
CREATE INDEX CONCURRENTLY
IF NOT EXISTS idx_widgets_kind
ON widgets(kind)
</sql>
</changeSet>
This is a combination of a_horse_with_no_name's comment and TheDude's answer.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You can specify runInTransaction
as false
to create the index concurrently.
add a comment |
up vote
1
down vote
You can specify runInTransaction
as false
to create the index concurrently.
add a comment |
up vote
1
down vote
up vote
1
down vote
You can specify runInTransaction
as false
to create the index concurrently.
You can specify runInTransaction
as false
to create the index concurrently.
answered Jun 11 at 19:36
TheDude
2,69521940
2,69521940
add a comment |
add a comment |
up vote
0
down vote
Creating a concurrent index must be done with the arbitrary sql change:
<changeSet runInTransaction="false" id="10-add-widgets-kind-index" author="username">
<sql dbms="postgresql">
CREATE INDEX CONCURRENTLY
IF NOT EXISTS idx_widgets_kind
ON widgets(kind)
</sql>
</changeSet>
This is a combination of a_horse_with_no_name's comment and TheDude's answer.
add a comment |
up vote
0
down vote
Creating a concurrent index must be done with the arbitrary sql change:
<changeSet runInTransaction="false" id="10-add-widgets-kind-index" author="username">
<sql dbms="postgresql">
CREATE INDEX CONCURRENTLY
IF NOT EXISTS idx_widgets_kind
ON widgets(kind)
</sql>
</changeSet>
This is a combination of a_horse_with_no_name's comment and TheDude's answer.
add a comment |
up vote
0
down vote
up vote
0
down vote
Creating a concurrent index must be done with the arbitrary sql change:
<changeSet runInTransaction="false" id="10-add-widgets-kind-index" author="username">
<sql dbms="postgresql">
CREATE INDEX CONCURRENTLY
IF NOT EXISTS idx_widgets_kind
ON widgets(kind)
</sql>
</changeSet>
This is a combination of a_horse_with_no_name's comment and TheDude's answer.
Creating a concurrent index must be done with the arbitrary sql change:
<changeSet runInTransaction="false" id="10-add-widgets-kind-index" author="username">
<sql dbms="postgresql">
CREATE INDEX CONCURRENTLY
IF NOT EXISTS idx_widgets_kind
ON widgets(kind)
</sql>
</changeSet>
This is a combination of a_horse_with_no_name's comment and TheDude's answer.
answered Nov 19 at 0:31
sghill
42637
42637
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49300553%2fpostgres-how-to-create-index-concurrently-using-liquibase%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You need a
<sql>
tag with the appropriateCREATE INDEX
statement– a_horse_with_no_name
Mar 15 at 13:26
I see this error CREATE INDEX CONCURRENTLY cannot run inside a transaction block. I'm assuming migrations are run in transaction to rollback if necessary. Is there something I'm doing wrong?
– user4988095
Mar 15 at 16:30
@user4988095 yes, each changeset is executed in transaction
– dbf
Mar 17 at 7:23