我正在尝试设置 postgREST。一直在关注http://postgrest.org/en/v5.1/tutorials/tut0.html上的教程。这是我所看到的。首先,模式:
entercarlson=# \dn
List of schemas
Name | Owner
--------+---------
api | carlson
public | carlson
然后是一张表:
carlson=# \d api.todos
Table "api.todos"
Column | Type | Collation | Nullable | Default
--------+--------------------------+-----------+----------+---------------------------------------
id | integer | | not null | nextval('api.todos_id_seq'::regclass)
done | boolean | | not null | false
task | text | | not null |
due | timestamp with time zone | | |
Indexes:
"todos_pkey" PRIMARY KEY, btree (id)
最后,一些数据:
carlson=# select * from api.todos;
id | done | task | due
----+------+-------------------+-----
1 | f | finish tutorial 0 |
2 | f | pat self on back |
(2 rows)
但后来我明白了:
$ curl http://localhost:3000/todos
{"hint":null,"details":null,"code":"42P01","message":"relation
\"api.todos\" does not exist"}
这与此一致:
carlson=# \d
Did not find any relations.
我究竟做错了什么?
PS。我没有看到这个架构属于哪个数据库