Re: [SQL] Joining a result set from four (4) tables

2006-07-31 Thread John Tregea
Hi aaron, Here are the 'create table' statements. I have indicated what are the primary and foreign keys with trailing comments. Thanks John Aaron Bono wrote: Can you include the table create statements with primary and foreign keys? That would help a lot. CREATE TABLE resources ( seria

Re: [SQL] primary keys as TEXT

2006-07-31 Thread Aaron Bono
On 7/31/06, Manlio Perillo <[EMAIL PROTECTED]> wrote: Because serial ids are only surrogate keys.My tables have well definited primary keys, the only problem is thatthey are of type TEXT (and spawn up to 3 columns).My concern is: how bad can be performance?  My guess is that the performance differe

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread George Weaver
- Original Message - From: Aaron Bono To: John DeSoi I don't think so but there was some discussion a week or two ago about mixing variables and using execute. I am curious, does anyone >know what the "best" approach is? Also, I did not address deletions. If you still need to d

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread Milen A. Radev
Thusitha Kodikara написа: > Hello, > > I am interested in developing some triggers to keep track of records that are > changed (possibly the changes of one or more specific columns). In addition > to keeping the new values, I also need to keep the old values (may be on a > separate table). >

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread Ken Hill
On Sun, 2006-07-30 at 21:16 -0700, Thusitha Kodikara wrote: > Hello, > > I am interested in developing some triggers to keep track of records > that are changed (possibly the changes of one or more specific > columns). In addition to keeping the new values, I also need to keep > the old values (ma

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread John DeSoi
On Jul 31, 2006, at 10:59 AM, Aaron Bono wrote: On 7/31/06, John DeSoi <[EMAIL PROTECTED]> wrote: Is it really necessary to build a SQL string and use execute? It seems you could just issue the INSERT statement. I don't think so but there was some discussion a week or two ago about mixing va

Re: [SQL] DBD::Pg ... how would I format this prepare?

2006-07-31 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, "Marc G. Fournier" <[EMAIL PROTECTED]> writes: > I need to do: > NOW() + '2 day'::interval > where 2 is a variable ... > if I do: > NOW() + '? day'::interval > it, of course, takes the ? as a literal ... so is there some way I can > do this such that I can do t

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread Aaron Bono
On 7/31/06, John DeSoi <[EMAIL PROTECTED]> wrote: Is it really necessary to build a SQL string and use execute? Itseems you could just issue the INSERT statement.I don't think so but there was some discussion a week or two ago about mixing variables and using execute.  I am curious, does anyone kno

Re: [SQL] DBD::Pg ... how would I format this prepare?

2006-07-31 Thread Mathieu Arnold
+-le 26/07/2006 18:29 -0300, Marc G. Fournier a dit : | | I need to do: | | NOW() + '2 day'::interval | | where 2 is a variable ... | | if I do: | | NOW() + '? day'::interval | | it, of course, takes the ? as a literal ... so is there some way I can do | this such that I can do the placeholde

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread John DeSoi
Is it really necessary to build a SQL string and use execute? It seems you could just issue the INSERT statement. On Jul 31, 2006, at 12:52 AM, Aaron Bono wrote: CREATE OR REPLACE FUNCTION my_table_history_fn () RETURNS SETOF opaque AS ' BEGIN -- if a trigger insert or update operation

Re: [SQL] primary keys as TEXT

2006-07-31 Thread Manlio Perillo
Aaron Bono ha scritto: > On 7/28/06, *Manlio Perillo* <[EMAIL PROTECTED] > > wrote: > > Michael Glaesemann ha scritto: > > > > On Jul 28, 2006, at 17:37 , Manlio Perillo wrote: > > > >> There can be performancs problems in having primary keys of type >

Re: [SQL] Joining a result set from four (4) tables

2006-07-31 Thread Aaron Bono
On 7/31/06, John Tregea <[EMAIL PROTECTED]> wrote: Hi,Can anyone help me with the following?I am setting up a series of permissions of my own making in pgSQL 8.1.4.I have the following tables;resource -- a list of available resourcesactions -- the actions available to the user policies -- the actio

[SQL] Joining a result set from four (4) tables

2006-07-31 Thread John Tregea
Hi, Can anyone help me with the following? I am setting up a series of permissions of my own making in pgSQL 8.1.4. I have the following tables; resource -- a list of available resources actions -- the actions available to the user policies -- the actions that are allowed to be performed on i