Cannot create index if table name contains uppercase characters

Поиск
Список
Период
Сортировка
Искать

Cannot create index if table name contains uppercase characters

От:
Oldr(ich Dlouhý <oldrich.dlouhy@seznam.cz>
Дата:
-- PGAdmin --

version: PGAdmin III version 1.0.0
OS:      Windows XP Professional SP1

-- postgres --

Postgres: 7.3.4 on i686-pc-linux-gnu
OS:       RedHat Linux 9

- steps to reproduce --

1. Create table with uppercase characters in name (like "tTable")
2. Create index on that table

-- Actual results --

Index is not created
PGAdmin states that reference "public.ttable" does not exist

-- Expected results --

Index is created

-- Comment --

It looks like the PGAdmin lowercases the table name before sending it to 
postgres. If you see the SQL pane when creating the index, the table 
name is correct ("tTable") but in the error message it it lowercased 
("ttable").

Same error is when the SQL command is copied into SQL query tool.

When the same SQL command is entered on psql command line (on linux), 
the index is created


Re: Cannot create index if table name contains uppercase characters

От:
"Dave Page" <dpage@vale-housing.co.uk>
Дата:
Hi,

This problem occurs because pgAdmin doesn't quote the table name as it should when mixed case names are involved. I have fixed this in CVS for the next release.

In order to create your indexes, you may use the SQL generated by pgAdmin, but add the quotes manually around the table name in the query tool eg.:

CREATE INDEX foo ON public."Bar" (colname);

Thanks for the bug report.

Regards, Dave.


> -----Original Message-----
> From: Oldr(ich Dlouhý [mailto:oldrich.dlouhy@seznam.cz] 
> Sent: 01 October 2003 10:27
> To: PGAdmin support forum
> Subject: [pgadmin-support] Cannot create index if table name 
> contains uppercase characters
> 
> 
> -- PGAdmin --
> 
> version: PGAdmin III version 1.0.0
> OS:      Windows XP Professional SP1
> 
> -- postgres --
> 
> Postgres: 7.3.4 on i686-pc-linux-gnu
> OS:       RedHat Linux 9
> 
> - steps to reproduce --
> 
> 1. Create table with uppercase characters in name (like 
> "tTable") 2. Create index on that table
> 
> -- Actual results --
> 
> Index is not created
> PGAdmin states that reference "public.ttable" does not exist
> 
> -- Expected results --
> 
> Index is created
> 
> -- Comment --
> 
> It looks like the PGAdmin lowercases the table name before 
> sending it to 
> postgres. If you see the SQL pane when creating the index, the table 
> name is correct ("tTable") but in the error message it it lowercased 
> ("ttable").
> 
> Same error is when the SQL command is copied into SQL query tool.
> 
> When the same SQL command is entered on psql command line (on linux), 
> the index is created
> 
> 
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>               http://www.postgresql.org/docs/faqs/FAQ.html

Default value for char/varchar columns is not quoted automaticaly

От:
Oldrich Dlouhy <oldrich.dlouhy@seznam.cz>
Дата:
Default value for char/varchar columns is not quoted automaticaly when 
creating a table or adding new column to existing table.

-- PGAdmin --

version: PGAdmin III version 1.0.0
OS:      Windows XP Professional SP1

-- postgres --

Postgres: 7.3.4 on i686-pc-linux-gnu
OS:       RedHat Linux 9

- Steps to reproduce --

1.Add a new column of (var)char type to existing table with column's 
default value "test value" (withou the quotes)

-- Current result --

Column is not added (parse error)

-- Expected result --

New column is added

-- Notes --

Same behavior is when creating the table.

If this behavior is "by design" and the user required to enter the 
quotes manualy, take it please just as a feature request to automaticaly 
quote character-type defaults

Thank you for creating great tool as PGAdmin is.
Hope this will help you to improve PGAdmin.

Oldrich Dlouhy


FAQ