Thread: BUG #2648: I can not create table name with capital and small characters

BUG #2648: I can not create table name with capital and small characters

From
"Asaf Avraham"
Date:
The following bug has been logged online:

Bug reference:      2648
Logged by:          Asaf Avraham
Email address:      asaf.avraham@gmail.com
PostgreSQL version: 8.1.4.2
Operating system:   win
Description:        I can not create table name with capital and small
characters
Details:

I have table that contain name with capital and small characters (ex.
tblEmp). In the columns is the same (ex. EmpID).

In Creating table postgres add inverted commas on the name

When I'm running any query on this table i get:
1. select * from tblEmp
   Get: ERROR:  relation "tblemp" does not exist
2. select * from "tblEmp"
   Get: Resulted

Thanks

Re: BUG #2648: I can not create table name with capital and

From
Richard Troy
Date:
Asaf,

quote them and it will work.

Richard

On Sun, 24 Sep 2006, Asaf Avraham wrote:

> Date: Sun, 24 Sep 2006 06:18:38 GMT
> From: Asaf Avraham <asaf.avraham@gmail.com>
> To: pgsql-bugs@postgresql.org
> Subject: [BUGS] BUG #2648: I can not create table name with capital and
>     small characters
>
>
> The following bug has been logged online:
>
> Bug reference:      2648
> Logged by:          Asaf Avraham
> Email address:      asaf.avraham@gmail.com
> PostgreSQL version: 8.1.4.2
> Operating system:   win
> Description:        I can not create table name with capital and small
> characters
> Details:
>
> I have table that contain name with capital and small characters (ex.
> tblEmp). In the columns is the same (ex. EmpID).
>
> In Creating table postgres add inverted commas on the name
>
> When I'm running any query on this table i get:
> 1. select * from tblEmp
>    Get: ERROR:  relation "tblemp" does not exist
> 2. select * from "tblEmp"
>    Get: Resulted
>
> Thanks
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>

--
Richard Troy, Chief Scientist
Science Tools Corporation
510-924-1363 or 202-747-1263
rtroy@ScienceTools.com, http://ScienceTools.com/

Re: BUG #2648: I can not create table name with capital and small characters

From
"Harald Armin Massa"
Date:
Asaf,

this is not a bug. To use identifier names (identfiers =3D column-names,
table-names, view-names...) with capital and small characters, you need to
doublequote those names.

So you can do select "Asaf" from "Avraham"

but not select Asaf from Avraham.

This behaviour is documented and intended.

Best wishes,

Harald


On 9/24/06, Asaf Avraham <asaf.avraham@gmail.com> wrote:
>
>
> The following bug has been logged online:
>
> Bug reference:      2648
> Logged by:          Asaf Avraham
> Email address:      asaf.avraham@gmail.com
> PostgreSQL version: 8.1.4.2
> Operating system:   win
> Description:        I can not create table name with capital and small
> characters
> Details:
>
> I have table that contain name with capital and small characters (ex.
> tblEmp). In the columns is the same (ex. EmpID).
>
> In Creating table postgres add inverted commas on the name
>
> When I'm running any query on this table i get:
> 1. select * from tblEmp
>    Get: ERROR:  relation "tblemp" does not exist
> 2. select * from "tblEmp"
>    Get: Resulted
>
> Thanks
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>



--=20
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstra=DFe 202b
70197 Stuttgart
0173/9409607
-
Python: the only language with more web frameworks than keywords.
-- Harald A. Massa, December 2005
http://groups.google.de/group/comp.lang.python/browse_thread/thread/285b9ad=
eec188fb2

Re: BUG #2648: I can not create table name with capital and small characters

From
"Harald Armin Massa"
Date:
Asaf,

SQL-92 states that identifiers [for dictionary objects] are limited to 128
characters and are case-insensitive (unless delimited by double quotes),
because they are automatically translated into uppercase by the system.

Standards are SQL-92, SQL-99 and SQL-2003, done by ISO and other
standardization commitees.

It can be that JSP and ASP work different than standard SQL-92. I formyself
prefer the easiest solution: just not use mixed case identifiers.

Best wishes,

Harald




On 9/25/06, Asaf Avraham <asaf.avraham@gmail.com> wrote:
>
> Harald,
> This is the point, i need to  use standard sql (from jsp, asp). and quote
> is not a standard
>
> Thanks
> Asaf.
>
> On 9/25/06, Harald Armin Massa <haraldarminmassa@gmail.com> wrote:
> >
> > Asaf,
> >
> > this is not a bug. To use identifier names (identfiers =3D column-names,
> > table-names, view-names...) with capital and small characters, you need=
 to
> > doublequote those names.
> >
> > So you can do select "Asaf" from "Avraham"
> >
> > but not select Asaf from Avraham.
> >
> > This behaviour is documented and intended.
> >
> > Best wishes,
> >
> > Harald
> >
> >
> > On 9/24/06, Asaf Avraham <asaf.avraham@gmail.com > wrote:
> > >
> > >
> > > The following bug has been logged online:
> > >
> > > Bug reference:      2648
> > > Logged by:          Asaf Avraham
> > > Email address:      asaf.avraham@gmail.com
> > > PostgreSQL version: 8.1.4.2
> > > Operating system:   win
> > > Description:        I can not create table name with capital and small
> > > characters
> > > Details:
> > >
> > > I have table that contain name with capital and small characters (ex.
> > > tblEmp). In the columns is the same (ex. EmpID).
> > >
> > > In Creating table postgres add inverted commas on the name
> > >
> > > When I'm running any query on this table i get:
> > > 1. select * from tblEmp
> > >    Get: ERROR:  relation "tblemp" does not exist
> > > 2. select * from "tblEmp"
> > >    Get: Resulted
> > >
> > > Thanks
> > >
> > > ---------------------------(end of
> > > broadcast)---------------------------
> > > TIP 9: In versions below 8.0, the planner will ignore your desire to
> > >        choose an index scan if your joining column's datatypes do not
> > >        match
> > >
> >
> >
> >
> > --
> > GHUM Harald Massa
> > persuadere et programmare
> > Harald Armin Massa
> > Reinsburgstra=DFe 202b
> > 70197 Stuttgart
> > 0173/9409607
> > -
> > Python: the only language with more web frameworks than keywords.
> > -- Harald A. Massa, December 2005
> >
> > http://groups.google.de/group/comp.lang.python/browse_thread/thread/285=
b9adeec188fb2
>
>
>


--=20
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstra=DFe 202b
70197 Stuttgart
0173/9409607
-
Python: the only language with more web frameworks than keywords.
-- Harald A. Massa, December 2005
http://groups.google.de/group/comp.lang.python/browse_thread/thread/285b9ad=
eec188fb2

Re: BUG #2648: I can not create table name with capital and small characters

From
Bruno Wolff III
Date:
On Mon, Sep 25, 2006 at 14:59:46 +0200,
  Harald Armin Massa <haraldarminmassa@gmail.com> wrote:
> Asaf,
>
> SQL-92 states that identifiers [for dictionary objects] are limited to 128
> characters and are case-insensitive (unless delimited by double quotes),
> because they are automatically translated into uppercase by the system.

Note that Postgres actually lowercases unquoted names instead of uppercasing
them. This difference can be significant.