[REL6.4] Mixed case table name problems with some fixes. - Mailing list pgsql-hackers
From | Billy G. Allie |
---|---|
Subject | [REL6.4] Mixed case table name problems with some fixes. |
Date | |
Msg-id | 199811150656.BAA20572@bgalli.mug.org Whole thread Raw |
List | pgsql-hackers |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This is a multipart MIME message. - --==_Exmh_18043825520 Content-Type: text/plain; charset=us-ascii ============================================================================ POSTGRESQL BUG REPORTTEMPLATE ============================================================================ Your name : Billy G. Allie Your email address : Bill.Allie@mug.org System Configuration - --------------------- Architecture (example: Intel Pentium) : Intel 486DX2 Operating System (example: Linux 2.0.26 ELF) : UnixWare 7.0 PostgreSQL version (example: PostgreSQL-6.4) : PostgreSQL-6.4 Compiler used (example: gcc 2.8.0) : Optimizing C Compilation System (CCS) 3.2 08/18/98 (u701) Please enter a FULL description of your problem: - ------------------------------------------------ There are a number of problems with using mixed case table names: 1. Using constraints on tables whose name contains mixed case will fail. 2. Creating triggers on tables whose name contains mixed case will fail. 3. In pgsql, the command '\d *' will fail. Please describe a way to repeat the problem. Please try to provide a concise reproducible example, if at all possible: - ---------------------------------------------------------------------- 1. Create a table that has a mixed case name and a constraint such as a default or a primary key. 2. Create a trigger on a table with a mixed case name. 3. In psql, execute the '\d *' command in a database that has tables mixed case names. If you know how this problem might be fixed, list the solution below: - --------------------------------------------------------------------- The following patch file fixes problems 1 and 3. Thomas G. Lockhart's patch to fix problem 1 was incomplete. I added the additional changes to 'heap.c' that were needed to complete the fix. - --==_Exmh_18043825520 Content-Type: application/x-patch ; name="uw7-0.patch" Content-Description: uw7-0.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="uw7-0.patch" KioqIHNyYy9iYWNrZW5kL2NhdGFsb2cvaGVhcC5jLm9yaWcJU2F0IE5vdiAxNCAyMjoyMDo0 NiAxOTk4Ci0tLSBzcmMvYmFja2VuZC9jYXRhbG9nL2hlYXAuYwlTYXQgTm92IDE0IDIyOjI1 OjI3IDE5OTgKK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aV0sIFBRZ2V0dmFs dWUocmVzLCBpLCAxKSk7CiEgCQkJCXN0cmNhdCh0YWJsZVtpXSwgIlwiIik7CiAgCQkJfQog IAogIAkJCVBRY2xlYXIocmVzKTsK - --==_Exmh_18043825520 Content-Type: text/plain; charset=us-ascii ____ | Billy G. Allie | Domain....: Bill.Allie@mug.org | /| | 7436 Hartwell | Compuserve: 76337,2061 |-/-|----- | Dearborn, MI 48126| MSN.......: B_G_Allie@email.msn.com |/ |LLIE | (313) 582-1540 | - --==_Exmh_18043825520-- -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 5.0i for non-commercial use Charset: noconv iQA/AwUBNk57LqFebSRz8o+3EQL40QCfUplxf/CSLceopBQlLXUb+v+cMaoAoNW3 hA5qlmdH9XtfGsTpkzruCyI2 =eurJ -----END PGP SIGNATURE-----
pgsql-hackers by date: