Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdb/pgsql: Please support pgsql's _NUMERIC type #4138

Open
ivothgle opened this issue Jan 23, 2025 · 0 comments
Open

gdb/pgsql: Please support pgsql's _NUMERIC type #4138

ivothgle opened this issue Jan 23, 2025 · 0 comments
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.

Comments

@ivothgle
Copy link
Contributor

Go version

go1.23

GoFrame version

2.7.0

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

创建这样的 表

CREATE TABLE "public"."无标题" (
  "id" int4 NOT NULL,
  "n1" numeric(10,2),
  "n2" []numeric,
  PRIMARY KEY ("id")
)
;

如果查询 n2 或者对 n1 进行 ARRAY_AGG(n1) 返回的类型都是 _NUMERIC

What did you see happen?

然后在 https://github.com/gogf/gf/blob/master/contrib/drivers/pgsql/pgsql_convert.go 没有适配这个类型导致无法识别成数组
然后 在 database/gdb/gdb_core_structure.go 匹配中了

		case strings.Contains(typeName, "float") || strings.Contains(typeName, "double") || strings.Contains(typeName, "numeric"):
			return LocalTypeFloat64, nil

导致直接丢失数组,返回 0

What did you expect to see?

请修正

@ivothgle ivothgle added the bug It is confirmed a bug, but don't worry, we'll handle it. label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.
Projects
None yet
Development

No branches or pull requests

1 participant