PGAdmin4 debugger - unable to call ltree functions

From: "Ian Bell" <ib(at)ianbellsoftware(dot)com>
To: <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: PGAdmin4 debugger - unable to call ltree functions
Date: 2018-04-26 23:27:23
Message-ID: !&!AAAAAAAAAAAYAAAAAAAAADldbAmb6+pIq6nH7MxZl07CgAAAEAAAAKOnNT1W5U1HoPw7q8DC8IUBAAAAAA==@ianbellsoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello,

I have recently started working with the PGAdmin4 debugger and have
encountered a particular problem. The sample code below successfully runs
in PSQL and, with some modifications, also in PGAdmin4. However, when I
use PGAdmin4 debugger to test the function 'TestLtree' then this generates
an error. Specifically, the debugger generates the following error message
when it executes the first call to 'text2ltree':

ERROR: syntax error at position 0

CONTEXT: SQL statement "SELECT exists ( select 1 from TableLtree where
MyPath = text2ltree( MyArg ) )"

PL/pgSQL function testltree(text) line 5 at IF

I have successfully been able to use the debugger to walk through many of my
test functions providing they only use standard SQL variables. However, I
am unable to debug code that calls the ltree functions.

Is this a problem/bug with the debugger or am I doing something wrong? If I
am doing something wrong then can you tell me what it is? I posted this
message first in the novice user mailing list and then the general mailing
list. It was recommended that I send the message to the admin mailing
list.

I'm running PostgreSQL 10.3, compiled by Visual C++ build 1800, 64-bit under
Windows 10. Please note that I will not be able to respond to any
questions you might have from April 28 to May 12.

Thank you,

Ian

Sample Code:

\! cls

\connect postgres;

drop database if exists TestDB;

create database TestDB

with

owner = postgres

encoding = 'utf8'

lc_collate = 'english_united states.1252'

lc_ctype = 'english_united states.1252'

tablespace = pg_default

connection limit = -1;

\connect testdb;

/*

=================================================

=================================================

*/

create extension if not exists ltree;

create extension if not exists pldbgapi;

/*

=================================================

=================================================

*/

create table if not exists TableLtree(

ID int primary key generated by default as identity,

MyPath ltree

);

/*

=================================================

=================================================

*/

create or replace function TestLtree( MyArg text )

returns void

as $$

declare

status boolean;

begin

status := false;

if exists ( select 1 from TableLtree where MyPath = text2ltree( MyArg )
) then

status := true;

else

status := false;

end if;

if status = false then

insert into TableLtree( MyPath ) values ( text2ltree( MyArg ) );

end if;

end;

$$ language plpgsql;

select * from TestLtree( 'a.b.c' );

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message robert 2018-04-27 00:07:18 Re: pgadmin4 python bug?
Previous Message ml 2018-04-26 21:45:48 pgadmin4 python bug?