Re: Displaying chat by punished users only to themselves (db fiddle attached) - Mailing list pgsql-general

From David G. Johnston
Subject Re: Displaying chat by punished users only to themselves (db fiddle attached)
Date
Msg-id CAKFQuwZ5gvocEerjANkWP5eA3aE-23oBsZU+Sf5=_WbhoxV8Wg@mail.gmail.com
Whole thread Raw
In response to Re: Displaying chat by punished users only to themselves (db fiddle attached)  (Alexander Farber <alexander.farber@gmail.com>)
Responses Re: Displaying chat by punished users only to themselves (db fiddle attached)
List pgsql-general
On Wed, May 4, 2022 at 8:53 AM Alexander Farber <alexander.farber@gmail.com> wrote:

        JOIN    cte
        WHERE   c.gid    = in_gid
        AND     (c.uid = myself.uid OR NOT opponent.muted)
        ORDER BY c.CREATED ASC;

ERROR:  syntax error at or near "WHERE"
LINE 67:         WHERE   c.gid    = in_gid
                 ^

And if I remove the "JOIN cte" line, then the error is:

ERROR:  missing FROM-clause entry for table "cte"
LINE 64: ...elf.uid IN (g.player1, g.player2) AND myself.uid = cte.uid) 

Try "CROSS JOIN cte" - that variant doesn't require a join condition.

pgsql-general by date:

Previous
From: Alexander Farber
Date:
Subject: Re: Displaying chat by punished users only to themselves (db fiddle attached)
Next
From: Alexander Farber
Date:
Subject: Re: Displaying chat by punished users only to themselves (db fiddle attached)