PGAdmin4 debugger - unable to call ltree functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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' );


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux