English 中文(简体)
G PQ 司机不能对缺省图象提出质询。
原标题:GO PQ driver cannot query with default schema
  • 时间:2024-03-07 00:23:38
  •  标签:
  • go
  • pq

开放与亚洲开发银行的联系守则:

DB, err = sql.Open("postgres", "dbname=dev user=postgres password=postgres port=5400 sslmode=disable")

I m 试图做一个简单的elect query,如:

err := DB.QueryRow("SELECT id FROM user WHERE id = $1", id)

但我犯了错误:pq:id栏没有

然而,如果我尝试schema:

err := DB.QueryRow("SELECT id FROM public.user WHERE id = $1", id)

罚款。 我不理解为什么我必须写到sch><>m>>>,即使default s programa>/em> 是 public,载于postgresql。 页: 1

问题回答

a. 检查缺省搜查。

SHOW search_path;

如果不是公开的,则规定:

ALTER ROLE your_user SET search_path = public;




相关问题
minimum work size of a goroutine [closed]

Does anyone know approximately what the minimum work size is needed in order for a goroutine to be beneficial (assuming that there are free cores for the work to be offloaded to)?

How do you get the terminal size in Go?

How do I get the terminal size in Go. In C it would look like this: struct ttysize ts; ioctl(0, TIOCGWINSZ, &ts); But how to i access TIOCGWINSZ in Go

What do you use to write Go [closed]

I know its a bit too early, but I ve been trying out Go (Google s Programming Language) and its kindof annoying to write code in gedit. So, my question: What do you use to experiment with Go?

Shared memory vs. Go channel communication

One of Go s slogans is Do not communicate by sharing memory; instead, share memory by communicating. I am wondering whether Go allows two different Go-compiled binaries running on the same machine to ...

Embedding instead of inheritance in Go

What is your opinion of this design decision? What advantages does it have and what disadvantages? Links: Embedding description