CMDBuild Forum

Cannot delete cards if they are related to a domain

I’ve treied several time to delete a card that is involved into a 1:N relationship. Each time I try to delete it, this kind of error occurs: “SQL state [XX000]; error code [0]; ERROR: failed to find conversion function from unknown to text; nested exception is org.postgresql.util.PSQLException: ERROR: failed to find conversion function from unknown to text, caused by: org.postgresql.util.PSQLException: ERROR: failed to find conversion function from unknown to text”. Have you any ideas on how to fix it?
I’m currently using the CMDBuild 3.3 release of the Software. In the administrator page, I’ve selected that if I have to delete a card involved into a domain, the relationship will be deleted.
Thank you for your support

You talk about delete cards, never classes either domains. And logical deletion of a card with the GUI management interface, no with pgAdmin

Are you trying to delete a card on the side “1” or on the side “N”?

  • Delete card on the “N” side only >> No problem
  • Delete card on the “1” side >> Problems
  1. Edit the card you want to delete
  2. Go to the relations tab
  3. Delete relations with the “N” parts, with other cards. Use the icon trash can for each row
  4. Finally, delete the card

If the card got a combination of “N” sides and “1” sides

You don’t need to enter the administration page at all.

I have the same issue.

The error message is as shown in the attached image
attach

Executing the SQL listed here causes an error.

WITH q AS (
    SELECT
        "Id",
        "IdDomain",
        'inverse' _direction,
        "IdObj2" _source,
        "IdObj1" _target
    FROM
        "Map_AAA-BBB"
    WHERE
        "Status" = 'A'
)
SELECT
    COUNT("Id") _count,
    _cm3_utils_regclass_to_domain_name("IdDomain") _name,
    _direction
FROM
    q
    JOIN (
        SELECT
            "Id" _id,
            "IdClass" :: regclass _idclass,
            "CurrentId" _currentid,
            "User" _user,
            "BeginDate" _begindate,
            "EndDate" _enddate,
            "Status" _status
        FROM
            "AAA" _aaa
        WHERE
            "Id" = '112233'
            AND "Status" = 'A'
    ) x ON q._source = x._id
GROUP BY
    "IdDomain",
    _direction

→ ERROR: failed to find conversion function from unknown to text

If the type is specified as part of the SQL, no error occurred when the SQL is executed.

WITH q AS (
    SELECT
        "Id",
        "IdDomain",
        'inverse' :: text _direction, <===== changed here
        "IdObj2" _source,
...

_count _name _direction
230 AAA-BBB inverse

@tecnoteca Please modify the source code to specify the type.