Re: [HACKERS] Please advise features in 7.1 (SUMMARY)

2000-11-30 Thread Don Baccus

At 05:24 AM 11/30/00 +, Thomas Lockhart wrote:
 Is "if" clause support in PG?
 for example:
 "drop table aa if exist"
 "insert into aa values(1) if not exists select * from aa where i=1"

No. afaict it is not in any SQL standard, so is unlikely to get much
attention from developers.

The insert, at least, can be written in standard SQL anyway...



- Don Baccus, Portland OR [EMAIL PROTECTED]
  Nature photos, on-line guides, Pacific Northwest
  Rare Bird Alert Service and other goodies at
  http://donb.photo.net.



AW: [HACKERS] Please advise features in 7.1 (SUMMARY)

2000-11-28 Thread Zeugswetter Andreas SB


  This is a summary of replies.
  
  1. Calculated fields in table definitions . eg.
  
  Create table test (
   A Integer,
   B integer,
  the_sum   As  (A+B),
  );
  
  This functionality can be achieved through the use of views.
 
 Using a view for this isn't quite the same functionality as a computed
 field, from what I understand, since the calculation will be done at
 SELECT time, rather than INSERT/UPDATE.

I would expect the calculated field from above example to be calculated
during select time also, no ? You don't want to waste disk space with something 
you can easily compute at runtime.

Andreas



Re: [HACKERS] Please advise features in 7.1 (SUMMARY)

2000-11-28 Thread Mitch Vincent

I guess it depends on what you're using it for -- disk space is cheap and
abundant anymore, I can see some advantages of having it computed only once
rather than X times, where X is the number of SELECTs as that could get
costly on really high traffic servers.. Costly not so much for simple
computations like that but more complex ones.

Just playing the devil's advocate a bit.

-Mitch

- Original Message -
From: "Zeugswetter Andreas SB" [EMAIL PROTECTED]
To: "'Ross J. Reedstrom'" [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, November 28, 2000 7:50 AM
Subject: AW: [HACKERS] Please advise features in 7.1 (SUMMARY)



   This is a summary of replies.
  
   1. Calculated fields in table definitions . eg.
  
   Create table test (
A Integer,
B integer,
   the_sum   As  (A+B),
   );
  
   This functionality can be achieved through the use of views.
 
  Using a view for this isn't quite the same functionality as a computed
  field, from what I understand, since the calculation will be done at
  SELECT time, rather than INSERT/UPDATE.

 I would expect the calculated field from above example to be calculated
 during select time also, no ? You don't want to waste disk space with
something
 you can easily compute at runtime.

 Andreas





Re: [HACKERS] Please advise features in 7.1 (SUMMARY)

2000-11-28 Thread Mitch Vincent

 So, having _both_ is the best thing.

Absolutely, that's always what I meant -- we already have views and views
can do this type of stuff at SELECT time can't they? So it's not a change,
just an addition

-Mitch




[HACKERS] Please advise features in 7.1 (SUMMARY)

2000-11-27 Thread John Huttley

Thanks for your help, everyone.

This is a summary of replies.

1. Calculated fields in table definitions . eg.

Create table test (
 A Integer,
 B integer,
the_sum   As  (A+B),
);

This functionality can be achieved through the use of views.
Implementing the create table syntax  may not be too hard,
but not in 7.1...

2  Parameterised Triggers

Functionality is there, just that the documentation gave the wrong implication.
An user manual example of using parameterised triggers to implement referential
integrity
would be welcome.

3. Stored Procedures returning a record set.

Dream on!


Regards

John





Re: [HACKERS] Please advise features in 7.1 (SUMMARY)

2000-11-27 Thread Andrew Snow


On Tue, 28 Nov 2000, John Huttley wrote:

 3. Stored Procedures returning a record set.
 
 Dream on!

This is something I would be really interested to see working. What are the
issues?  my understanding is that it is technically feasible but too
complicated to add to PL/PGsql?  it seems to me a basic service that needs
to be implemented soon, even if its just returning multiple rows of one
column...


- Andrew