473,223 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,223 software developers and data experts.

syntax error at or near "TYPE"

66
Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE public.postcodes
  2.   ALTER COLUMN machi
  3.   TYPE varchar(100);
Error: ERROR: syntax error at or near "TYPE";
Error while executing the query (State:42601, Native Code: 7)


I am using WinSQL, Windows XP SP2 Japanese Version, PostgreSQL 8.x.
I want to alter my machi field from varchar(30) to varchar(100) TYPE.

This is my CREATE TABLE script:
Expand|Select|Wrap|Line Numbers
  1. -- Table: public.postcodes
  2.  
  3. -- DROP TABLE public.postcodes;
  4.  
  5. CREATE TABLE public.postcodes (
  6.   postcode  varchar(8) NOT NULL,
  7.   post      varchar(6) NOT NULL,
  8.   kencd     varchar(3) NOT NULL,
  9.   ken       varchar(30) NOT NULL,
  10.   shicd     varchar(4) NOT NULL,
  11.   shi       varchar(30) NOT NULL,
  12.   ku        varchar(30),
  13.   machi     varchar(30) NOT NULL,
  14.   status    boolean,
  15.   remarks   text,
  16.   /* Keys */
  17.   CONSTRAINT postcodes_pkey
  18.     PRIMARY KEY (postcode)
  19. ) WITHOUT OIDS;
  20.  
  21. ALTER TABLE public.postcodes
  22.   OWNER TO postgres; 
Jul 26 '07 #1
3 12381
michaelb
534 Expert 512MB
Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE public.postcodes  ALTER COLUMN machi  
  2.                      TYPE  varchar(100);
  3.  
This looks correct, but changing the column datatype was not supported in the versions prior to 8.x.
My first thought is you are running an earlier version of PostgreSQL.
Jul 30 '07 #2
eros
66
This looks correct, but changing the column datatype was not supported in the versions prior to 8.x.
My first thought is you are running an earlier version of PostgreSQL.
I am using PostgreSQL 7.4.1. Is there a documentation that the above scripts are not supported?.
Jul 31 '07 #3
michaelb
534 Expert 512MB
Of course it is all well documented.
Compare the ALTER TABLE command for 8.2 with that of 7.4 and you'll see the difference.
The commonly used work around is to add a new column, copy the values from the old one, than drop the old column
Aug 1 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: A.M-SG | last post by:
Hi, I am trying to simplify my app.config file. Can I have a section handler in a separated file? I am looking for something like this: <section name=".." type=".." file="..."> but it...
8
by: eminemence | last post by:
Hi, I have been trying to get STLPort work for Symbian. I am using CodeWarrior compiler and it spews this errors namely *************************************************************************...
7
by: Rich | last post by:
Is the link rel="stylesheet" supposed to be real plain text, or would some word processor format such as Word/Pad work? This sample stylesheet seems garbled if downloaded and opened with...
4
by: bob95226 | last post by:
Hi All, I wrote a VB.NET control in Visual Studio 2003 IDE, I am trying to re-compile it with command line compiler vbc.exe like this: vbc /t:library /out:my_control.dll my_control.vb However...
0
subashini Thiyagarajan
by: subashini Thiyagarajan | last post by:
Any one can help me in this error Error Type: Provider (0x80040E21) Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done....
2
abehm
by: abehm | last post by:
Hey everyone, I'm trying to input a string as an xml data type into sql server, but i keep getting this error. Am I doing this incorrectly, or do i need to format the string? XmlDocument mydoc...
17
imrosie
by: imrosie | last post by:
I've tried this string to Sum up payments, moving brackets and paren's different ways, I still get error 'type mismatch'....not sure why. Can anyone point me in the right direction?? thanks ...
24
by: carnold | last post by:
Hello, I'm a developer coming from C++ and Java ... I've going thru "Effective C#" (which highly recommend for people coming from other languages wanting to learn C#), and it states that "value...
9
by: Steve | last post by:
Hi; I've being going through some legacy code on an old JSP site I have been patching. I noticed that when I save the JSP down to my PC as an HTML file I get this javascript error in IE 6 ( ...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.