Bug report: PL/pgSQL and mixed case table/field names.

Started by Billy G. Allieabout 27 years ago4 messages
#1Billy G. Allie
Bill.Allie@mug.org

============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Billy G. Allie
Your email address : Bill.Allie@mug.org

System Configuration
---------------------
Architecture (example: Intel Pentium) : Intel i486DX2

Operating System (example: Linux 2.0.26 ELF) : UnixWare 7.0.1

PostgreSQL version (example: PostgreSQL-6.4) : PostgreSQL-6.4

Compiler used (example: gcc 2.8.0) : Optimizing C Compilation Sys.
(CCS) 3.2 08/18/98 (u701)

Please enter a FULL description of your problem:
------------------------------------------------
PL/pgSQL functions will fail to run if a table with a mixed case name is
used/referenced.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
$ psql mug <test.func
CREATE FUNCTION "In_Committees" ("int4" ) RETURNS "text" AS '
DECLARE
committee_rec "Committees"%ROWTYPE;
BEGIN
SELECT * INTO committee_rec FROM Committees WHERE CommitteeID = $1;
IF NOT FOUND THEN
RETURN ''FALSE'';
END IF;
RETURN ''TRUE'';
END;' LANGUAGE 'plpgsql';
CREATE

select "In_Committees" (2);
NOTICE: plpgsql: ERROR during compile of In_Committees near line 2
ERROR: parse error at or near """
EOF
$

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

--
____ | 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 |

--
____ | 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 |

#2Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Billy G. Allie (#1)
Re: [HACKERS] Bug report: PL/pgSQL and mixed case table/field names.

Can someone comment on this?

============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Billy G. Allie
Your email address : Bill.Allie@mug.org

System Configuration
---------------------
Architecture (example: Intel Pentium) : Intel i486DX2

Operating System (example: Linux 2.0.26 ELF) : UnixWare 7.0.1

PostgreSQL version (example: PostgreSQL-6.4) : PostgreSQL-6.4

Compiler used (example: gcc 2.8.0) : Optimizing C Compilation Sys.
(CCS) 3.2 08/18/98 (u701)

Please enter a FULL description of your problem:
------------------------------------------------
PL/pgSQL functions will fail to run if a table with a mixed case name is
used/referenced.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
$ psql mug <test.func
CREATE FUNCTION "In_Committees" ("int4" ) RETURNS "text" AS '
DECLARE
committee_rec "Committees"%ROWTYPE;
BEGIN
SELECT * INTO committee_rec FROM Committees WHERE CommitteeID = $1;
IF NOT FOUND THEN
RETURN ''FALSE'';
END IF;
RETURN ''TRUE'';
END;' LANGUAGE 'plpgsql';
CREATE

select "In_Committees" (2);
NOTICE: plpgsql: ERROR during compile of In_Committees near line 2
ERROR: parse error at or near """
EOF
$

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

--
____ | 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 |

--
____ | 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 |

[application/pgp-signature is not supported, skipping...]

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#3Noname
jwieck@debis.com
In reply to: Bruce Momjian (#2)
Re: [HACKERS] Bug report: PL/pgSQL and mixed case table/field names.

Bruce Momjian wrote:

Can someone comment on this?

============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Billy G. Allie
Your email address : Bill.Allie@mug.org
[...]

Please enter a FULL description of your problem:
------------------------------------------------
PL/pgSQL functions will fail to run if a table with a mixed case name is
used/referenced.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
$ psql mug <test.func
CREATE FUNCTION "In_Committees" ("int4" ) RETURNS "text" AS '
DECLARE
committee_rec "Committees"%ROWTYPE;
BEGIN
SELECT * INTO committee_rec FROM Committees WHERE CommitteeID = $1;
IF NOT FOUND THEN
RETURN ''FALSE'';
END IF;
RETURN ''TRUE'';
END;' LANGUAGE 'plpgsql';
CREATE

select "In_Committees" (2);
NOTICE: plpgsql: ERROR during compile of In_Committees near line 2
ERROR: parse error at or near """
EOF
$

Sure :-(

PL/pgSQL's scanner/parser does not handle double quoted
syntax for case mixed object names. Not a real bug, just a
lack. Please add to TODO.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck@debis.com (Jan Wieck) #

#4Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Noname (#3)
Re: [HACKERS] Bug report: PL/pgSQL and mixed case table/field names.

PL/pgSQL's scanner/parser does not handle double quoted
syntax for case mixed object names. Not a real bug, just a
lack. Please add to TODO.

Added to TODO:

* plpgsql does not handle quoted mixed-case identifiers

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026