Re: BUG #4047: case preserve for columns - Mailing list pgsql-bugs
From | |
---|---|
Subject | Re: BUG #4047: case preserve for columns |
Date | |
Msg-id | 01a101c88e4e$1b912730$1200a8c0@kharkov.localhost Whole thread Raw |
In response to | BUG #4047: case preserve for columns ("Eugen Konkov" <Eugen.Konkov@aldec.com>) |
List | pgsql-bugs |
if standard cause head acheing ignore standard You do so with UPPERCASE, so now you use all lowercased. This is good when you do thing simpler. But why you ignore asking of thousands people about case preserving? create table test ( "Id" integer ); SELECT "Id" as "ID" FROM test This cause BIG head acheing while moving to PG from other DBs First of all this cause me and others write SELECT "Id" as "ID" FROM test ( cause to typing 8 + length(FieldName) useless characters multiplied by field count) Instead of SELECT ID FROM test Second it cause to write SELECT id as "ID", name as "Name", phone as "Phone", .... adreass as "Address" FROM test (typing tonn of useless characters) instead of SELECT * FROM test This quiery rewriting is required because of hashes in programms are case sensetive and '$row->{Name}' is not the same as '$row->{name}' So when in my case MySQL returns 'ID', 'Name', 'Phone' when I executing 'SELECT * FROM' test query. I need rewrite it to SELECT id as "ID", name as "Name", phone as "Phone", .... adreass as "Address" FROM test Instead of rewriting each reference to field '$row->{Name}' to '$row->{name}' So I expand all my 'SELECT * FROM ' queries.... Third head acheing: But now you can say: "STOP! Quote field names while creating tables" But this will not stop our headaching, because of in scripts people had writed use SELECT ID FROM or SELECT id FROM or SELECT Id FROM or maybe SELECT iD FROM So this cause me to inspect each line in source files and do these: SELECT "ID" FROM / SELECT "ID" as "id" FROM / SELECT "ID" as "Id" FROM /SELECT "ID" as "iD" FROM instead of rewrite each reference to field value in hash from '$row->{Name}' => '$row->{name}' etc And all this scripts writed for years cause me and not ONLY ME!! big head acheing ... :`-( How do you think how much time this will take from me while moving from some DB to PG? week? month? And how much time will take to set up server variable as 'preserveCase= On'? minute or two? I google WWW and see answers: "case preserving will crash apps that have been writed for years" but my answer will "NO!" because of 'preserveCase' will be OFF by default and this will not cause old apps to crash They will get their lowercased field names as they get them before. BUT 'preserveCase=ON' will make my app AND NOT ONLY MY APP!!! happy to get field names as it used to get them Developers, I know you do good work and you do best as you can. You think about compativility and this is good and I go along with you But can you go along with me and with other who moving from some DB to PG and let them to switch ON preserveCase option and escape from those head acheing described above. Developers, lets do forward step as you do it with UPPERCASE changing it to lowercase I hope you will understand us who moveing to PG and, I hope, you will change your mind about casePreserve Thanks PS: Any who had or has head aching or maybe see that 'casePreserve' DB configuration option will be usefull or handy VOTE for it ----- Original Message ----- From: "Tom Lane" <tgl@sss.pgh.pa.us> To: <Eugen.Konkov@aldec.com> Cc: "John R Pierce" <pierce@hogranch.com>; <pgsql-bugs@postgresql.org> Sent: Friday, March 21, 2008 6:43 PM Subject: Re: [BUGS] BUG #4047: case preserve for columns > <Eugen.Konkov@aldec.com> writes: >> It is have no any matter to me if it is upshifted or lowershifted on >> server >> sidethe standard does not specify that output of queries MUST be >> lowershifted/upshifted. > > Yes it does. I quote SQL92 section 5.2 syntax rule 10: > > The <identifier body> of a <regular identifier> is equivalent > to an <identifier body> in which every letter that is a lower- > case letter is replaced by the equivalent upper-case letter > or letters. This treatment includes determination of equiva- > lence, representation in the Information and Definition > Schemas, > representation in the diagnostics area, and similar uses. > > In particular "representation in the diagnostics area" would include the > case of column headings being returned to the client. > > If you don't want case folding to happen, you need to use a quoted > identifier. In the example you showed, > > SELECT "Id" AS ID, ... > > it would have been sufficient to leave off the AS clause. > > regards, tom lane
pgsql-bugs by date: