Re: [SQL] Need help revoking access WHERE state = 'deleted'

2013-03-02 Thread Wayne Cuddy
On Thu, Feb 28, 2013 at 06:02:05PM +, Ben Morrow wrote: > Quoth m...@summersault.com (Mark Stosberg): > > > > We are working on a project to start storing some data as "soft deleted" > > (WHERE state = 'deleted') instead of hard-deleting it. > > > > To make sure that we never accidentally exp

[SQL] index scan vs bitmap index scan

2013-02-05 Thread Wayne Cuddy
I have a table with with an index that is of type 'timestamp without time zone'. Multiple records are inserted per second so the index is not unique. This table experiences frequent inserts and updates. Bulk deletes are performed once per month. Slower than expected search times are experienced w

[SQL] transactions and ecpg

2012-09-22 Thread Wayne Cuddy
I'm looking at some code that a coworker ported from Informix to Postgres 9.0. The Informix database did not have transaction logging enabled thus no begins/aborts/commits/rollbacks where in the original code. The way the code has been ported there are still no begin statements in the code, only co

[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

Re: [SQL] fsync debug messages in pgsql logs

2012-08-08 Thread Wayne Cuddy
Ok, I'll keep an eye on it but I'm not so worried now. Thanks Tom. On Wed, Aug 08, 2012 at 12:57:01PM -0400, Tom Lane wrote: > Wayne Cuddy writes: > > On Wed, Aug 08, 2012 at 12:23:22PM -0400, Tom Lane wrote: > >> If it only complains once per file name, th

Re: [SQL] fsync debug messages in pgsql logs

2012-08-08 Thread Wayne Cuddy
On Wed, Aug 08, 2012 at 12:23:22PM -0400, Tom Lane wrote: > Wayne Cuddy writes: > > I'm seeing this in my PGSQL logs, is this something to be concerned > > about? I know the file system it sits on is reliable and the DB appears > > to run with fine, additionally the

[SQL] fsync debug messages in pgsql logs

2012-08-08 Thread Wayne Cuddy
I'm seeing this in my PGSQL logs, is this something to be concerned about? I know the file system it sits on is reliable and the DB appears to run with fine, additionally the log indicates it's a debug message. I did some google searches and didn't find much. When I examine the file system file by

Re: [SQL] can this be done with a check expression?

2012-08-08 Thread Wayne Cuddy
This was posted under the wrong subject.. Please ignore, will repost. On Wed, Aug 08, 2012 at 11:41:01AM -0400, Wayne Cuddy wrote: > I'm seeing this in my PGSQL logs, is this something to be concerned > about? I know the file system it sits on is reliable and the DB appears > to

Re: [SQL] can this be done with a check expression?

2012-08-08 Thread Wayne Cuddy
I'm seeing this in my PGSQL logs, is this something to be concerned about? I know the file system it sits on is reliable and the DB appears to run with fine, additionally the log indicates it's a debug message. I did some google searches and didn't find much. When I examine the file system file by

Re: [SQL] can this be done with a check expression?

2012-08-03 Thread Wayne Cuddy
ote: > On Aug 2, 2012, at 7:10 PM, Wayne Cuddy wrote: > > > I have a table with 3 columns: > > > > name text > > start_id integer > > end_id integer > > > > start_id and end_id are ranges which must not overlap but can have gaps > > between th

[SQL] can this be done with a check expression?

2012-08-02 Thread Wayne Cuddy
I have a table with 3 columns: name text start_id integer end_id integer start_id and end_id are ranges which must not overlap but can have gaps between them. Is it possible to formulate a table check constraint that can verify that either id does not fall within an existing range at insert time?

[SQL] Partitioned Tables

2012-06-12 Thread Wayne Cuddy
I'm using partitioned tables where a child table is chosen based on a time stamp. One child table exists for each month. I move records from a temp table to the partitioned table via something like this: INSERT INTO parent_table SELECT * FROM temp_table; All works well but with when inserting to