[BUGS] BUG #2624: Cursor

2006-09-13 Thread Marcelo

The following bug has been logged online:

Bug reference:  2624
Logged by:  Marcelo
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.1
Operating system:   Windows xp
Description:Cursor
Details: 

Cursor Invalid - ODBC

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


[BUGS] Suse Installations

2006-03-09 Thread Marcelo

Hello,
   I've been trying to install postgres 8.1.3 from de sources in 2 Suse x86
machines, one with the 8.2 SUSE s.o. and the other whith the 9.0 one.

   Neither of the tryings where succesfull because the configure script 
did

not work in any case.

   ¿Is there package or rpm for SUSE in developement going to be 
published soon?



 Thanks for your attention,

Cordially,
Marcelo Mas
AT&G





---(end of broadcast)---
TIP 6: explain analyze is your friend


[BUGS] BUG #5236: Aparent bug in ecpg

2009-12-08 Thread Marcelo Mas

The following bug has been logged online:

Bug reference:  5236
Logged by:  Marcelo Mas
Email address:  m...@atg.com.uy
PostgreSQL version: 8.4.1
Operating system:   Suse 10
Description:Aparent bug in ecpg
Details: 

At the company I work we developed a database adapter in C using ECPG for
postgresql 8.1.2 but when used with postgresql 8.4 we had the following
problem:

The program needs to prepare sentences in function A with name using:
EXEC SQL PREPARE :sentencename from :sentencecontent ; 

Later it uses another function B in witch it is  the following code :
EXEC SQL EXECUTE :sentencename using :values_struct:values_indicators ;   

where the content of :sentencename is the same in both cases.

In run time, this sequence of execution works for 8.1.2 but not for 8.4.1  
.

Second case does report errors like 'undefined sentence "name" ' and 'too
many parameters' .


If we modify the code to prepare and execute in same function (only for
testing )  it runs ok, but we do need to do it separately since one
preparation is for many executions.

If this report is not enougth clear you can mail me.

Thanks.

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


[BUGS] BUG #5607: memmory leak in ecpg

2010-08-06 Thread Marcelo Mas

The following bug has been logged online:

Bug reference:  5607
Logged by:  Marcelo Mas
Email address:  m...@atg.com.uy
PostgreSQL version: 8.4.4
Operating system:   Suse 10
Description:memmory leak in ecpg
Details: 

Valgrind reports memmory leak when getting decimal data.

We created a small testcase that reproduces the problem that:

1) crates a table whith one decimal attribute
2) inserts one row.
3) executes a exec sql sentence to retrieve data from database.
4) displays data
5) dropps the table
6) disconnects
7) exits

When running with  valgrind, it reports that memmory obtained in point 3) 
is not liberated.

Next follows contents of files :
decimaltest.ec whith source code, 
compiletest to compile , 
and runtest to run it with valgrind,

After files contents, follows terminal output.


-- BEGIN OF decimaltest.ec --
#include 
#include 
#include "pgtypes_numeric.h"

  int  show_error(char * message){
  if( sqlca.sqlcode != 0 ) {
printf("Error %s: [%d] \n",message ,  sqlca.sqlcode );
 printf("\nsqlcaid = %s \n", sqlca.sqlcaid );
 printf("sqlabc = %ld \n", sqlca.sqlabc );
 printf("sqlcode = %ld \n", sqlca.sqlcode );
 printf("sqlerrm.sqlerrml = %d \n",
sqlca.sqlerrm.sqlerrml );
 printf("sqlerrm.sqlerrmc = %s \n",
sqlca.sqlerrm.sqlerrmc );
 printf("sqlerrp = %s \n", sqlca.sqlerrp );
 printf("sqlerrd = %d \n", sqlca.sqlerrd );
 printf("sqlwarn = %s \n", sqlca.sqlwarn );
 printf("sqlstate = %s \n\n", sqlca.sqlstate );
return(-1);
  }
  return(0);
 }

