Fix example code in computed relationships
Looks like a copy-paste error - the `films.id` column should be associated with the `premieres.film_id` column.
This commit is contained in:
+1
-1
@@ -1129,7 +1129,7 @@ Now let's define the opposite one-to-many relationship with another function.
|
|||||||
.. code-block:: postgres
|
.. code-block:: postgres
|
||||||
|
|
||||||
create function premieres(films) returns setof premieres as $$
|
create function premieres(films) returns setof premieres as $$
|
||||||
select * from premieres where film_id = $1.director_id
|
select * from premieres where film_id = $1.id
|
||||||
$$ stable language sql;
|
$$ stable language sql;
|
||||||
|
|
||||||
Similarly, this function defines a relationship between the parameter ``films`` and the return type ``premieres``.
|
Similarly, this function defines a relationship between the parameter ``films`` and the return type ``premieres``.
|
||||||
|
|||||||
Reference in New Issue
Block a user