Thread: Error Message

Error Message

From
Ian Brown
Date:

-- System Information --

Platform:               Windows 2000
Version:                5.0
Build:          2195 Service Pack 3

-- Application Information --

Name:           pgAdmin II
Version:                1.5.60
Descripton:    

Name:           pgSchema
Version:                1.5.60
Descripton:     PostgreSQL Schema Objects v1.5.60

-- Database Information --

Version:                7.2.3
Descripton:     PostgreSQL 7.2.3 on i686-pc-linux-gnu, compiled by GCC 2.95.3

-- Driver Information --

Name:           PostgreSQL
Version:                7.3.100
Descripton:     PostgreSQL 7.2.3 on i686-pc-linux-gnu, compiled by GCC 2.95.3

-- Error Information --

Description:    ERROR:  parser: parse error at or near "user"
Number:                 -2147467259
Routine:                pgAdmin II:frmMain.tvTable

************************************************************

Insert your comment:

The above error is generated by clicking the 'view' toolbar button on a table of mine called user. I can get the same error using the SQL winodow...

In the SQL window:

select * from user

gives the error, but

select * from "user"

works okay.

Re: Error Message

From
"Dave Page"
Date:
 

Insert your comment:

The above error is generated by clicking the 'view' toolbar button on a table of mine called user. I can get the same error using the SQL winodow...

In the SQL window:

select * from user

gives the error, but

select * from "user"

works okay. 

Hi,

The problem is that user is a reserved word because it is part of the SQL syntax. It's usually best to avoid reserved words for object names, though I appreciate that's not always easy, or what you want.

Frank: It seems to me that the best solution might be to maintain a list of reserved words and add a check in fmtID to make sure the word is not in the list. What do you think?

Regards, Dave 

Re: Error Message

From
"Dave Page"
Date:

> -----Original Message-----
> From: frank_lupo [mailto:frank_lupo@email.it]
> Sent: 28 May 2003 12:56
> To: Dave Page
> Cc: ian.brown; pgadmin-support; franklupo
> Subject: RE: [pgadmin-support] Error Message
>
>
> Hi Dave,
>
> >
> >>Insert your comment:
> >>The above error is generated by clicking the 'view' toolbar
> button on a table of mine called user. I can >>get the same
> error using the SQL winodow...
> >>In the SQL window:
> >>select * from user
> >>gives the error, but
> >>select * from "user"
> >>works okay.
>
> >Hi,
> >The problem is that user is a reserved word because it is
> part of the
> >SQL syntax. It's usually best to >avoid reserved words for
> object names, though I appreciate that's not always easy, or
> what you want.
> >Frank: It seems to me that the best solution might be to
> maintain a list of reserved words and add a >check in fmtID
> to make sure the word is not in the list. What do you think?
> >Regards, Dave
>
>
> In fmtID why do not escape always ?
>

That's how we used to do it but it looks *very* messy and can make
statements almost unreadable.

Regards, Dave.