int main(int argc, char *argv[]) {
EXEC SQL BEGIN DECLARE SECTION ;
charbase_datos[100];
charusuario[100];
charcontrasenia[100];
decimalvalor;

charsentence[200];

EXEC SQL END DECLARE SECTION;
int count = 0;


if( argc < 4) { 
printf("use : %s   \n", argv[0]
);
return(-1);
}


   
/*--
--
/  connect to database
   
/---
-*/
strcpy( base_datos, argv[1] );
strcpy( usuario, argv[2] );
strcpy( contrasenia, argv[3] );
EXEC SQL CONNECT TO :base_datos USER :usuario / :contrasenia ;


if( sqlca.sqlcode != 0 ) {
printf("Error Connecting:[%d] \n", sqlca.sqlcode );
return(-1);
}

printf("Connected\n" );

sprintf(sentence, "create table testdecimal ( tdecimal
decimal(18,9));");
EXEC SQL EXECUTE IMMEDIATE :sentence;
if (  show_error("creting table ")!= 0 ) return(-1);
sprintf(sentence, "insert into testdecimal values ( '12345654.32101234'
);");
EXEC SQL EXECUTE IMMEDIATE :sentence;
if (  show_error("inserting data ")!= 0 ) return(-1);



/**/
/*  TEST  */
/**/
EXEC SQL
SELECT tdecimal into :valor from testdecimal  limit 1;


 if (  show_error("obtaining data ")!= 0 ) return(-1);

 printf("ndigits = %d \n", valor.ndigits);
 printf("weitht  = %d \n", valor.weight);
 printf("rscale  = %d \n", valor.rscale);
 printf("dscale  = %d \n", valor.dscale);
 printf("sign= %d \n", valor.sign);
 printf("ndigits = ");
 for ( count = 0 ; count< valor.ndigits ; count++ ){
printf("%02x ",valor.digits[count]); 
 }

 printf("\n\n");


sprintf(sentence, "drop table testdecimal;");
EXEC SQL EXECUTE IMMEDIATE :sentence;
if (  show_error("dropping table ")!= 0 ) return(-1);


 EXEC SQL DISCONNECT CURRENT;
 return(0);

}
-- END OF decimaltest.ec --

---BEGIN OF compiletest ---
POSTGRE_DIR=/opt/PostgreSQL/8.4
POSTGRE_INCLUDE=$POSTGRE_DIR/include
POSTGRE_LIB=$POSTGRE_DIR/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$POSTGRE_DIR/lib
$POSTGRE_DIR/bin/ecpg decimaltest.ec 
gcc -g decimaltest.c  -I$POSTGRE_INCLUDE -L$POSTGRE_LIB  -lecpg  -o
decimaltest.exe

-- END   OF compiletest ---

-- BEGIN OF runtest
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/PostgreSQL/8.4/lib
 valgrind --tool=memcheck --leak-check=full --leak-resolution=high
./decimaltest.exe testdatab...@server  psig psig
-- END   OF runtest

-- BEGIN OF terminal output
==9642== Memcheck, a memory error detector
==9642== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==9642== Using Valgrind-3.5.0 and LibVE

Re: [BUGS] BUG #7983: Problem with pgAgent.

2013-03-22 Thread Marcelo Matheus
Hello, Dave.

The pemissões of / tmp are:

[root@vmpjebdh /]# ls -ld /tmp
drwxrwxrwt. 18 root root 4096 Mar 22 12:29 /tmp

Thanks,
Marcelo Matheus



--
View this message in context: 
http://postgresql.1045698.n5.nabble.com/BUG-7983-Problem-with-pgAgent-tp5749215p5749296.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


Re: [BUGS] BUG #7983: Problem with pgAgent.

2013-03-23 Thread Marcelo Matheus
Good afternoon, Dave.

The output of led mount brings the following about the / tmp:

/dev/mapper/vg_vmpjebdh2-LogVol01 on /tmp type ext4
(rw,noexec,nosuid,nodev,noat
ime)
Thanks,
Marcelo Matheus



--
View this message in context: 
http://postgresql.1045698.n5.nabble.com/BUG-7983-Problem-with-pgAgent-tp5749215p5749308.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


Re: [BUGS] BUG #7983: Problem with pgAgent.

2013-03-25 Thread Marcelo Matheus
Good afternoon, Dave.

That was it, bingo!

Thank you for your help.



--
View this message in context: 
http://postgresql.1045698.n5.nabble.com/BUG-7983-Problem-with-pgAgent-tp5749215p5749598.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


[BUGS] Postgis extension bug w/ OpenBSD

