Re: parsing column info

From: Don Isgitt <djisgitt(at)soundenergy(dot)com>
To: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: parsing column info
Date: 2002-09-10 17:40:28
Message-ID: 3D7E2E8C.7060007@soundenergy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Shaunn,

It is not aesthetically pleasing, but you could use substr and strpos to
extract up to the unwanted character, similarly to extract from the
unwanted character, and then concatenate the two strings.

Don

Johnson, Shaunn wrote:

> Running PostgreSQL 7.2.1 on RedHat Linux 2.4.7-10.
>
> This might wind up being a perl hack, but I'll ask ...
>
> I have a table that has been imported from someplace
> (probably MS Access). The columns on the table has
> been defined as character varying(50). One of the
> columns is "supposed" to be defined as having a decimal.
>
> I no longer want the decimals in that column. Is there
> a way to parse out the decimals when copying this into
> a new table? I was thinking that I can just create the
> new table schema, select * from t_table and somewhere
> figure out how to parse out the silly '.' from the column
> (perhaps in a case statement?).
>
> Any ideas?
>
> Thanks!
>
> -X
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2002-09-10 18:15:22 Re: Psql regex is NFA or DFA?
Previous Message Johnson, Shaunn 2002-09-10 17:24:42 parsing column info