From: <no...@so...> - 2002-06-13 02:14:23
|
Bugs item #565461, was opened at 2002-06-07 02:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=418980&aid=565461&group_id=37132 Category: Tables Group: v2.4-dev >Status: Closed Resolution: None Priority: 5 Submitted By: Surojit Niyogi (niyogi) >Assigned to: Christopher Kings-Lynne (chriskl) Summary: insert function fails due to text field Initial Comment: if you try to insert a record into a table and one of the columns is of type "text", it fails to put the single quote around the value and so it errors out: Error - /home/virtual/site2/fst/var/www/html/phpPgAdmin242/tbl_replace.php -- Line: 77 PostgreSQL said: ERROR: parser: parse error at or near "are" Your query: INSERT INTO "message" ("message_id", "message_heading", "message_content", "tab_heading") VALUES (NEXTVAL('"message_message_id_seq"'::text), 'Listing Added', You are now watching this item. To view this and other listings that you are currently watching, click on the My Exchange tab above., 'sell') ---------------------------------------------------------------------- Comment By: Steven Green (greenius) Date: 2002-06-11 21:04 Message: Logged In: YES user_id=129896 Here is a fix. I simply added text to the regular expression used to decide whether to quote the value. Sorry, but I don't seem to have access to upload files so I am includnig the patch inline: diff -r1.12 tbl_replace.php 16c16 < if (eregi("char|date|bool|time|inet", $field_type[$key])) { --- > if (eregi("char|date|bool|time|inet|text", $field_type[$key])) { 46c46 < if (eregi("char|date|bool|time|inet", $field_type[$key])) { --- > if (eregi("char|date|bool|time|inet|text", $field_type[$key])) { ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=418980&aid=565461&group_id=37132 |