duckdb / duckdb/duckdb-postgres

When I use postgres_scan an exception occurs: permission denied for table

Open
#177 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
372
Forks
105
Avg merge
10h 19m
Merged PRs (30d)
18

Description

### What happens?

I am using Quickdb 0.9.2.

In my SQL script, I call the postgres_scan command.

I specify the correct data for the connection: host, port, user, and so on. (I checked on other tables).

When I want to make a typical request:

```sql
SELECT
user_id
FROM
postgres_scan('host=**** port=**** dbname=**** user=**** password=****', 'public', 'some_table')
LIMIT 10
```

I'm getting an error:

```log
SQL Error: Invalid Error: Failed to prepare COPY "
COPY (SELECT "user_id" FROM "public"."some_table" WHERE id BETWEEN '(0,0)'::tid AND '(1000,0)'::tid) TO STDOUT (FORMAT binary);
": ERROR: permission denied for table some_table.
```

But the table allows you to get data from it while working with it through PostgreSQL itself.

Remark: In the table, there is a viewing limit for some columns. Perhaps the problem is related to this moment?

### To Reproduce

1) You need to install DuckDB 0.9.2
2) Run the postgres_scan command on a regular SELECT
3) Get an error
4) If there is no error, then check the constraints on the table (columns) and run SELECT again

### OS:

MacOS 14.2.1 (23C71)

### DuckDB Version:

0.9.2

### DuckDB Client:

DBeaver

### Full Name:

Ivan Korsakov

### Affiliation:

By yourself

### Have you tried this on the latest `main` branch?

I have tested with a main build

### Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

- [X] Yes, I have

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.