Re: Tricky SQL problem - retrieve information_schema info and make use of it. - Mailing list pgsql-novice

From Paul Linehan
Subject Re: Tricky SQL problem - retrieve information_schema info and make use of it.
Date
Msg-id CAF4RT5RqX2hVDTaXgKu_vS4Afwjn66-daL5+6CbTZ57ReMiVNA@mail.gmail.com
Whole thread Raw
In response to Re: Tricky SQL problem - retrieve information_schema info and make use of it.  (Skylar Thompson <skylar2@u.washington.edu>)
List pgsql-novice
> I wonder if a simpler solution would be to fix the table layout; make that
> single salesperson table that you agree would have been better.

Hi, and thanks for your input.

However, logic and clarity don't always go hand in hand with
legacy apps :-(

> Then, make
> a view on top of that for each salesperson. As of PostgreSQL 9.3, views are
> updatable---that is, they map INSERT/UPDATE/DELETE to the underlying
> table---as long as the source data of the column is unambiguous:

Yes, as you so eloquently put it, that would be great, but it's a no
can do I'm afraid!

I was thinking about doing a PIVOT on the fieldlist in the table
and then constructing an SQL string using IN(name1, name2.....).
Does this make any sense?


Paul...


pgsql-novice by date:

Previous
From: Steve Crawford
Date:
Subject: Re: Tricky SQL problem - retrieve information_schema info and make use of it.
Next
From: Paul Linehan
Date:
Subject: Re: Tricky SQL problem - retrieve information_schema info and make use of it.