On Fri, Jan 19, 2007 at 16:44:50 -0800, mawrya <[EMAIL PROTECTED]> wrote: > I have set up a table with a multi-column primary key constraint: > > If I had a row in the table where systemid=123, enclosureid=ab, > pointid=56, I would have a Primary Key ("ID") of 123ab56 for that row. > > I now want to run a select based on the Primary Key, something like: > > SELECT * FROM iopoints WHERE ID = 123ab56 > > Is something like this even possible? Or am I forced to do: > > SELECT * FROM iopoints WHERE systemid=123 AND enclosureid=ab AND pointid=56
SELECT * FROM iopoints WHERE systemid=123 AND enclosureid='ab' AND pointid=56 While in theory you could concatenate the columns and test that against a particular value, you probably don't want to do that. (If you do, use a functional index.) ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq