Coder Social home page Coder Social logo

Comments (5)

alfer-edb avatar alfer-edb commented on June 14, 2024

UPDATE:

I found something odd, if I run the query above as postgres user i get:

ann1=# SELECT
            typname AS name, oid, typarray AS array_oid,
            oid::regtype::text AS regtype, typdelim AS delimiter
        FROM pg_type t
        WHERE t.oid = to_regtype('vector')
        ORDER BY t.oid;
  name  |  oid  | array_oid | regtype | delimiter
--------+-------+-----------+---------+-----------
 vector | 24755 |     24793 | vector  | ,

While as ann1 user:

ann1=> SELECT
            typname AS name, oid, typarray AS array_oid,
            oid::regtype::text AS regtype, typdelim AS delimiter
        FROM pg_type t
        WHERE t.oid = to_regtype('vector')
        ORDER BY t.oid;
 name | oid | array_oid | regtype | delimiter
------+-----+-----------+---------+-----------
(0 rows)

However, if I replace the function to_regtype('vector') with oid 24755 I get:

ann1=> SELECT
            typname AS name, oid, typarray AS array_oid,
            oid::regtype::text AS regtype, typdelim AS delimiter
        FROM pg_type t
        WHERE t.oid = 24755
        ORDER BY t.oid;
  name  |  oid  | array_oid |    regtype     | delimiter
--------+-------+-----------+----------------+-----------
 vector | 24755 |     24793 | vectors.vector | ,
(1 row)

For some reasons the function to_regtype is returning null. The user ann1 has been granted all privileges.

from pgvecto.rs.

VoVAllen avatar VoVAllen commented on June 14, 2024

Looks like some kind of permission issue. Have you tried grant permission to the user for the vectors schema and change the search path to include the schema?

from pgvecto.rs.

cutecutecat avatar cutecutecat commented on June 14, 2024

Can you show me the result of:

SHOW search_path;

And try this:

SET search_path = "$user", public, vectors';

in your session?

from pgvecto.rs.

alfer-edb avatar alfer-edb commented on June 14, 2024

Here is the output:

postgres@ip-172-16-0-56:~$ psql -d ann1 -U ann1
psql (16.2 (Ubuntu 16.2-1.pgdg22.04+1))
Type "help" for help.

ann1=> SHOW search_path;
       search_path
--------------------------
 "$user", public, vectors
(1 row)

ann1=> SET search_path = "$user", public, vectors;
SET
ann1=> SELECT
            typname AS name, oid, typarray AS array_oid,
            oid::regtype::text AS regtype, typdelim AS delimiter
        FROM pg_type t
        WHERE t.oid = to_regtype('vector')
        ORDER BY t.oid;
 name | oid | array_oid | regtype | delimiter
------+-----+-----------+---------+-----------
(0 rows)

ann1=> SELECT
            typname AS name, oid, typarray AS array_oid,
            oid::regtype::text AS regtype, typdelim AS delimiter
        FROM pg_type t
        WHERE t.oid = 24755
        ORDER BY t.oid;
  name  |  oid  | array_oid |    regtype     | delimiter
--------+-------+-----------+----------------+-----------
 vector | 24755 |     24793 | vectors.vector | ,
(1 row)

This is with pg16.2, I'll try with pg15 soon to see if the issue persists.

from pgvecto.rs.

alfer-edb avatar alfer-edb commented on June 14, 2024

@VoVAllen I checked and in fact my non-privileged user did not have permissions to use the extension. I just ran GRANT ALL ON SCHEMA vectors to ann1 as postgres user and the issue is solved :)

Closing the issue, thank you everyone.

from pgvecto.rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.