Re: [SQL] Conditional rule?

2000-07-28 Thread Robert B. Easter
On Fri, 28 Jul 2000, André Næss wrote: > Thanks for all the help so far. What I now have is the following structure: > > create table b_news ( > id serial primary key, > title varchar(60), > time timestamp > ); > > create table b_news_unpublished ( > news_id int references news on delete

Re: [SQL] Transactions

2000-07-28 Thread John McKown
On Fri, 28 Jul 2000, Carolyn Lu Wong wrote: > Does postgreSQL support nested transactions? > no.

Re: [SQL] two table comparison: find a mismatch?

2000-07-28 Thread Ross J. Reedstrom
On Fri, Jul 28, 2000 at 04:54:58PM -0400, Web Manager wrote: > Hello, > > here is to table: >Table "city" >Attribute|Type | Modifier > +-+- > city_id|

[SQL] two table comparison: find a mismatch?

2000-07-28 Thread Web Manager
Hello, here is to table: Table "city" Attribute|Type | Modifier +-+- city_id| smallint| not null default nextval('seq_city'::text) region_id |

RE: RE: Re(2): [SQL] optimize sql

2000-07-28 Thread Henry Lafleur
I'm kind of new to pgsql, but as long as MAX works for boolean fields, they you can just change the first query below with: HAVING MAX(active) != 't' but it seems that pgsql can have user defined aggregates, so you could define a function that computes the MAX of a boolean and define true to be

Re: [SQL] Conditional rule?

2000-07-28 Thread Tom Lane
"=?iso-8859-1?B?QW5kcukgTuZzcw==?=" <[EMAIL PROTECTED]> writes: > Secondly, I miss one final idea, when a delete is performed on the > b_news_unpublished table, I would like to set up a rule or procedure that > sets the time value to null in b_news for each row that is affected by the > delete. I

Re: [SQL] Conditional rule?

2000-07-28 Thread André Næss
Thanks for all the help so far. What I now have is the following structure: create table b_news ( id serial primary key, title varchar(60), time timestamp ); create table b_news_unpublished ( news_id int references news on delete cascade ); CREATE FUNCTION b_news_trigproc() RETURNS OPAQ

Re: [SQL] Conditional rule?

2000-07-28 Thread Itai Zukerman
> > CREATE RULE newsrule AS ON INSERT TO news > > WHERE new.publishtime NOTNULL DO > > INSERT INTO news_unpublished VALUES (new.id); > > The following happens: > rules=# insert into news (title, time) values('Hei', now()); > ERROR: referential integrity violation

Re: [SQL] BLOBs

2000-07-28 Thread André Næss
- Original Message - From: "Bernie Huang" <[EMAIL PROTECTED]> > Hi, everyone, > > Browsing through the online manual, I didn't find anything related to > BLOBs, but I know there must be BLOBs since many people are asking about > it on the list and there is a pg_fetch_object() in PHP for

Re: [SQL] Conditional rule?

2000-07-28 Thread André Næss
- Original Message - > No. The rule > > CREATE RULE newsrule AS ON INSERT TO news > WHERE new.publishtime NOTNULL DO > INSERT INTO news_unpublished VALUES (new.id); > > should do the job perfectly. Maybe you want to have the > following rul

[SQL] Transactions

2000-07-28 Thread Carolyn Lu Wong
Does postgreSQL support nested transactions?