Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-07 Thread Guillaume Lelarge
Tom Lane a écrit : > Guillaume Lelarge <[EMAIL PROTECTED]> writes: >> v5 patch attached. > > Applied with corrections, mostly ensuring crash-safety and arranging > to clean up if the initial copy phase fails (think out-of-disk-space). > Thanks for your tips and corrections. I'll go read the diff

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-07 Thread Tom Lane
Guillaume Lelarge <[EMAIL PROTECTED]> writes: > v5 patch attached. Applied with corrections, mostly ensuring crash-safety and arranging to clean up if the initial copy phase fails (think out-of-disk-space). regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-07 Thread Bernd Helmle
--On Freitag, November 07, 2008 09:36:32 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: Bernd, did you have any further comments? If not I'll get started on this patch. No, i think this patch is ready for a committer then. -- Thanks Bernd -- Sent via pgsql-hackers mailing l

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-07 Thread Tom Lane
Guillaume Lelarge <[EMAIL PROTECTED]> writes: > Bernd Helmle a écrit : >> Maybe this is nit-picking, but i see that you have to rmdir() an >> existing empty tablespace directory to use copydir() afterwards. Maybe >> we can teach copydir() to error out when trying to mkdir() an existing >> directory

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-07 Thread Guillaume Lelarge
Bernd Helmle a écrit : > --On Donnerstag, November 06, 2008 11:35:54 +0100 Guillaume Lelarge > <[EMAIL PROTECTED]> wrote: > >> Guillaume Lelarge a écrit : >>> v4 patch attached. >>> >> >> v5 patch attached. >> > > Thanks Guillaume. > > Maybe this is nit-picking, but i see that you have to rmdir(

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-06 Thread Bernd Helmle
--On Donnerstag, November 06, 2008 11:35:54 +0100 Guillaume Lelarge <[EMAIL PROTECTED]> wrote: Guillaume Lelarge a écrit : v4 patch attached. v5 patch attached. Thanks Guillaume. Maybe this is nit-picking, but i see that you have to rmdir() an existing empty tablespace directory to use

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-06 Thread Guillaume Lelarge
Guillaume Lelarge a écrit : > v4 patch attached. > v5 patch attached. Fixes two issues : * I forgot about Bernd's advice : "And i think we can avoid to call database_file_update_needed() in this case then." This is fixed. * I forgot to remove a debug ereport. Sorry about this. -- Guil

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-06 Thread Guillaume Lelarge
Tom Lane a écrit : > Bernd Helmle <[EMAIL PROTECTED]> writes: >> * We really should error out when trying to copy into the same tablespace >> the database already lives in. > > No, I think that should just be a no-op. We don't for instance throw > error when you ALTER OWNER to the existing owner

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-05 Thread Bernd Helmle
--On Mittwoch, November 05, 2008 19:20:07 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: No, I think that should just be a no-op. We don't for instance throw error when you ALTER OWNER to the existing owner. Hmm okay. When looking at this i was remembering the discussion we had for SET SCHEMA a

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-05 Thread Tom Lane
Bernd Helmle <[EMAIL PROTECTED]> writes: > * We really should error out when trying to copy into the same tablespace > the database already lives in. No, I think that should just be a no-op. We don't for instance throw error when you ALTER OWNER to the existing owner. > * The current implementa

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-05 Thread Bernd Helmle
--On Mittwoch, November 05, 2008 01:10:22 +0100 Guillaume Lelarge <[EMAIL PROTECTED]> wrote: Tom Lane a écrit : Guillaume Lelarge <[EMAIL PROTECTED]> writes: Should I provide a complete new patch with Bernd's and Tom's changes? Please --- it's better if you integrate it since you know the p

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-04 Thread Guillaume Lelarge
Tom Lane a écrit : > Guillaume Lelarge <[EMAIL PROTECTED]> writes: >> Should I provide a complete new patch with Bernd's and Tom's changes? > > Please --- it's better if you integrate it since you know the patch > already. > I worked with Bernd's patch and replace the WITH syntax with the SET on

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-04 Thread Tom Lane
Guillaume Lelarge <[EMAIL PROTECTED]> writes: > Should I provide a complete new patch with Bernd's and Tom's changes? Please --- it's better if you integrate it since you know the patch already. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@post

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-04 Thread Guillaume Lelarge
Bernd Helmle a écrit : > --On Dienstag, November 04, 2008 14:56:44 -0500 Tom Lane > <[EMAIL PROTECTED]> wrote: > > [...] > >> >> Not sure what Bernd tried exactly, but it can be done. >> > > Cool, i didn't recognize the obvious possibility to add a separate rule > for this. I've just extended th

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-04 Thread Bernd Helmle
--On Dienstag, November 04, 2008 14:56:44 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: [...] Not sure what Bernd tried exactly, but it can be done. Cool, i didn't recognize the obvious possibility to add a separate rule for this. I've just extended the alterdb_opt_item with SET TABLESPACE, w

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-04 Thread Tom Lane
Guillaume Lelarge <[EMAIL PROTECTED]> writes: > Bernd Helmle a écrit : >> However, i'm not satisfied with the syntax, which is currently ALTER >> DATABASE name TABLESPACE foo. We use all over the place SET TABLESPACE >> (e.g. for tables and indexes) and SET SCHEMA for namespaces even, so >> this lo

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-04 Thread Guillaume Lelarge
Bernd Helmle a écrit : > --On Samstag, Oktober 25, 2008 23:50:47 +0200 Guillaume Lelarge > <[EMAIL PROTECTED]> wrote: > >> Here is my patch to add the ALTER DATABASE WITH TABLESPACE statement. It >> is part of the TODO list. It intends to allow the move of all relations >> of a database in its new

Re: [HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-11-04 Thread Bernd Helmle
--On Samstag, Oktober 25, 2008 23:50:47 +0200 Guillaume Lelarge <[EMAIL PROTECTED]> wrote: Hi, Here is my patch to add the ALTER DATABASE WITH TABLESPACE statement. It is part of the TODO list. It intends to allow the move of all relations of a database in its new default tablespace. Comments

[HACKERS] Patch for ALTER DATABASE WITH TABLESPACE

2008-10-25 Thread Guillaume Lelarge
Hi, Here is my patch to add the ALTER DATABASE WITH TABLESPACE statement. It is part of the TODO list. It intends to allow the move of all relations of a database in its new default tablespace. Comments welcome. Regards. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com AlterDat