Re: [SQL] Multi-table insert using RULE - how to handle id?

2006-07-19 Thread Ross Johnson
Aaron Bono wrote: On 7/19/06, *Collin Peters* <[EMAIL PROTECTED] > wrote: I am learning about how to use rules to handle a multi-table insert. Right now I have a user_activity table which tracks history and a user_activity_users table which tracks what use

Re: [SQL] Multi-table insert using RULE - how to handle id?

2006-07-19 Thread Aaron Bono
On 7/19/06, Collin Peters <[EMAIL PROTECTED]> wrote: I am learning about how to use rules to handle a multi-table insert.Right now I have a user_activity table which tracks history and auser_activity_users table which tracks what users are associated witha row in user_activity (one to many relation

FW: [SQL] Table Join (Maybe?)

2006-07-19 Thread Phillip Smith
Thanks all for your suggestions – the below suggestion works perfectly.   A little tweak of the column counts and group by clauses makes it work like a charm.   Richard – this particular extract is via PHP to a web page so I can’t use those reporting tools, but I’ll have a look and fidd

[SQL] Multi-table insert using RULE - how to handle id?

2006-07-19 Thread Collin Peters
I am learning about how to use rules to handle a multi-table insert. Right now I have a user_activity table which tracks history and a user_activity_users table which tracks what users are associated with a row in user_activity (one to many relationship). I created a rule (and a view called user_

Re: [SQL] User Permission

2006-07-19 Thread Richard Broersma Jr
> > Dear group, > >i created a user named 'dataviewer' and grant only select permission to > > that user, > >but now the user could able to create tables. how to restrict this, > >i want to give permission to create views and do selects on tables and > > views. > >how to do it? > >

Re: [SQL] INSERT/UPDATEs cycles and lack of phantom locking

2006-07-19 Thread Florian Weimer
* Tom Lane: > Why do you think that? If you're running in READ COMMITTED mode then > each statement takes a new snapshot. Ah, I should have explained that. I might need the SERIALIZABLE isolation level in the future (this code doesn't need it, but other things in the same transaction might requ

Re: [SQL] User Permission

2006-07-19 Thread Aaron Bono
On 7/19/06, sathish kumar shanmugavelu <[EMAIL PROTECTED]> wrote: Dear group,   i created a user named 'dataviewer' and grant only select permission to that user,   but now the user could able to create tables. how to restrict this,   i want to give permission to create views and do selects on tabl

Re: [SQL] Use of cmin in psql

2006-07-19 Thread Tom Lane
"sathiya moorthy" <[EMAIL PROTECTED]> writes: > what is the use of the cmin system column http://www.postgresql.org/docs/8.1/static/ddl-system-columns.html regards, tom lane ---(end of broadcast)--- TIP 6: explain analyz

Re: [SQL] Storing encrypted data?

2006-07-19 Thread Aaron Bono
On 7/19/06, John Tregea <[EMAIL PROTECTED]> wrote: Hi Aaron,I found that your suggestion worked well. For some reason the IDE I use(Revolution) put a return character every 73rd character when it did thebase64encode, but I strip those out and there no further problems. I don't even have to put them

Re: [SQL] Table Join (Maybe?)

2006-07-19 Thread Erik Jones
Phillip Smith wrote: Hi again all, I have two tables: 1. Sales figures by date and customer. 2. Customer details – including their Geographic State I need to extract a report from the first table (I can do that!), and in that report order by their State (I can do that too!), but I also nee

Re: [SQL] INSERT/UPDATEs cycles and lack of phantom locking

2006-07-19 Thread Tom Lane
Florian Weimer <[EMAIL PROTECTED]> writes: > BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED; -- SERIALIZABLE > ... > -- SAVEPOINT tmp_created; -- (see below) > CREATE TEMPORARY TABLE tmp2 AS SELECT tmp.key, new_val, real.val AS old_val > FROM tmp LEFT OUTER JOIN real ON tmp.key = real.key; >

Re: [SQL] Sequences, values still increased

2006-07-19 Thread Chris Browne
Paul Maier <[EMAIL PROTECTED]> writes: > Hello everybody, > > Why does... > > BEGIN; > SELECT nextval('test.test_seq') AS id; > ROLLBACK; > > ...still increase the sequence after aborting the transaction? This > nextval-command should be reverted after rolling back, right? Same with an > ABORT: > >

[SQL] User Permission

2006-07-19 Thread sathish kumar shanmugavelu
Dear group,   i created a user named 'dataviewer' and grant only select permission to that user,   but now the user could able to create tables. how to restrict this,   i want to give permission to create views and do selects on tables and views.    how to do it?   plz help.-- Sathish Kumar.SSpireT

Re: [SQL] Table Join (Maybe?)

2006-07-19 Thread Richard Broersma Jr
> I have two tables: > 1. Sales figures by date and customer. > 2. Customer details - including their Geographic State > I need to extract a report from the first table (I can do that!), and in > that report order by their State (I can do that too!), but I also need a > summary of all the customer

[SQL] Use of cmin in psql

2006-07-19 Thread sathiya moorthy
hi, what is the use of the cmin system column After inserting if i see this column cmin has the 0 in the ordinary places., If it is in the transaction place ( between BEGIN and END ) where i had deleted and rollbacked that column has the 33397398 somw what large number..-- s

Re: [SQL] Storing encrypted data?

2006-07-19 Thread John Tregea
Hi Aaron, I found that your suggestion worked well. For some reason the IDE I use (Revolution) put a return character every 73rd character when it did the base64encode, but I strip those out and there no further problems. I don't even have to put them back later to decode it. Thanks John T

[SQL] INSERT/UPDATEs cycles and lack of phantom locking

2006-07-19 Thread Florian Weimer
I've got several tables where I need to either insert new records, or update existing ones (identified based on the primary key). For performance reasons, I want to do this in batches, so I plan to use something like this: BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED; -- SERIALIZABLE ... CREA

[SQL] Table Join (Maybe?)

2006-07-19 Thread Phillip Smith
Hi again all,   I have two tables: 1. Sales figures by date and customer. 2. Customer details – including their Geographic State   I need to extract a report from the first table (I can do that!), and in that report order by their State (I can do that too!), but I also need a summary