Re: conversion a numero

From: Juan <smalltalker(dot)marcelo(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Jaime Casanova <jaime(at)2ndquadrant(dot)com>, Ayuda <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: conversion a numero
Date: 2010-09-29 21:12:51
Message-ID: AANLkTinyXr=bNf7QG_LqfJF_YWVW35m+y1mcFOGtYe6L@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Alvaro , amigos

Ya lo resolvi, el problema al parecer ( este problema no lo resolvi
pero empeze a
resolverlo,luego opte por otra solucion)
cstring es un tipo esta en el catalogo, pero al parecer no es visible desde mi
schema, asi que intente copiarlo para ello use , todo esto a titulo de
compartir
experiencias

en el pg_catalog tiene el type cstring
CREATE TYPE cstring
(INPUT=cstring_in, OUTPUT=cstring_out, DEFAULT='',
INTERNALLENGTH=-2, ALIGNMENT=char, STORAGE=PLAIN);
ALTER TYPE cstring OWNER TO postgres;

intente crearlo en mi schema.
pero faltaban las funciones
cstring_in
cstring_out

las saque tambien y las cree,
-- Function: cstring_in(cstring)

-- DROP FUNCTION cstring_in(cstring);

CREATE OR REPLACE FUNCTION cstring_in(cstring)
RETURNS cstring AS
'cstring_in'
LANGUAGE 'internal' IMMUTABLE STRICT
COST 1;
ALTER FUNCTION cstring_in(cstring) OWNER TO postgres;
COMMENT ON FUNCTION cstring_in(cstring) IS 'I/O';

y

-- Function: cstring_out(cstring)

-- DROP FUNCTION cstring_out(cstring);

CREATE OR REPLACE FUNCTION cstring_out(cstring)
RETURNS cstring AS
'cstring_out'
LANGUAGE 'internal' IMMUTABLE STRICT
COST 1;
ALTER FUNCTION cstring_out(cstring) OWNER TO postgres;
COMMENT ON FUNCTION cstring_out(cstring) IS 'I/O';

luego volvi a tratar de crear el tipo (type cstring )

recibiendo el error

ERROR: no existe la función cstring_out(public.cstring)

********** Error **********

ERROR: no existe la función cstring_out(public.cstring)
SQL state: 42883

ahi abandone.
otra solucion use casts.
y cambie algunas funciones.
salu2
mdc

On Wed, Sep 29, 2010 at 6:06 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com> wrote:
> Excerpts from Juan's message of mié sep 29 15:21:02 -0400 2010:
>> lo necesito en un procedure.
>
> ¿Cuál es la diferencia?  Si lo que te complica es la sintaxis, puedes
> usar
> CAST ('val' AS numeric)
>
> --
> Álvaro Herrera <alvherre(at)commandprompt(dot)com>
> The PostgreSQL Company - Command Prompt, Inc.
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support
>

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2010-09-29 21:21:35 Re: conversion a numero
Previous Message renevielma@gmail.com 2010-09-29 21:07:54 Re: calcular diferencias entre fechas