Lists: | pgsql-hackerspgsql-patches |
---|
From: | Kaare Rasmussen <kar(at)kakidata(dot)dk> |
---|---|
To: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Updated TODO item |
Date: | 2002-01-04 17:07:39 |
Message-ID: | 200201041708.g04H88m71327@postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
> * Make it easier to create a database owned by someone who can't createdb,
> perhaps CREATE DATABASE dbname WITH USER = "user"
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Shouldn't that be
CREATE DATABASE dbname WITH OWNER = "user"
?
--
Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582
Kaki Data tshirts, merchandize Fax: 3816 2501
Howitzvej 75 Åben 14.00-18.00 Web: www.suse.dk
2000 Frederiksberg Lørdag 11.00-17.00 Email: kar(at)kakidata(dot)dk
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Kaare Rasmussen <kar(at)kakidata(dot)dk> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Updated TODO item |
Date: | 2002-01-04 18:43:41 |
Message-ID: | 200201041843.g04IhfJ10366@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Kaare Rasmussen wrote:
> > * Make it easier to create a database owned by someone who can't createdb,
> > perhaps CREATE DATABASE dbname WITH USER = "user"
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Shouldn't that be
>
> CREATE DATABASE dbname WITH OWNER = "user"
>
> ?
Yes! OWNER is much better. TODO updated and I will save this message
for changes in 7.3:
http://candle.pha.pa.us/cgi-bin/pgpatches2
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From: | Doug McNaught <doug(at)wireboard(dot)com> |
---|---|
To: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | Kaare Rasmussen <kar(at)kakidata(dot)dk>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Updated TODO item |
Date: | 2002-01-04 18:58:09 |
Message-ID: | m3sn9meyf2.fsf@varsoon.denali.to |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Shouldn't that be
> >
> > CREATE DATABASE dbname WITH OWNER = "user"
> >
> > ?
>
> Yes! OWNER is much better. TODO updated and I will save this message
> for changes in 7.3:
Will this make OWNER into a new keyword, and break schemas that have
"owner" as a table or column name? USER is at least already a
keyword...
-Doug (not personally affected, but thought I'd raise it)
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Doug McNaught <doug(at)wireboard(dot)com> |
Cc: | Kaare Rasmussen <kar(at)kakidata(dot)dk>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Updated TODO item |
Date: | 2002-01-04 19:04:00 |
Message-ID: | 200201041904.g04J40P12249@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Doug McNaught wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>
> > > Shouldn't that be
> > >
> > > CREATE DATABASE dbname WITH OWNER = "user"
> > >
> > > ?
> >
> > Yes! OWNER is much better. TODO updated and I will save this message
> > for changes in 7.3:
>
> Will this make OWNER into a new keyword, and break schemas that have
> "owner" as a table or column name? USER is at least already a
> keyword...
We already use OWNER in ALTER TABLE so it is not really a new keyword:
| ALTER TABLE relation_name OWNER TO UserId
Also, its usage is limited to CREATE TABLE so I believe a column named
owner is still possible, as it is now.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> |
---|---|
To: | Kaare Rasmussen <kar(at)kakidata(dot)dk> |
Cc: | pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-01-05 01:59:32 |
Message-ID: | Pine.LNX.4.21.0201051250030.19760-101000@linuxworld.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
On Fri, 4 Jan 2002, Kaare Rasmussen wrote:
> > * Make it easier to create a database owned by someone who can't createdb,
> > perhaps CREATE DATABASE dbname WITH USER = "user"
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Shouldn't that be
>
> CREATE DATABASE dbname WITH OWNER = "user"
>
> ?
>
A much better idea. There is no conflict in using OWNER here.
Revised patch attached.
Gavin
Attachment | Content-Type | Size |
---|---|---|
createdb_with_owner3.patch.gz | application/x-gzip | 2.0 KB |
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> |
Cc: | Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-01-05 02:28:24 |
Message-ID: | 200201050228.g052SOg29848@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Saved for 7.3.
---------------------------------------------------------------------------
Gavin Sherry wrote:
> On Fri, 4 Jan 2002, Kaare Rasmussen wrote:
>
> > > * Make it easier to create a database owned by someone who can't createdb,
> > > perhaps CREATE DATABASE dbname WITH USER = "user"
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > Shouldn't that be
> >
> > CREATE DATABASE dbname WITH OWNER = "user"
> >
> > ?
> >
>
> A much better idea. There is no conflict in using OWNER here.
>
> Revised patch attached.
>
> Gavin
Content-Description:
[ Attachment, skipping... ]
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From: | Thomas Lockhart <lockhart(at)fourpalms(dot)org> |
---|---|
To: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> |
Cc: | Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-01-08 03:47:20 |
Message-ID: | 3C3A6BC8.591D12@fourpalms.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
> > > * Make it easier to create a database owned by someone who can't createdb,
> > > perhaps CREATE DATABASE dbname WITH USER = "user"
> > CREATE DATABASE dbname WITH OWNER = "user"
> A much better idea. There is no conflict in using OWNER here.
Does this have the multiple "WITH xxx" clauses which were discussed
earlier? That is a nonstarter for syntax. There are other places in the
grammar having "with clauses" and multiple arguments or subclauses, and
having the shift/reduce issues resolved...
- Thomas
From: | "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au> |
---|---|
To: | <lockhart(at)fourpalms(dot)org>, "Gavin Sherry" <swm(at)linuxworld(dot)com(dot)au> |
Cc: | "Kaare Rasmussen" <kar(at)kakidata(dot)dk>, <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-01-08 03:58:11 |
Message-ID: | GNELIHDDFBOCMGBFGEFOEEANCBAA.chriskl@familyhealth.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
> Does this have the multiple "WITH xxx" clauses which were discussed
> earlier? That is a nonstarter for syntax. There are other places in the
> grammar having "with clauses" and multiple arguments or subclauses, and
> having the shift/reduce issues resolved...
I might be thicker than a whale sandwich (10 points if you can pick the
quote :) ), but can someone please tell me what a shift/reduce issue is,
exactly...
Thanks,
Chris
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | lockhart(at)fourpalms(dot)org |
Cc: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-01-08 04:01:51 |
Message-ID: | 200201080401.g0841pm12730@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Thomas Lockhart wrote:
> > > > * Make it easier to create a database owned by someone who can't createdb,
> > > > perhaps CREATE DATABASE dbname WITH USER = "user"
> > > CREATE DATABASE dbname WITH OWNER = "user"
> > A much better idea. There is no conflict in using OWNER here.
>
> Does this have the multiple "WITH xxx" clauses which were discussed
> earlier? That is a nonstarter for syntax. There are other places in the
> grammar having "with clauses" and multiple arguments or subclauses, and
> having the shift/reduce issues resolved...
Not sure. Patch is at:
http://candle.pha.pa.us/cgi-bin/pgpatches2
Are you asking if it has "WITH ARG val, ARG val" or "WITH ARG val WITH
ARG val?"
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From: | Thomas Lockhart <lockhart(at)fourpalms(dot)org> |
---|---|
To: | Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> |
Cc: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-01-08 04:03:42 |
Message-ID: | 3C3A6F9E.3DE49B19@fourpalms.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
> I might be thicker than a whale sandwich (10 points if you can pick the
> quote :) ), but can someone please tell me what a shift/reduce issue is,
> exactly...
It is what you will come to know and love if you get involved with
grammars written in yacc. yacc (and some related parsers) look ahead one
token to decide what parsing path to take. So if it takes more than one
token to figure that out, you will get a shift/reduce or reduce/reduce
error, and the parser will end up chosing *one* of the possibilities
every time.
You can make these errors go away by restructuring the language or by
restructuring the grammar specification to allow multiple "threads" of
parsing to be carried forward until possible conflicts are resolved. We
use every and all technique to shoehorn SQL and extensions into a
yacc/bison tool ;)
- Thomas
From: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> |
---|---|
To: | Thomas Lockhart <lockhart(at)fourpalms(dot)org> |
Cc: | Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-01-08 04:26:07 |
Message-ID: | Pine.LNX.4.21.0201081517040.9642-100000@linuxworld.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
On Tue, 8 Jan 2002, Thomas Lockhart wrote:
> > > > * Make it easier to create a database owned by someone who can't createdb,
> > > > perhaps CREATE DATABASE dbname WITH USER = "user"
> > > CREATE DATABASE dbname WITH OWNER = "user"
> > A much better idea. There is no conflict in using OWNER here.
>
> Does this have the multiple "WITH xxx" clauses which were discussed
> earlier? That is a nonstarter for syntax. There are other places in the
When was it discussed so that I can have a read? I cannot recall it.
And yes, it is not pleasant to implement. Luckily, the design of the
CREATE DATABASE rule had already incorporated the possibility of
...
WITH LOCATION = ...
WITH TEMPLAETE = ...
etc.
I'm not sure, however, if this is really what you were asking.
Gavin
From: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> |
---|---|
To: | Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> |
Cc: | Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-01-08 04:42:13 |
Message-ID: | Pine.LNX.4.21.0201081526210.9642-100000@linuxworld.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
On Tue, 8 Jan 2002, Christopher Kings-Lynne wrote:
> > Does this have the multiple "WITH xxx" clauses which were discussed
> > earlier? That is a nonstarter for syntax. There are other places in the
> > grammar having "with clauses" and multiple arguments or subclauses, and
> > having the shift/reduce issues resolved...
>
> I might be thicker than a whale sandwich (10 points if you can pick the
> quote :) ), but can someone please tell me what a shift/reduce issue is,
> exactly...
>
A Yacc parser does two things in order to parse input:
1) Reduce: attempt to reduce the stack by simplifying it to a rule
2) Shift: obtain the next token from input so that a reduction may be able
to take.
Shift/reduce conflicts are pretty ugly. Basically, what happens is that
the parser finds itself in a state where it is valid to reduce OR shift at
some point in the grammar. What I believe Thomas was refering to was this
condition:
Take a rule:
rule a: CREATE DATABASE <name> WITH LOCATION = <name>
rule b: CREATE DATABASE <name> WITH LOCATION = <name> WITH OWNER = <name>
now if the input is:
CREATE DATABASE test WITH LOCATION = '/var/test' WITH OWNER = swm
^
Then the parser can reach the point under-marked by the circumflex and
find it valid to reduce the stack (CREATE DATABASE test WITH LOCATION =
'/var/test') to rule a OR shift and put the WITH (after the circumflex) on
the stack given that this should match rule b.
Naturally, if this conflict is ignored for the grammar above, you could
end up with wild results in your parsed node tree. Realistically, Bison
and other yacc compilers will generate parsers unaffected for this
situation because they always opt to shift when there is a shift/reduce
conflict -- a pretty safe bet. But if it should have been valid to reduce
the input to a once it reached the circumflex, you'd be in trouble.
Gavin
From: | Thomas Lockhart <lockhart(at)fourpalms(dot)org> |
---|---|
To: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> |
Cc: | Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-01-08 15:15:22 |
Message-ID: | 3C3B0D0A.50FE1C43@fourpalms.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
> > > Does this have the multiple "WITH xxx" clauses which were discussed
> > > earlier? That is a nonstarter for syntax. There are other places in the
> > > grammar having "with clauses" and multiple arguments or subclauses, and
> > > having the shift/reduce issues resolved...
...
> CREATE DATABASE <name> WITH LOCATION = <name> WITH OWNER = <name>
It was this syntax I was wondering about. Multiple "WITH"s should not be
necessary. Are they actually required in the patch?
- Thomas
From: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> |
---|---|
To: | Thomas Lockhart <lockhart(at)fourpalms(dot)org> |
Cc: | Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-01-09 01:52:27 |
Message-ID: | Pine.LNX.4.21.0201091249550.11788-100000@linuxworld.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
On Tue, 8 Jan 2002, Thomas Lockhart wrote:
> > > > Does this have the multiple "WITH xxx" clauses which were discussed
> > > > earlier? That is a nonstarter for syntax. There are other places in the
> > > > grammar having "with clauses" and multiple arguments or subclauses, and
> > > > having the shift/reduce issues resolved...
> ...
> > CREATE DATABASE <name> WITH LOCATION = <name> WITH OWNER = <name>
>
> It was this syntax I was wondering about. Multiple "WITH"s should not be
> necessary. Are they actually required in the patch?
Argh. My bad. The syntax is what you had in mind:
CREATE DATABASE <name> [WITH [LOCATION <name>] [OWNER <name>] ...]
Gavin
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Kaare Rasmussen <kar(at)kakidata(dot)dk> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Updated TODO item |
Date: | 2002-02-23 02:00:38 |
Message-ID: | 200202230200.g1N20c629287@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Kaare Rasmussen wrote:
> > * Make it easier to create a database owned by someone who can't createdb,
> > perhaps CREATE DATABASE dbname WITH USER = "user"
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Shouldn't that be
>
> CREATE DATABASE dbname WITH OWNER = "user"
Yes. I will make that change.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> |
Cc: | Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-02-24 20:23:54 |
Message-ID: | 11758.1014582234@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> On Fri, 4 Jan 2002, Kaare Rasmussen wrote:
>> CREATE DATABASE dbname WITH OWNER = "user"
> A much better idea. There is no conflict in using OWNER here.
> Revised patch attached.
I have applied this patch, with a couple of editorial tweaks, and one
not-so-minor change: superuser privilege is required to create a
database on behalf of another user. Seems to me that CREATEDB
privilege should not be sufficient to allow such an operation.
Still to do: teach createdb script about it, and revise pg_dumpall
to use the facility instead of assuming that database owners have
CREATEDB privilege. Working on those now ...
regards, tom lane
From: | Fernando Nasser <fnasser(at)redhat(dot)com> |
---|---|
To: | lockhart(at)fourpalms(dot)org |
Cc: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-02-25 01:11:43 |
Message-ID: | 3C798F4F.58F15C90@redhat.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Thomas Lockhart wrote:
>
> > > > * Make it easier to create a database owned by someone who can't createdb,
> > > > perhaps CREATE DATABASE dbname WITH USER = "user"
> > > CREATE DATABASE dbname WITH OWNER = "user"
> > A much better idea. There is no conflict in using OWNER here.
>
> Does this have the multiple "WITH xxx" clauses which were discussed
> earlier? That is a nonstarter for syntax. There are other places in the
> grammar having "with clauses" and multiple arguments or subclauses, and
> having the shift/reduce issues resolved...
>
The syntax of the CREATE SCHEMA SQL standard command is
CREATE SCHEMA AUTHORIZATION userid
Shouldn't we be using
CREATE DATABASE AUTHORIZATION userid
to be consistent?
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Fernando Nasser <fnasser(at)redhat(dot)com> |
Cc: | lockhart(at)fourpalms(dot)org, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-02-25 01:24:49 |
Message-ID: | 13902.1014600289@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Fernando Nasser <fnasser(at)redhat(dot)com> writes:
> The syntax of the CREATE SCHEMA SQL standard command is
> CREATE SCHEMA AUTHORIZATION userid
> Shouldn't we be using
> CREATE DATABASE AUTHORIZATION userid
> to be consistent?
Seems like a very weak analogy; there's no other similarities between
the two command syntaxes, so why argue that this should be the same?
Also, the semantics aren't the same --- for example, there's no a-priori
assumption that a database owner owns everything within the database.
regards, tom lane
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-02-25 02:00:11 |
Message-ID: | 200202250200.g1P20B712625@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Tom Lane wrote:
> Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > On Fri, 4 Jan 2002, Kaare Rasmussen wrote:
> >> CREATE DATABASE dbname WITH OWNER = "user"
>
> > A much better idea. There is no conflict in using OWNER here.
> > Revised patch attached.
>
> I have applied this patch, with a couple of editorial tweaks, and one
> not-so-minor change: superuser privilege is required to create a
> database on behalf of another user. Seems to me that CREATEDB
> privilege should not be sufficient to allow such an operation.
>
> Still to do: teach createdb script about it, and revise pg_dumpall
> to use the facility instead of assuming that database owners have
> CREATEDB privilege. Working on those now ...
Seems you are already on that too. I will wait for you to finish, when
there will be nothing left for me to do. :-(
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-02-25 02:52:04 |
Message-ID: | 200202250252.g1P2q4919000@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Bruce Momjian wrote:
> Tom Lane wrote:
> > Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > > On Fri, 4 Jan 2002, Kaare Rasmussen wrote:
> > >> CREATE DATABASE dbname WITH OWNER = "user"
> >
> > > A much better idea. There is no conflict in using OWNER here.
> > > Revised patch attached.
> >
> > I have applied this patch, with a couple of editorial tweaks, and one
> > not-so-minor change: superuser privilege is required to create a
> > database on behalf of another user. Seems to me that CREATEDB
> > privilege should not be sufficient to allow such an operation.
> >
> > Still to do: teach createdb script about it, and revise pg_dumpall
> > to use the facility instead of assuming that database owners have
> > CREATEDB privilege. Working on those now ...
>
> Seems you are already on that too. I will wait for you to finish, when
> there will be nothing left for me to do. :-(
I have applied this minor patch. I don't want to document the ability
to use equals in this case because some day we may remove it. The
equals doesn't fit with any of our other WITH clauses. I cleaned up a
paragraph on OWNER, and mentioned we may want to remove the equals
backward compatibility hack someday.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
Attachment | Content-Type | Size |
---|---|---|
unknown_filename | text/plain | 2.9 KB |
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-02-25 02:58:52 |
Message-ID: | 14596.1014605932@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> I have applied this minor patch. I don't want to document the ability
> to use equals in this case because some day we may remove it. The
> equals doesn't fit with any of our other WITH clauses.
One could argue at least as plausibly that we should allow optional '='
in all the other WITH clauses. (That thought was why I renamed the
nonterminal to not refer to createdb.)
I'm also quite unimpressed with the notion of trying to suppress
knowledge of a syntax that is in active use by pg_dump, and perhaps
other tools too.
regards, tom lane
From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
To: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Kaare Rasmussen <kar(at)kakidata(dot)dk>, <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-02-25 03:06:20 |
Message-ID: | Pine.LNX.4.30.0202242202311.686-100000@peter.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Bruce Momjian writes:
> I have applied this minor patch. I don't want to document the ability
> to use equals in this case because some day we may remove it.
Document what the code does, not what you think it may do in the future.
Users that are used to the current syntax may get surprised when they see
the equal signs gone.
> The equals doesn't fit with any of our other WITH clauses.
And the WITH keyword doesn't fit any other SQL command. So when we make
up new commands in the future, please drop it.
--
Peter Eisentraut peter_e(at)gmx(dot)net
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-02-25 03:34:52 |
Message-ID: | 200202250334.g1P3Yqw22898@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I have applied this minor patch. I don't want to document the ability
> > to use equals in this case because some day we may remove it. The
> > equals doesn't fit with any of our other WITH clauses.
>
> One could argue at least as plausibly that we should allow optional '='
> in all the other WITH clauses. (That thought was why I renamed the
> nonterminal to not refer to createdb.)
Well we have on TODO:
* Make equals sign optional in CREATE DATABASE WITH param = 'val'
> I'm also quite unimpressed with the notion of trying to suppress
> knowledge of a syntax that is in active use by pg_dump, and perhaps
> other tools too.
Well, my assumption is that we don't want to document it because we want
to discourage its use, unless we want to add equals to all the WITH
clauses, which I didn't think we wanted to do.
There are other cases of syntax we don't document because it makes
little sense, and I thought this was one of them.
You have a good point with pg_dump. Can I remove the use of the equals
in there? Seems safe to me. However, it does prevent us from loading
newer pgdumps into older database, which seems like a pain.
Wow, this is tricky. I guess it is not worth fixing this to make it
consistent. I will put back the [=] and remove the comment unless
someone else has a better idea.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From: | Neil Conway <nconway(at)klamath(dot)dyndns(dot)org> |
---|---|
To: | pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-02-25 05:10:03 |
Message-ID: | 1014613803.7682.118.camel@jiro |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
On Sun, 2002-02-24 at 22:34, Bruce Momjian wrote:
> You have a good point with pg_dump. Can I remove the use of the equals
> in there? Seems safe to me. However, it does prevent us from loading
> newer pgdumps into older database, which seems like a pain.
AFAIK, no effort is made to ensure that dump files produced by a current
version of pg_dump will restore properly into older databases. From what
I can tell, the odds of this happening successfully are slim to none...
Cheers,
Neil
--
Neil Conway <neilconway(at)rogers(dot)com>
PGP Key ID: DB3C29FC
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Neil Conway <nconway(at)klamath(dot)dyndns(dot)org> |
Cc: | pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-02-25 05:38:29 |
Message-ID: | 15849.1014615509@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Neil Conway <nconway(at)klamath(dot)dyndns(dot)org> writes:
> AFAIK, no effort is made to ensure that dump files produced by a current
> version of pg_dump will restore properly into older databases.
No, but gratuitous breakage should be avoided --- especially when it's
in pursuit of a goal that no one except Bruce subscribes to in the
first place ...
regards, tom lane
From: | Fernando Nasser <fnasser(at)redhat(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | lockhart(at)fourpalms(dot)org, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-patches(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Updated TODO item |
Date: | 2002-02-25 14:46:05 |
Message-ID: | 3C7A4E2D.6160062F@redhat.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Tom Lane wrote:
>
> Fernando Nasser <fnasser(at)redhat(dot)com> writes:
> > The syntax of the CREATE SCHEMA SQL standard command is
> > CREATE SCHEMA AUTHORIZATION userid
> > Shouldn't we be using
> > CREATE DATABASE AUTHORIZATION userid
> > to be consistent?
>
> Seems like a very weak analogy; there's no other similarities between
> the two command syntaxes, so why argue that this should be the same?
The analogy is not with the command -- it is with with the token
'userid'.
The key word prefix tells what that token is supposed to be, and that
is an <authorization-id>. THe key word AUTHORIZATION works like a sort
of an 'adjective'.
> Also, the semantics aren't the same --- for example, there's no a-priori
> assumption that a database owner owns everything within the database.
>
I thought you were arguing that neither would a schema (i.e., you wanted
objects in a schema to have different owners).
Anyway, that is not the point here. We have two commands that
create groups of database objects (our "database" is the SQL catalog)
and both specify who will own it. The CREATE DATABASE is implementation
defined and we can do whatever we want with it, but as we have a
standard
command that uses a syntax to specify the owner I think we should follow
it.
With the additional advantage that the '=' problem goes away and we
avoid
future shift/reduce problems in the parser as 'WITH' is already too
overloaded.
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9