Estou usando a funcao reverse em C -- http://blog.frosties.org/post/2007/08/28/Fonction-reverse-C-avec-PostgreSQL e estou adicionando a funcao char *replace(const char *s, const char *old, const char *new)
Acrescentei char * str; str_in = PG_GETARG_VARCHAR_P_COPY(0); len = (int) (VARSIZE(str_in) - VARHDRSZ); str_out = (VarChar *)palloc(VARSIZE(str_in)); SET_VARSIZE(str_out, VARSIZE(str_in)); pg_verifymbstr(VARDATA(str_in), len, false); --Aqui acrescentei str =(char *)malloc(sizeof(len)); strncpy(str ,VARDATA(str_in), len ); str = replace(str, "0A12","RRJA"); strncpy(VARDATA(str_in),str, len); Qdo retorna a função retorna falta caracters ? Tem algum jeito de fazer VarChar receber o char * e vice versa ? -- View this message in context: http://www.nabble.com/Funcao-em-C-reverse-%2B-tp25085779p25085779.html Sent from the PostgreSQL - Brasil mailing list archive at Nabble.com. _______________________________________________ pgbr-geral mailing list pgbr-geral@listas.postgresql.org.br https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral