Обсуждение: PGAdmin4 debugger - unable to call ltree functions
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' );
Hello,
I have recently started working with the PGAdmin4 debugger and have encountered a particular problem.
Hello David,
Sorry for the mistake. I will resend my question to ‘pgadmin-support@lists.postgresql.org’ when I get back in May.
Ian
From: David G. Johnston [mailto:david.g.johnston@gmail.com]
Sent: 27 April, 2018 08:45
To: ib@ianbellsoftware.com
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: PGAdmin4 debugger - unable to call ltree functions
On Thu, Apr 26, 2018 at 4:27 PM, Ian Bell <ib@ianbellsoftware.com> wrote:
Hello,
I have recently started working with the PGAdmin4 debugger and have encountered a particular problem.
This isn't the pgAdmin application support list...and it would be nice for you to provide a link to the archive for the other thread/list where you began discussion this.
As the site Adrian linked to previously says it is: pgadmin-support@postgresql.org
David J.