Skip site navigation (1) Skip section navigation (2)

Re: shortcut for select * where id in (arrayvar)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: shortcut for select * where id in (arrayvar)
Date: 2008-03-31 01:40:52
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it> writes:
> for _row in
> 	select err, msg from errortable where err in (errcode)

> where errcode is an array.
> That syntax doesn't work...

In recent PG releases it will work as "WHERE err = ANY (errcode)"
but note that there is *no* guarantee that the select will deliver
the rows in the same order the array elements are in.

			regards, tom lane

In response to


pgsql-general by date

Next:From: Amit PhatarphekarDate: 2008-03-31 02:25:48
Subject: Logging/Viewing parameters of a prepared statement
Previous:From: Dragan ZubacDate: 2008-03-30 23:19:34
Subject: Re: database 1.2G, pg_dump 73M?!

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group