Tom Lane wrote:
Greg Stark writes:
On Wed, Nov 4, 2009 at 3:17 AM, Emmanuel Cecchet wrote:
SELECT DISTINCT ON ('1'::varchar, '1'::varchar) a FROM (SELECT 1 AS a) AS a
ORDER BY '1'::varchar, '1'::varchar, '2'::varchar;
This sounds familiar. What version of Postgres are y
Greg Stark writes:
> On Wed, Nov 4, 2009 at 3:17 AM, Emmanuel Cecchet wrote:
>> SELECT DISTINCT ON ('1'::varchar, '1'::varchar) a FROM (SELECT 1 AS a) AS a
>> ORDER BY '1'::varchar, '1'::varchar, '2'::varchar;
> This sounds familiar. What version of Postgres are you testing this on?
Presumabl
On Nov 3, 2009, at 10:17 PM, Emmanuel Cecchet
wrote:
Hi all,
It looks like Postgres has a restriction in DISTINCT ON queries
where the DISTINCT ON expressions must match the left side of the
ORDER BY list. The issue is that if a DISTINCT ON ... has multiple
instances of a particular ex
On Wed, Nov 4, 2009 at 3:17 AM, Emmanuel Cecchet wrote:
> For example, this query returns an error (but I guess it shouldn't):
>
> SELECT DISTINCT ON ('1'::varchar, '1'::varchar) a FROM (SELECT 1 AS a) AS a
> ORDER BY '1'::varchar, '1'::varchar, '2'::varchar;
This sounds familiar. What version
Hi all,
It looks like Postgres has a restriction in DISTINCT ON queries where the
DISTINCT ON expressions must match the left side of the ORDER BY list. The
issue is that if a DISTINCT ON ... has multiple instances of a particular
expression, this check doesn't seem to fire correctly.
For exa