2013-09-17 Thread Marcelo Bacha
Hi,

I´ve sent this to the Postgis bug list before, but I was told that this is
probably a PostgreSQL problem.

I have an OpenBSD 5.3 server, with PostgreSQL 9.3.0, which seems to work
fine. I´m trying to install  on it, which always worked fine.
When I try to install the extension for Postgis 2.1.0, I get this error on
psql:

  *postgres=# CREATE EXTENSION postgis;*
*  ERROR:  could not load library "/usr/local/pgsql/lib/rtpostgis-2.2.so":
dlopen (/usr/local/pgsql/lib/rtpostgis-2.2.so) failed: Cannot load
specified object*

The paths seems all to be OK:

  *# ls -l /usr/local/pgsql/lib/*post**
*  -rwxr-xr-x  1 root  wheel  1276039 Jul  1 16:50 /usr/local/pgsql/lib/
postgis-2.2.so*
*  -rwxr-xr-x  1 root  wheel  1208861 Jul  1 16:50 /usr/local/pgsql/lib/
rtpostgis-2.2.so*

When I try to preload the rtpostgis shared object setting the LD_PRELOAD
environment variable, I get this info on psql:

 * $ psql   *
*(...)*
*  psql:/usr/local/pgsql/lib/rtpostgis-2.2.so: undefined symbol
'CurrentMemoryContext'*
*  psql:/usr/local/pgsql/lib/rtpostgis-2.2.so: undefined symbol
'SPI_tuptable'*
*  psql:/usr/local/pgsql/lib/rtpostgis-2.2.so: undefined symbol 'SPI_result'
*
*  psql:/usr/local/pgsql/lib/rtpostgis-2.2.so: undefined symbol
'InterruptPending'*
*  psql:/usr/local/pgsql/lib/rtpostgis-2.2.so: undefined symbol
'SPI_processed'*
*  psql (9.2.4)*
*(...)*

In fact, I´ve been trying to solve this since a long time ago, and with
many previous versions of both Postgresql and Postgis, but I´m really stuck

Thanks in advance,
Marcelo




-- 
Editio Princeps
http://www.editioprinceps.com


Fwd: [BUGS] Postgis extension bug w/ OpenBSD

2013-09-23 Thread Marcelo Bacha
Hello Michael,

Thanks for your answer.

On Thu, Sep 19, 2013 at 4:46 AM, Michael Paquier
wrote:

> On Tue, Sep 17, 2013 at 4:48 PM, Marcelo Bacha  wrote:
> > I have an OpenBSD 5.3 server, with PostgreSQL 9.3.0, which seems to work
> > fine. I´m trying to install  on it, which always worked fine.
> Postgres is working fine as you mention, and only PostGIS development
> failed. Based on the information above which looks to be a library
> linking problem for your PostGIS installation, this problem is not
> related to PG.
>

To be honest, I don´t think it´s a Postgres problem, but maybe somebody by
here would be able to help me.


>  > When I try to install the extension for Postgis 2.1.0, I get this error
> on
> > psql:
> >
> >   postgres=# CREATE EXTENSION postgis;
> >   ERROR:  could not load library "/usr/local/pgsql/lib/rtpostgis-2.2.so
> ":
> > dlopen (/usr/local/pgsql/lib/rtpostgis-2.2.so) failed: Cannot load
> specified
> > object
> You mention that you are trying to install postgis 2.1, but
> rtpostgis-2.2.so is part of the PostGIS 2.2 bundle (version currently
> in development). So which one are you trying to install?
>

Sorry, I just cut&pasted the previous email I sent to the postgis list, and
by then I was trying with the devel bundle. I get the very same behaviour,
with 2.0, 2.1 (currently stable) or 2.2.
I´ve cleared/uninstalled everything after upgrading Postgres to 9.3.0, and
now I´m using Postgis 2.1.


