Re: [SQL] prepared statement in crosstab query

2012-08-31 Thread David Johnston
On Aug 31, 2012, at 21:53, Samuel Gendler wrote: > I have the following crosstab query, which needs to be parameterized in the 2 > inner queries: > > SELECT * FROM crosstab( > $$ > SELECT t.local_key, >s.sensor_pk, >CASE WHEN t.local_day_abbreviation IN (?,?,?,?,?,

[SQL] prepared statement in crosstab query

2012-08-31 Thread Samuel Gendler
I have the following crosstab query, which needs to be parameterized in the 2 inner queries: SELECT * FROM crosstab( $$ SELECT t.local_key, s.sensor_pk, CASE WHEN t.local_day_abbreviation IN (?,?,?,?,?,?,?) THEN q.dpoint_value ELSE NULL END as dpoint

Re: [SQL] locks and "select for update"

2012-08-31 Thread Tom Lane
Wayne Cuddy writes: > The documentation about concurrency states that all the different types > of locks are table locks even if the word row appears in the lock name. Section 13.3.1, "Table-level Locks", states that all the lock types discussed therein are table-level locks, even though some of

[SQL] locks and "select for update"

2012-08-31 Thread Wayne Cuddy
The documentation about concurrency states that all the different types of locks are table locks even if the word row appears in the lock name. The documentation about select statements states that when "for update of" is used that only the selected rows will be locked. Is this true or does this r