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 wou

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 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] 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 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 in

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 wonderi

[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 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 n

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Tom Lane
Josh Berkus 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 rule-based updatabl

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

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 gi

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 permiss

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 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 > referen

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 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? > > > Not

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 w

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 t

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

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Jonah H. Harris
On 3/9/06, Josh Berkus 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 c

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? -- --Jos

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 w

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread Stephan Szabo
On Thu, 9 Mar 2006, Stephen Frost wrote: > * 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 all

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 state

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 refere

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 syno

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 add

Re: [HACKERS] Proposal for SYNONYMS

2006-03-09 Thread William ZHANG
SYNONYMS are symbolinks in database? CREATE SYNONYMS bar FOR foo; DROP TABLE foo; Now bar point to an invalid object. Or should we let DROP TABLE foo CASCADE; to drop the SYNONYMS depended on the table? Also need to add \d support for psql. Regards, William ZHANG --

[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.