Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb688f8f

Browse files
author
Thomas G. Lockhart
committed
Fix query for primary keys to reflect new DISTINCT ON () syntax.
Reported by "Tibor Laszlo" <ltibor@mail.tiszanet.hu> and fix suggested by "Hiroshi Inoue" <Inoue@tpf.co.jp>.
1 parentdcdcada commitb688f8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/interfaces/odbc/info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,7 @@ Int2 result_cols;
21352135
returnSQL_ERROR;
21362136
}
21372137

2138-
sprintf(tables_query,"select distinct on attnum a2.attname, a2.attnum from pg_attribute a1, pg_attribute a2, pg_class c, pg_index i where c.relname = '%s_pkey' AND c.oid = i.indexrelid AND a1.attrelid = c.oid AND a2.attrelid = c.oid AND (i.indkey[0] = a1.attnum OR i.indkey[1] = a1.attnum OR i.indkey[2] = a1.attnum OR i.indkey[3] = a1.attnum OR i.indkey[4] = a1.attnum OR i.indkey[5] = a1.attnum OR i.indkey[6] = a1.attnum OR i.indkey[7] = a1.attnum) order by a2.attnum",pktab);
2138+
sprintf(tables_query,"select distinct on(attnum) a2.attname, a2.attnum from pg_attribute a1, pg_attribute a2, pg_class c, pg_index i where c.relname = '%s_pkey' AND c.oid = i.indexrelid AND a1.attrelid = c.oid AND a2.attrelid = c.oid AND (i.indkey[0] = a1.attnum OR i.indkey[1] = a1.attnum OR i.indkey[2] = a1.attnum OR i.indkey[3] = a1.attnum OR i.indkey[4] = a1.attnum OR i.indkey[5] = a1.attnum OR i.indkey[6] = a1.attnum OR i.indkey[7] = a1.attnum) order by a2.attnum",pktab);
21392139

21402140
mylog("SQLPrimaryKeys: tables_query='%s'\n",tables_query);
21412141

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp