Re: Ltree syntax improvement

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Dmitry Belyavsky <beldmit(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Nikolay Shaplov <dhyan(at)nataraj(dot)su>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Ltree syntax improvement
Date: 2019-07-11 08:19:31
Message-ID: CA+hUKG+G7fP-t43ptqkBw9aW2zQuazN2g_U9yCX6dN9E65u4tw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 10, 2019 at 7:40 AM Dmitry Belyavsky <beldmit(at)gmail(dot)com> wrote:
> [ltree_20190709.diff]

Hi Dmitry,

You need to update contrib/ltree_plpython/expected/ltree_plpython.out,
otherwise check-world fails when built with Python support. The good
news is that it looks like it fails because you fixed something!
(Though I didn't check the details).

CREATE FUNCTION test2() RETURNS ltree
LANGUAGE plpythonu
TRANSFORM FOR TYPE ltree
AS $$
return ['foo', 'bar', 'baz']
$$;
-- plpython to ltree is not yet implemented, so this will fail,
-- because it will try to parse the Python list as an ltree input
-- string.
SELECT test2();
-ERROR: syntax error at position 0
-CONTEXT: while creating return value
-PL/Python function "test2"
+ test2
+-------------------------
+ "['foo', 'bar', 'baz']"
+(1 row)
+

--
Thomas Munro
https://enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergei Kornilov 2019-07-11 09:08:20 Re: pg_stat_statements vs. SELECT FOR UPDATE
Previous Message David Fetter 2019-07-11 07:47:24 Re: [HACKERS] [PATCH] Generic type subscripting