Hi,
The problem is on SET statement... I've tested with postgresql 8.2
and 8.3.
Both worked with alias, but that only for WHERE statement, as follows:
UPDATE "schema1"."table1" AS "P"
SET "id"='1', "field2"=now()
WHERE "P"."id" in ('1')
The problem is postgresql doesn't accept SET "P"."id" sintax.
On 7 abr, 14:38, cguyer <[EMAIL PROTECTED]> wrote:
> and yet this error is still around even with the latest branch? has it
> been broken again?
>
> On Feb 15, 12:23 pm, nate <[EMAIL PROTECTED]> wrote:
>
> > Please do everyone else a favor and search around a little bit next
> > time. This bug has already been reported a zillion times, and was
> > fixed weeks ago.
>
> > On Jan 21, 8:58 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > > I'm having trouble makingUPDATEqueries in PostgreSQL. I know that
> > > there is a known issue aboutPostgresnot supporting aliases inUPDATE
> > > queries. Anyway, my problem is that when I try to create new Aro like
> > > this:
>
> > > $parent = $this->Acl->Aro->findByAlias('SuperUser');
> > > $parentId = $parent['Aro']['id'];
>
> > > $this->Acl->Aro->create();
> > > $this->Acl->Aro->save(array(
> > > 'foreign_key' => null,
> > > 'parent_id' => $parentId,
> > > 'alias' => 'User:30'));
>
> > > I get the followingerror:
>
> > > Warning (2): pg_query() [function.pg-query]: Query failed:ERROR:
> > > column "Aro" of relation "aros" does not exist
> > > LINE 1:UPDATE"aros" AS "Aro" SET "Aro"."lft" = "Aro"."lft" + 2
> > > W...
> > > ^ [CORE\cake\libs\model\datasources
> > > \dbo\dbo_postgres.php, line 123]
> > > $sql = "UPDATE"aros" AS "Aro" SET "Aro"."lft" = "Aro"."lft" + 2
> > > WHERE "Aro"."lft" >= '2'"
>
> > > I've already posted a bug to trac.cakephp.org... the reason for this
> > > message is that I would like to ask everybody for help on creating
> > > some quick solution or patch for this problem.
>
> > > P.S. This problem with aliases isn't just a one time thing, it is and
> > > will be happening until cakephp developers move the method
> > > renderStatement from dbo_source.php to each dbo file. It should work
> > > as it is, but it doesn't, they should all follow SQL standards but
> > > they don't. So, my suggestion is to make renderStatement in every dbo.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---