Skip to content

Commit

Permalink
fix bug in validate + increase timeout for risedev:postgres service
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Nov 20, 2024
1 parent 2e7b7f7 commit 1c4eb53
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
25 changes: 20 additions & 5 deletions src/connector/src/sink/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,26 @@ impl Sink for PostgresSink {
let result = client
.query(
"
SELECT a.attname as col_name, i.indisprimary AS is_pk
FROM pg_index i
JOIN pg_attribute a ON a.attrelid = i.indrelid
AND a.attnum = ANY(i.indkey)
WHERE i.indrelid = $1::regclass",
SELECT
column_name,
EXISTS (
SELECT 1
FROM pg_index i
WHERE i.indrelid = c.table_name::regclass
AND i.indisprimary
AND column_name = ANY(
SELECT a.attname
FROM pg_attribute a
WHERE a.attrelid = i.indrelid
AND a.attnum = ANY(i.indkey)
)
) AS is_primary_key
FROM
information_schema.columns c
WHERE
table_name = $1
ORDER BY
ordinal_position;",
&[&table_name],
)
.await
Expand Down
2 changes: 1 addition & 1 deletion src/risedevtool/src/task/task_log_ready_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ where
&mut self.log,
self.status_file.as_ref().unwrap(),
self.id.as_ref().unwrap(),
Some(Duration::from_secs(30)),
Some(Duration::from_secs(60)),
true,
)?;

Expand Down

0 comments on commit 1c4eb53

Please sign in to comment.