Re: [Reactor for CF] Possible bug in Postgres usage?
Sal Valverde
Mon, 13 Nov 2006 08:26:39 -0800
good to hear
someone in the CF/framework community using PostgreSQL. :)
cheers!
sal
Dan Wilson wrote:
I
ran in to some problems with PostgreSQL 8.1.5 and Reactor.
Specifically, I was working with Scaffolding in MG:U on postgreSQL. I
received the following error:
Element FIELD.SEQUENCENAME is undefined in ARGUMENTS.
The error occurred in C:\httpd\Apache2\htdocs\reactor\core\object.cfc:
line 424
I eventually debugged this and got it to work by changing the
reactor.data.postgresql.objectDAO.cfc.
The change starts at line 189.
Old:
<cfif qFields.identity eq "true">
<cfset Field.sequenceName =
Replace(ListGetAt(qFields.default,2,"'"),"public.","") />
</cfif>
New:
<cfif qFields.identity eq "true">
<cfset Field.sequenceName =
Replace(Replace(ListGetAt(qFields.default,2,"'"),"public.",""),'"','',
'all') />
<cfelse>
<cfset Field.sequenceName = ""/>
</cfif>
From what I could tell, there were two
problems. One, the sequence
came through surrounded with double quotes. This carried forward
through the application and caused an error when ColdFusion tried to
evaluate the sequence as a ColdFusion Variable.
This is the line for the sequence in
reactor.project.projectname.Metadata.userMetadata.cfc
<cfset variables.metadata.fields[1]["sequence"] =
""user_userID_seq"" />
The other problems was if a field had no sequence, an error was thrown
in reactor\core\object.cfc: line 424. The error was Element
FIELD.SEQUENCENAME is undefined in ARGUMENTS.
Here is the script to create my table.
-- Table: "user"
-- DROP TABLE "user";
CREATE TABLE "user"
(
"userID" int8 NOT NULL DEFAULT nextval('"user_userID_seq"'::regclass),
username varchar(100) NOT NULL,
email varchar(255),
"password" varchar(25),
CONSTRAINT user_pkey PRIMARY KEY ("userID"),
CONSTRAINT user_username_unique UNIQUE (username)
)
WITHOUT OIDS;
ALTER TABLE "user" OWNER TO postgres;
The table declaration was generated with pgAdmin GUI for PostgreSQL.
If i've overlooked something, please let me know.
DW
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List reactor@doughughes.net Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- |