where's the reference to a view, here? - Mailing list pgsql-general

From will trillich
Subject where's the reference to a view, here?
Date
Msg-id 20010621231531.A8988@serensoft.com
Whole thread Raw
Responses Re: where's the reference to a view, here?
List pgsql-general
because of general weirdness, we translated all "--" in our original data
to "==" so postgres wouldn't drop it off as a comment (still haven't
figured that one out)...

to restore it to its original glory, we tried

inv=# update _invitem set descr=
inv-# substring(descr from 1 for position('==' in descr)-1)||'--'||substring(descr from position('==' in descr)+2)
inv-# where descr like '%==%';
ERROR:  system column oid not available - inv is a view
inv=# \d _invitem
          Table "_invitem"
 Attribute |     Type     | Modifier
-----------+--------------+----------
 id        | integer      |
 item      | smallint     |
 hrs       | numeric(4,1) |
 rate      | numeric(6,2) |
 other     | numeric(7,2) |
 descr     | varchar(80)  |

inv=# select count(*) from _invitem where descr like '%==%';
 count
-------
    45


there is a view named "inv" -- but how's that related to this
straght table update?


inv=# \d
    List of relations
   Name   | Type  | Owner
----------+-------+-------
 _charge  | table | will
 _client  | table | will
 _inv     | table | will
 _invitem | table | will
 _job     | table | will
 _work    | table | will
 inv      | view  | will
(7 rows)

inv=# \d inv
                 View "inv"
 Attribute |         Type         | Modifier
-----------+----------------------+----------
 client    | varchar(8)           |
 id        | integer              |
 code      | varchar(20)          |
 rundate   | date                 |
 job       | varchar(6)           |
 invdate   | date                 |
 costs     | boolean              |
 total     | numeric(7,2)         |
 item      | smallint             |
 hrs       | numeric(4,1)         |
 rate      | numeric(6,2)         |
 other     | numeric(7,2)         |
 descr     | varchar(80)          |
 amt       | numeric(65535,65531) |
View definition: SELECT b.client, b.id, b.code, b.rundate, b.job, b.invdate, b.costs, b.total, l.item, l.hrs, l.rate,
l.other,l.descr, CASE WHEN (l.rate ISNULL) THEN l.other ELSE (l.rate * l.hrs) END AS amt FROM "_inv" b, "_invitem" l
WHERE(b.id = l.id); 

--
I figure: if a man's gonna gamble, may as well do it
without plowing.   -- Bama Dillert, "Some Came Running"

will@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

pgsql-general by date:

Previous
From: Paul Mamin
Date:
Subject: Re[2]: Postgres is too slow?
Next
From: Maxim Maletsky
Date:
Subject: Does PostgreSQL support SET or ENUM data types?