[postgis-users] Help: How do I change data type to character to numeric?
randre at gmail.com
Sat Mar 28 12:47:21 PDT 2009
If it is at all possible, I would suggest that you use the shp2pgsql utility
to create an SQL load file from your .dbf files. The after verifying that
the SQL insert statements are correct, you can load the file into your DB.
Assuming you have a dbf file named "test.dbf", the workflow would look
something like this:
1. shp2pgsql -D test new_table_name db_name > test.sql
test: shape (.shp) or index files (.shx) can not be opened, will just import
2. View/edit insert statements in test.sql:
CREATE TABLE "test" (gid serial PRIMARY KEY,
COPY "test" ("name") FROM stdin;
Papua New Guinea
3. Load data into DB using psql utility.
psql -d db_name -f test.sql
On Sat, Mar 28, 2009 at 7:19 AM, Marc Jansen <jansen.marc at gmx.de> wrote:
> Hey Zia,
> hope this helps:
> Try to chhange the columns data-type (Be sure to have a backup):
> ALTER TABLE table_name ALTER COLUMN column_name TYPE new_type
> see e.g.: http://www.postgresql.org/docs/8.0/static/sql-altertable.html
> If you are experiencing problems, the USING- Part in that documentation
> might be of interest.
> Zia Ahmed schrieb:
> I am new in postgis. I ogr2ogr to import my dbase file to my data base.
>> After importation, data type of some of the column has changed to numeric to
>> character . How do I change data type to character to numeric again in
>> pgAdminIII environment?
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
> postgis-users mailing list
> postgis-users at postgis.refractions.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the postgis-users