>
> >
> > The paths seems all to be OK:
> >
> >   # ls -l /usr/local/pgsql/lib/*post*
> >   -rwxr-xr-x  1 root  wheel  1276039 Jul  1 16:50
> > /usr/local/pgsql/lib/postgis-2.2.so
> >   -rwxr-xr-x  1 root  wheel  1208861 Jul  1 16:50
> > /usr/local/pgsql/lib/rtpostgis-2.2.so
> >
> > When I try to preload the rtpostgis shared object setting the LD_PRELOAD
> > environment variable, I get this info on psql:
> >
> >   $ psql
> > (...)
> >   psql:/usr/local/pgsql/lib/rtpostgis-2.2.so: undefined symbol
> > 'CurrentMemoryContext'
> >   psql:/usr/local/pgsql/lib/rtpostgis-2.2.so: undefined symbol
> > 'SPI_tuptable'
> >   psql:/usr/local/pgsql/lib/rtpostgis-2.2.so: undefined symbol
> 'SPI_result'
> >   psql:/usr/local/pgsql/lib/rtpostgis-2.2.so: undefined symbol
> > 'InterruptPending'
> >   psql:/usr/local/pgsql/lib/rtpostgis-2.2.so: undefined symbol
> > 'SPI_processed'
> >   psql (9.2.4)
> > (...)
> >
> > In fact, I´ve been trying to solve this since a long time ago, and with
> many
> > previous versions of both Postgresql and Postgis, but I´m really stuck
> Also, what is the output of this command? => ldd
> /usr/local/pgsql/lib/rtpostgis-2.2.so
> Are you sure that rtpostgis is linked to the necessary PG libs?
>

Sure, I´ve tried this, here´s the output:

# ldd /usr/local/pgsql/lib/rtpostgis-2.1.so
rtpostgis-2.1.so:
StartEnd  Type Open Ref GrpRef Name
0646 26485000 dlib 10   0  /usr/local/pgsql/lib/
rtpostgis-2.1.so
07ae1000 27d8a000 rlib 01   0
 /usr/local/lib/libgdal.so.18.1
0f27b000 2f285000 rlib 02   0
 /usr/local/lib/libgeos_c.so.9.2
0717a000 27184000 rlib 01   0  /usr/local/lib/libproj.so.7.0
06401000 26405000 rlib 01   0  /usr/local/lib/libjson.so.1.1
04171000 24198000 rlib 02   0
 /usr/local/lib/libxml2.so.14.0
0c746000 2c74d000 rlib 05   0  /usr/lib/libz.so.4.1
0783c000 2791c000 rlib 05   0
 /usr/local/lib/libiconv.so.6.0
0c04f000 2c058000 rlib 09   0  /usr/lib/libm.so.7.1
02fb1000 22ff4000 rlib 02   0  /usr/local/lib/libgeos.so
012fa000 21308000 rlib 01   0  /usr/lib/libsqlite3.so.21.0
0603b000 2604 rlib 01   0  /usr/lib/libexpat.so.10.0
071ae000 271bd000 rlib 01   0
 /usr/local/lib/libjasper.so.2.1
04278000 2427c000 rlib 01   0  /usr/local/lib/libgif.so.5.4
0894b000 28951000 rlib 01   0
 /usr/local/lib/libjpeg.so.64.0
035b6000 235bd000 rlib 01   0
 /usr/local/lib/libpng.so.15.14
0cba6000 2cbae000 rlib 01   0  /usr/local/lib/libpq.so.5.6
0856a000 28576000 rlib 01   0
 /usr/local/lib/libcurl.so.23.0
04989000 249b5000 rlib 02   0  /usr/local/lib/libidn.so.17.0
03a5 23a54000 rlib 03   0  /usr/local/lib/libintl.so.6.0
087de000 287eb000 rlib 03   0  /usr/lib/libssl.so.19.0
0cea6000 2cee5000 rlib 03   0  /usr/lib/libcrypto.so.22.0
0955d000 2958b000 rlib 03   0  /usr/lib/libstdc++.so.55.0

For sure there must be some lib I´m missing, but I can´t divise which one.
As you can see, there´s no other linked lib from pgsql/lib.

Any ideas?

Thanks a lot. Best,
Marcelo


> --
> Michael
>


-- 
Editio Princeps
http://www.editioprinceps.com


[BUGS] BUG #3642: Tiempos de consultas diferentes

2007-09-28 Thread Arley Wilches Marcelo

The following bug has been logged online:

Bug reference:  3642
Logged by:  Arley Wilches Marcelo
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.2
Operating system:   Linux Ubuntu Server 7.04
Description:Tiempos de consultas diferentes
Details: 

