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

wrong SQL SELECT in readme #1347

Open
remote4me opened this issue Mar 3, 2024 · 0 comments
Open

wrong SQL SELECT in readme #1347

remote4me opened this issue Mar 3, 2024 · 0 comments

Comments

@remote4me
Copy link

remote4me commented Mar 3, 2024

Environment: Ubuntu 22.04, Self-hosted Postgresml installed in Postgresql 13 database

I am following instructions here (under "Vector Database", "Step 3: Querying the index using embeddings for your queries"):
https://github.com/postgresml/postgresml?tab=readme-ov-file#vector-database

This SQL does not works:

WITH query AS (
    SELECT pgml.embed('distilbert-base-uncased', 'Star Wars christmas special is on Disney')::vector AS embedding
)
SELECT * FROM items, query ORDER BY items.embedding <-> query.embedding LIMIT 5;

Error message:

ERROR: relation "items" does not exist
  Position: 152

SELECT * FROM items, query ORDER BY items.embedding <-> query.embedding LIMIT 5
              ^
1 statement failed.

But this SQL works (without index - index creation failed, this is another issue):

WITH query AS (
    SELECT pgml.embed('distilbert-base-uncased', 'Star Wars christmas special is on Disney')::vector AS embedding
)
SELECT * FROM public.tweet_embeddings, query 
ORDER BY 
  public.tweet_embeddings.embedding::vector <-> query.embedding 
LIMIT 5;
@remote4me remote4me changed the title wrong SQL in readme wrong SQL SELECT in readme Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant