Error adding new column to existing table.

From: Ted Taylor <Ted(dot)Taylor(at)aircanada(dot)ca>
To: pgadmin-support(at)postgresql(dot)org
Subject: Error adding new column to existing table.
Date: 2004-09-16 20:51:26
Message-ID: 000e01c49c2e$ef5350e0$5281ce9f@TAG65144419
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Short version: using the "Add Column" GUI on an existing table puts double
quotes around the datatype, and won't run.

Long version:

Using pgAdmin III Version 1.2.0 Beta 1 (Sep 8 2004) on Windows 2000, fully
patched from Windows Update site. Connecting to PostgreSQL 7.4.5 on Fedora
Core 2 (select version() reports ""PostgreSQL 7.4.5 on
i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 3.3.3 20040412 (Red Hat
Linux 3.3.3-7)")

Opened "Servers" --> <my server name> --> "Databases" --> <my database name>
--> "Schemas" --> "public" --> "Tables" and single-clicked on my table name
to highlight it.

Right clicked on the table name and chose "Properties".

The Table dialog box has "Properties" "Columns" "Constraints" "Privileges"
and "SQL" tabs; clicked on "Columns".

Clicked on the "Add" button at the bottom.

In the New Column dialog box, I entered:

Name= user_surname

Datatype= varchar

Length= 80

I left all other available properties "Default Value" "Not Null"
"Statistics" and "Comment" at the default of blank.

Clicked OK to close the New Column dialog box.

>>> Back on the Table --> Columns dialog box, I notice the keyword "varchar"
has double quotes around it. Other datatypes such as "int4" do not have
double quotes around it.

On the Table dialog box, click OK. I receive an error message ERROR: syntax
error at or near "(" at character 67.

I clear the error and go to the Table --> SQL tab. I have copied its SQL
here:

ALTER TABLE <my table name> ADD COLUMN user_surname "varchar"(80);

I removed the double quotes around varchar, and executed the SQL directly,
with no errors.

Thanks,

Ted Tayloor

ted(dot)taylor(at)aircanada(dot)ca

Air Canada offers the most non stop flights between Canada and
South America, including Lima, Peru, effective November 1st, 2004.


Air Canada offre le plus grand nombre de vols sans escale entre le
Canada et l'Amrique du Sud, incluant Lima, Prou en vigueur le 1er
novembre, 2004.

------------------- Air Canada Disclaimer/Avertissement -------------
This email and any files transmitted with it are privileged, confidential, and intended solely for the use of the individual or entity to whom they are addressed. Views expressed are those of the author and not necessarily those of Air Canada or its subsidiaries. Any unauthorized use or disclosure is prohibited. Please notify the sender if you have received this email in error. Thank you for your co-operation.

Le prsent courriel et, s'il y a lieu, ses pices jointes constituent des renseignements confidentiels et destins au seul usage de leurs destinataires, qu'il s'agisse de particuliers ou d'organismes. Les opinions qui y sont exprimes sont celles de l'auteur et ne correspondent pas ncessairement celles d'Air Canada ou de ses filiales. Il est interdit d'utiliser ou de divulguer ces renseignements sans autorisation. Si vous avez reu ce courriel par erreur, veuillez communiquer avec son expditeur. Nous vous remercions de votre collaboration.
---------------------------------------------------------------------

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2004-09-17 07:25:31 Re: Error adding new column to existing table.
Previous Message Michal Unzeitig 2004-09-16 12:46:41 Data insert & column name problems