8000 getting ` Data insertion failed: ERROR: unnamed portal not found (SQLSTATE XX000)` while inserting array using pgx · Issue #11365 · risingwavelabs/risingwave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

getting Data insertion failed: ERROR: unnamed portal not found (SQLSTATE XX000) while inserting array using pgx #11365

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

Open
abhyuday26 opened this issue Aug 1, 2023 · 3 comments · May be fixed by #21137
Assignees
Labels
type/bug Type: Bug. Only for issues.
Milestone

Comments

@abhyuday26
Copy link
abhyuday26 commented Aug 1, 2023

Describe the bug

While inserting array in risingwave using golang (pgx) this issue was faced.

Error message/log

frontend-node-0  |   2023-08-01T09:32:09.064419164Z ERROR pgwire::pg_protocol: error when process message, error: Not supported: param type: varchar[]
frontend-node-0  | HINT: 
frontend-node-0  |     at src/utils/pgwire/src/pg_protocol.rs:175
frontend-node-0  | 
frontend-node-0  |   2023-08-01T09:32:09.064490145Z ERROR pgwire::pg_protocol: error when process message, error: unnamed portal not found
frontend-node-0  |     at src/utils/pgwire/src/pg_protocol.rs:175
frontend-node-0  | 
frontend-node-0  |   2023-08-01T09:32:09.064530464Z ERROR pgwire::pg_protocol: error when process message, error: unnamed portal not found
frontend-node-0  |     at src/utils/pgwire/src/pg_protocol.rs:175
frontend-node-0  |

To Reproduce

Create table using below query

		CREATE TABLE IF NOT EXISTS taxi (
			taxi_id VARCHAR PRIMARY KEY,
			passengers VARCHAR[],
			license_plate VARCHAR,
			company VARCHAR,
			expiration_date DATE,
			driver VARCHAR
		)

Insert the following values into the table using golang (pgx)

        taxiID := "FAST0001"
	passengers := []string{"ABCD1234", "ABCD1235", "ABCD1236", "ABCD1237"}
	licensePlate := "N5432N"
	company := "FAST TAXI"
	expirationDate := "2030-12-31"
	driver := "DAVID WANG"
	insertTaxiQuery := `
		INSERT INTO taxi (taxi_id, passengers, license_plate, company, expiration_date, driver)
		VALUES ($1, $2, $3, $4, $5, $6)```

Expected behavior

No response

How did you deploy RisingWave?

No response

The version of RisingWave

dev=> select version();
                                  version                                   
----------------------------------------------------------------------------
 PostgreSQL 8.3-RisingWave-1.0.0 (c320675ef628c0c8d6bab7d60b90141d9c41adf2)
(1 row)

Additional context

No response

@abhyuday26 abhyuday26 added the type/bug Type: Bug. Only for issues. label Aug 1, 2023
@github-actions github-actions bot added this to the release-1.2 milestone Aug 1, 2023
@fuyufjh
Copy link
Collaborator
fuyufjh commented Aug 1, 2023

@xiangjinwu We seemed to have discussed on this? Please help to take a look ❤️

@xiangjinwu
Copy link
Contributor

Not supported: param type: varchar[]

Workaround: set pgx to QueryExecModeExec so that array is sent in text mode rather than binary mode.
Solution: #7949 support binary mode for 1d array

@neverchanje
Copy link
Contributor
neverchanje commented Aug 8, 2023
	cfg, err := pgx.ParseConfig("postgres://root@localhost:4566/dev")
	if err != nil {
		log.Fatalf("Failed to parse config: %v", err)
	}
	// TODO: Investigate into why simple protocol is required
	cfg.DefaultQueryExecMode = pgx.QueryExecModeSimpleProtocol

Setting it to the QueryExecModeSimpleProtocol should work. But this issue is still what we need to resolve later. Because the extended protocol is theoriotically more efficient.

@xiangjinwu xiangjinwu linked a pull request Mar 27, 2025 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Type: Bug. Only for issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
0