pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: PG Version 8.1
2+ messages / 2 participants
[nested] [flat]

* PG Version 8.1
@ 2005-11-22 11:34 Diego <diego@unimedijui.com.br>
  2005-11-22 10:40 ` Re: PG Version 8.1 John Barham <jbarham@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Diego @ 2005-11-22 11:34 UTC (permalink / raw)
  To: pgsql-admin

Hi, i use pg version 8.0 and i have this case:

UPDATE tbpeople
SET dt_update = '11/22/2005'
WHERE tbdoctor.id_people = tbpeople.id

But now, in version 8.1, this instrution give me an error:
[ERROR:  missing FROM-clause entry for table "tbdoctor"]

Who can i do now to get the same result?

Thanks...
Diego Ziquinatti



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: PG Version 8.1
  2005-11-22 11:34 PG Version 8.1 Diego <diego@unimedijui.com.br>
@ 2005-11-22 10:40 ` John Barham <jbarham@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: John Barham @ 2005-11-22 10:40 UTC (permalink / raw)
  To: Diego <diego@unimedijui.com.br>; +Cc: pgsql-admin

On 11/22/05, Diego <diego@unimedijui.com.br> wrote:
> Hi, i use pg version 8.0 and i have this case:
>
> UPDATE tbpeople
> SET dt_update = '11/22/2005'
> WHERE tbdoctor.id_people = tbpeople.id
>
> But now, in version 8.1, this instrution give me an error:
> [ERROR:  missing FROM-clause entry for table "tbdoctor"]
>
> Who can i do now to get the same result?

Try:

UPDATE tbpeople
SET dt_update = '11/22/2005'
FROM tbdoctor
WHERE tbdoctor.id_people = tbpeople.id

or:

UPDATE tbpeople
SET dt_update = '11/22/2005'
WHERE id IN (SELECT id_people FROM tbdoctor)

Note that the FROM clause in UPDATE is a PG extension.

  John

> Thanks...
> Diego Ziquinatti



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-11-22 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-22 11:34 PG Version 8.1 Diego <diego@unimedijui.com.br>
2005-11-22 10:40 ` John Barham <jbarham@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox