Re: [HACKERS] Proposal for SYNONYMS

2006-03-10 Thread Bernd Helmle
--On Donnerstag, März 09, 2006 17:23:11 -0500 Tom Lane [EMAIL PROTECTED] wrote: (BTW, there was some work being done on updatable views, but I think it's stalled. I suspect the reason is that our current rule system is just too odd to support updatable views reasonably. I've been

Re: [HACKERS] Updateable views was:(Re: [HACKERS] Proposal for SYNONYMS)

2006-03-10 Thread Richard Huxton
Jaime Casanova wrote: On 3/9/06, Tom Lane [EMAIL PROTECTED] wrote: Josh Berkus josh@agliodbs.com writes: Eh? I thought that it was just syntatic sugar that was missing. I've built lots of updatable views manually; I don't see what's difficult about it. I think you'll find that corner cases

Re: [HACKERS] Proposal for SYNONYMS

2006-03-10 Thread Kris Jurka
On Thu, 9 Mar 2006, Jonah H. Harris wrote: 2) For my comprehension, what's the difference between a SYNONYM and a single-object (possibly updatable) view? Not a whole lot actually. If we had updateable views, I'd suggest that people change their create synonym syntax to create view. One

Re: [HACKERS] Proposal for SYNONYMS

2006-03-10 Thread Tom Lane
Kris Jurka [EMAIL PROTECTED] writes: One key difference would be that synonyms track schema updates, like adding a column, to the referenced object that a view would not. That raises a fairly interesting point, actually. What would you expect to happen here: CREATE TABLE foo ...;

Re: [HACKERS] Proposal for SYNONYMS

2006-03-10 Thread Ragnar
On fös, 2006-03-10 at 16:51 -0500, Tom Lane wrote: Kris Jurka [EMAIL PROTECTED] writes: One key difference would be that synonyms track schema updates, like adding a column, to the referenced object that a view would not. That raises a fairly interesting point, actually. What would you

[HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Jonah H. Harris
This email is a preliminary design for the implementation of synonyms in PostgreSQL. Comments and suggestions are welcomed. BACKGROUND Synonyms are database objects which can be used in place of their referenced object in SELECT, INSERT, UPDATE, and DELETE SQL statements.

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Jonah H. Harris
On 3/9/06, William ZHANG [EMAIL PROTECTED] wrote: Or should we letDROP TABLE foo CASCADE;to drop the SYNONYMS depended on the table? Yes, I don't see any reason not to allow a cascading table drop include synonyms that reference them. Also need to add \d support for psql. Yes. Thanks for adding

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Stephen Frost
* Jonah H. Harris ([EMAIL PROTECTED]) wrote: In addition, SYNONYMS do participate in ACLs and support GRANT/REVOKE for table privileges. DROP TABLE and TRUNCATE cannot be used with synonyms. I assume you actually mean owner-level rights cannot be used with synonyms. - Permission on a synonym

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Stephen Frost
* Jonah H. Harris ([EMAIL PROTECTED]) wrote: On 3/9/06, William ZHANG [EMAIL PROTECTED] wrote: Or should we let DROP TABLE foo CASCADE; to drop the SYNONYMS depended on the table? Yes, I don't see any reason not to allow a cascading table drop include synonyms that reference them.

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Hans-Jürgen Schönig
Jonah H. Harris wrote: This email is a preliminary design for the implementation of synonyms in PostgreSQL. Comments and suggestions are welcomed. BACKGROUND Synonyms are database objects which can be used in place of their referenced object in SELECT, INSERT, UPDATE, and DELETE SQL

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Stephen Frost
* Stephan Szabo ([EMAIL PROTECTED]) wrote: On Thu, 9 Mar 2006, Stephen Frost wrote: Should a non-cascade drop fail or just implicitly drop the synonyms? I'm not sure which way I feel about this... Users with only 'select' permissions on a given object can't currently create objects which

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Josh Berkus
Jonah, This email is a preliminary design for the implementation of synonyms in PostgreSQL.  Comments and suggestions are welcomed. 1) Is there a SQL standard for this? 2) For my comprehension, what's the difference between a SYNONYM and a single-object (possibly updatable) view? -- --Josh

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Jonah H. Harris
On 3/9/06, Josh Berkus josh@agliodbs.com wrote: 1) Is there a SQL standard for this? Nope. 2) For my comprehension, what's the difference between a SYNONYM and asingle-object (possibly updatable) view? Not a whole lot actually. If we had updateable views, I'd suggest that people change their

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Stephan Szabo
On Thu, 9 Mar 2006, Josh Berkus wrote: Jonah, This email is a preliminary design for the implementation of synonyms in PostgreSQL.  Comments and suggestions are welcomed. 1) Is there a SQL standard for this? 2) For my comprehension, what's the difference between a SYNONYM and a

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Jonah H. Harris
On 3/9/06, Stephan Szabo [EMAIL PROTECTED] wrote: As I understood the synonym plan, aperson with select on the synonym but not on the referenced table wouldn'tbe able to select through the synonym, while if the view was created bysomeone with select a person with select on the view could select

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Tom Lane
Stephan Szabo [EMAIL PROTECTED] writes: On Thu, 9 Mar 2006, Josh Berkus wrote: 2) For my comprehension, what's the difference between a SYNONYM and a single-object (possibly updatable) view? I think with the plan as described, the permissions handling is slightly different from how we handle

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread elein
On Thu, Mar 09, 2006 at 04:42:43PM -0500, Jonah H. Harris wrote: On 3/9/06, Josh Berkus josh@agliodbs.com wrote: 1) Is there a SQL standard for this? Nope. 2) For my comprehension, what's the difference between a SYNONYM and a single-object (possibly updatable) view?

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Hannu Krosing
Ühel kenal päeval, N, 2006-03-09 kell 11:35, kirjutas Jonah H. Harris: This email is a preliminary design for the implementation of synonyms in PostgreSQL. Comments and suggestions are welcomed. BACKGROUND Synonyms are database objects which can be used in place of their referenced

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Stephen Frost
* elein ([EMAIL PROTECTED]) wrote: On Thu, Mar 09, 2006 at 04:42:43PM -0500, Jonah H. Harris wrote: Not a whole lot actually. If we had updateable views, I'd suggest that people change their create synonym syntax to create view. However, it would take substantially more work to

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Stephan Szabo
On Thu, 9 Mar 2006, Tom Lane wrote: Stephan Szabo [EMAIL PROTECTED] writes: On Thu, 9 Mar 2006, Josh Berkus wrote: 2) For my comprehension, what's the difference between a SYNONYM and a single-object (possibly updatable) view? I think with the plan as described, the permissions handling

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Tom Lane
Stephan Szabo [EMAIL PROTECTED] writes: Well, the permissions handling would still be different between a view and a synonym AFAICS even if we dropped separate permissions on synonyms, so I don't think they're drop in replacements for each other even after updatable views. Agreed, but given

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Josh Berkus
Tom, (BTW, there was some work being done on updatable views, but I think it's stalled. I suspect the reason is that our current rule system is just too odd to support updatable views reasonably. I've been wondering if an implementation based on allowing triggers on views would be any more

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Tom Lane
Josh Berkus josh@agliodbs.com writes: Eh? I thought that it was just syntatic sugar that was missing. I've built lots of updatable views manually; I don't see what's difficult about it. I think you'll find that corner cases like inserts involving nextval() don't work real well with a

[HACKERS] Updateable views was:(Re: [HACKERS] Proposal for SYNONYMS)

2006-03-09 Thread Jaime Casanova
On 3/9/06, Tom Lane [EMAIL PROTECTED] wrote: Josh Berkus josh@agliodbs.com writes: Eh? I thought that it was just syntatic sugar that was missing. I've built lots of updatable views manually; I don't see what's difficult about it. I think you'll find that corner cases like inserts