[odb-users] PostgreSQL 42P01 error

Boris Kolpackov boris at codesynthesis.com
Thu Jun 14 09:09:21 EDT 2018


Сергей Никонов <shprotello at mail.ru> writes:

> When I try to execute a view query generated by ODB I get the following
> error: ""errorMessage": "42P01: ERROR: relation \"config_item_attribute_shape\"
> does not exist. At the same time the query works in PostgreSQL Admin panel 4.
>
> PREPARE SELECT DISTINCT "i"."id_code", "i"."id_customization", "i"."type",
> "i"."description", "s_config_item_attribute_shape"."kind",
> "s_config_item_attribute"."id", "s_config_item_attribute"."typeid",
> "s_config_item_attribute"."owner_code",
> "s_config_item_attribute"."owner_customization",
> "s_config_item_attribute"."description" FROM "config_item_attribute_shape"
> AS "s_config_item_attribute_shape" LEFT JOIN "config_item_attribute" AS
> "s_config_item_attribute" ON
> "s_config_item_attribute"."id"="s_config_item_attribute_shape"."id" LEFT
> JOIN "config_item" AS "i" ON
> "s_config_item_attribute"."owner_code"="i"."id_code" AND
> "s_config_item_attribute"."owner_customization"="i"."id_customization" WHERE
> ("s_config_item_attribute_shape"."id" IS NOT NULL) AND ("i"."id_code" LIKE
> $1)
> 
> This is the definition of the view:
> #pragma db view object(item_attribute_shape = s) \
>                 object(item = i : s::m_owner) \
>                 query(s::m_id.is_not_null() && (?), distinct)
>     struct shaped_items
>     {
>       std::shared_ptr<item> i;
>       std::shared_ptr<item_attribute_shape> s;
>     };

I don't see anything clearly wrong with this. What is 'config_item_attribute'?
In fact, if you could come up with a small test that reproduces the problem,
that would probably be the best way forward.



More information about the odb-users mailing list