Hola, tengo una aplicacion de alrededor 100 tablas, todas con sus
respectivas llaves foraneas.
Tengo una consulta que tiene alrededor de 12 tablas involucradas, 6
subquerys.
El problemas que tengo es que al realizar la consulta por primera vez se
puede demorar alrededor de 300 a 500 ms, despues de la 5 vez ejecutada con
un intervalo de tiempo de 2 segundos la respuesta de la consulta se llega a
demorar mas de 177.552 ms.

Ya estuve revisando opciones para la creacion de indices, cambio en los
valores de postgresql.conf para el performance de Postgres, pero la verdad
ningun cambio realizado me ha servido para poder arreglar el problema.

Es una aplicacion que esta corriendo en Apache 2 y con php 5.2.1.

De antemano Muchisimas Gracias por cualquier luz que me puedan dar para
poder resolver este tema.

Anexo la consulta que ejecuto.


SELECT COUNT(DATOS.negocio_id) AS total
  FROM (SELECT negocio_razonsocial AS RAZON_SOCIAL,negocio_id,
  negocio_identificador AS IDENTIFICADOR, negocio_direccion AS
DIRECCION,
  usuario_nombre||' '||(CASE WHEN usuario_apellido <>'' THEN
usuario_apellido ELSE ' ' END) AS PROPIETARIO,
  convenio_nombre AS CONVENIO,
  
  ( CASE 
WHEN A.municipio_sucursal_id IS NOT NULL THEN
A.municipio_sucursal_id
WHEN A.municipio_depende_mun_id IS NOT NULL THEN (
  SELECT Z.municipio_sucursal_id FROM municipio Z
  WHERE Z.municipio_id = (
SELECT J.municipio_depende_mun_id
FROM municipio AS J
WHERE J.municipio_id = A.municipio_id  
  )
)END  
  ) AS sucursal_id, 
  
  A.municipio_departamento_id, A.municipio_id, localidad_id,
  barrio_id, negocio_convenio_id,
evaluacion_tarifa_finalidad_musica_id,
  evaluacion_tarifa_nivel_socioeconomico_id,
evaluacion_tarifa_categoria_id,
  estado_juridico_negocio_estado_id, negocio_estado_negocio_estado_id
  FROM 
negocio, barrio, localidad, 
municipio AS A, usuario, convenio, 
evaluacion_tarifa, pago_periodo, 
negocio_estado_negocio, estado_juridico_negocio,
estado_juridico, estado_negocio WHERE negocio_id NOT IN ( 
SELECT liquidacion_negocio_id FROM liquidacion 
WHERE liquidacion_activo = true 
  AND ( ( liquidacion_fecha_limite >= '2007-09-28' AND liquidacion_paga
= 'f' )
OR (liquidacion_validez >= '2007-09-28' AND liquidacion_paga = 't')
OR ( liquidacion_anulado = false )
  )
)
AND estado_juridico_negocio_estado_id IN(
  SELECT estado_juridico_id 
  FROM estado_juridico 
  WHERE estado_juridico_bloquea = false
)
  AND negocio_activo = 't'
  AND negocio_utiliza_musica = 't'
  AND usuario_id = negocio_usuario_id
  AND negocio_barrio_id = barrio_id
  AND barrio_localidad_id = localidad_id
  AND localidad_municipio_id = A.municipio_id
  AND convenio_id = negocio_convenio_id
  AND evaluacion_tarifa_negocio_id = negocio_id
  AND evaluacion_tarifa_activo = 't'
  AND pago_periodo_negocio_id = negocio_id
  AND pago_periodo_activo = 't'
  AND pago_periodo_estado_pago_id = 1
  AND pago_periodo_periodo = '2007'
  AND estado_juridico_negocio_negocio_id = negocio_id
  AND estado_juridico_negocio_activo = true
  AND estado_juridico_negocio_estado_id = estado_juridico_id
  AND negocio_estado_negocio_negocio_id = negocio_id
  AND negocio_estado_negocio_activo = true
  AND negocio_estado_negocio_estado_id = estado_negocio_id ) DATOS,
sucursal, zona
  WHERE sucursal.sucursal_id = DATOS.sucursal_id
  AND sucursal_zona_id = zona_id
   AND sucursal_zona_id =  7 AND sucursal.sucursal_id =  9

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly