Hello World Wrapper
Peterksharma opened this issue · 5 comments
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
There is no function for hello_world_fdw_handler()
CREATE FOREIGN DATA WRAPPER helloworld_wrapper
HANDLER hello_world_fdw_handler
VALIDATOR hello_world_fdw_validator;
Always returns this error.
ERROR: function hello_world_fdw_handler() does not exist
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Have a local instance of Supabase running
- Download the Repo for the wrapper
- install the hello world fdw.
Expected behavior
Getting data from Postgres.
Screenshots
System information
-Mac M2
Additional context
Can't find any other people that have documented having the same problem.
Try dropping and recreating the extension. It is possible that an older version is installed which doesn't have the helloworld fdw enabled. This worked for me:
➜ cargo pgrx run pg15 --package wrappers --features helloworld_fdw
psql (15.6)
Type "help" for help.
wrappers=# select * from pg_extension;
oid | extname | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
--------+----------+----------+--------------+----------------+------------+-----------+--------------
13017 | plpgsql | 10 | 11 | f | 1.0 | |
176511 | wrappers | 10 | 2200 | f | 0.2.0 | |
107293 | vector | 10 | 2200 | t | 0.5.0 | |
(3 rows)
wrappers=# drop extension wrappers cascade;
NOTICE: drop cascades to foreign-data wrapper helloworld_wrapper
DROP EXTENSION
wrappers=# create extension wrappers;
CREATE EXTENSION
wrappers=# create foreign data wrapper helloworld_wrapper handler hello_world_fdw_handler validator hello_world_fdw_validator;
CREATE FOREIGN DATA WRAPPER
wrappers=#
@Peterksharma , you probably forgot to run create extension wrappers;
. This is essential to install wrappers extension to postgres. Just follow imor's steps listed above and you should be able to get through.
@Peterksharma , you probably forgot to run
create extension wrappers;
. This is essential to install wrappers extension to postgres. Just follow imor's steps listed above and you should be able to get through.
can confirm I did this step. without the OR REPLACE it errors with already added. That's why its missing from the screenshot.
You need to drop and recreate the extension. Follow the exact steps in my previous comment and it will work. I was able to "reproduce" if I do something like this:
➜ cargo pgrx run pg15 --package wrappers --features stripe_fdw
wrappers=# create extension wrappers;
CREATE EXTENSION
wrappers=# exit
➜ cargo pgrx run pg15 --package wrappers --features helloworld_fdw
wrappers=# create foreign data wrapper helloworld_wrapper handler hello_world_fdw_handler validator hello_world_fdw_validator;
ERROR: function hello_world_fdw_handler() does not exist
Why it fails in this case is because during the first run when the extension was created the --features
flag was something other than helloworld_fdw
. It is quite possible something similar happened in your case.