Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-12-02 Thread Merlin Moncure
On Wed, Dec 2, 2009 at 11:28 AM, Bruce Momjian wrote: >> > >> > set next_pg_class_oid = 12345; >> > set next_pg_type_oid = 12346; >> > set next_toast_table_oid = ... >> > set next_toast_index_oid = ... >> > >> > and finally it could do CREATE TABLE. ?CREATE TYPE would only need >> > next_pg_type_o

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-12-02 Thread Bruce Momjian
Merlin Moncure wrote: > On Thu, Aug 6, 2009 at 9:28 AM, Tom Lane wrote: > > The half-formed idea I had was a set of GUC variables: > > > > set next_pg_class_oid = 12345; > > set next_pg_type_oid = 12346; > > set next_toast_table_oid = ... > > set next_toast_index_oid = ... > > > > and finally it c

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-12-02 Thread Tom Lane
Merlin Moncure writes: > Is this idea still on the table for 8.5? I've forgotten what the problem was? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-12-02 Thread Merlin Moncure
On Thu, Aug 6, 2009 at 9:28 AM, Tom Lane wrote: > The half-formed idea I had was a set of GUC variables: > > set next_pg_class_oid = 12345; > set next_pg_type_oid = 12346; > set next_toast_table_oid = ... > set next_toast_index_oid = ... > > and finally it could do CREATE TABLE.  CREATE TYPE would

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-07 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian writes: > > Peter Eisentraut wrote: > >> That might be a bit excessive. As I understand it, arrays of built-in > >> types > >> (e.g., int[]) should work fine. I suspect the majority of uses of arrays > >> will > >> be with built-in types, so allowing that would

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-07 Thread Tom Lane
Bruce Momjian writes: > Peter Eisentraut wrote: >> That might be a bit excessive. As I understand it, arrays of built-in types >> (e.g., int[]) should work fine. I suspect the majority of uses of arrays >> will >> be with built-in types, so allowing that would help a significant portion of >> i

[HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-07 Thread Bruce Momjian
Greg Stark wrote: > On Fri, Aug 7, 2009 at 1:56 AM, Bruce Momjian wrote: > > ? ? ? ? ? ? ? ?o ?data type 'name' and is not the first column > > > > What was that about? We changed the alignment of the 'name' column: /* * v8_3_check_for_name_data_type_usage() *

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-07 Thread Zdenek Kotala
Dne 6.08.09 04:29, Tom Lane napsal(a): Andrew Dunstan writes: preventing a clash might be fairly difficult. Yeah, I was just thinking about that. The easiest way to avoid collisions would be to make pg_dump (in --binary-upgrade mode) responsible for being sure that *every* new pg_type and p

[HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-07 Thread Greg Stark
On Fri, Aug 7, 2009 at 1:56 AM, Bruce Momjian wrote: >                o  data type 'name' and is not the first column > What was that about? -- greg http://mit.edu/~gsstark/resume.pdf -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: ht

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread David E. Wheeler
On Aug 6, 2009, at 6:00 PM, Bruce Momjian wrote: Yes, I have regression tests I run but they are not in CVS, partly because they are tied to other scripts I have to manage server settings. Here are my scripts: http://momjian.us/tmp/pg_migrator_test.tgz One big problem is that pg_mi

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Bruce Momjian
Joshua D. Drake wrote: > On Wed, 2009-08-05 at 22:57 -0400, Bruce Momjian wrote: > > Andrew Dunstan wrote: > > > > > Well, pg_migrator has gotten pretty far without supporting these > > features, and I think I would have heard about it if someone had these > > and migrated because vacuum analyze f

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Bruce Momjian
David E. Wheeler wrote: > On Aug 6, 2009, at 7:28 AM, Tom Lane wrote: > > > That would cover the problem for OIDs needed during CREATE TABLE, but > > what about types and enum values? > > I haven't been following this discussion very closely, but wanted to > ask: is someone writing regression t

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Bruce Momjian
Peter Eisentraut wrote: > On Thursday 06 August 2009 06:32:06 Bruce Momjian wrote: > > I have applied the attached patch to pg_migrator to detect enum, > > composites, and arrays. I tested it and the only error I got was with > > the breakmigrator table that was supplied by Jeff, and once I remove

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Joshua D. Drake
On Wed, 2009-08-05 at 22:57 -0400, Bruce Momjian wrote: > Andrew Dunstan wrote: > > > Well, pg_migrator has gotten pretty far without supporting these > features, and I think I would have heard about it if someone had these > and migrated because vacuum analyze found it right away. I am afraid >

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Peter Eisentraut
On Thursday 06 August 2009 17:54:37 David E. Wheeler wrote: > On Aug 6, 2009, at 7:28 AM, Tom Lane wrote: > > That would cover the problem for OIDs needed during CREATE TABLE, but > > what about types and enum values? > > I haven't been following this discussion very closely, but wanted to > ask: i

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread David E. Wheeler
On Aug 6, 2009, at 7:28 AM, Tom Lane wrote: That would cover the problem for OIDs needed during CREATE TABLE, but what about types and enum values? I haven't been following this discussion very closely, but wanted to ask: is someone writing regression tests for these cases that pg_migrator

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Merlin Moncure
On Thu, Aug 6, 2009 at 4:32 AM, Dimitri Fontaine wrote: > Tom Lane writes: > >> Andrew Dunstan writes: >>> preventing a clash might be fairly difficult. >> >> Yeah, I was just thinking about that.  The easiest way to avoid >> collisions would be to make pg_dump (in --binary-upgrade mode) >> respo

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Tom Lane
Andrew Dunstan writes: > It's going to be fairly grotty whatever we do. I'm worried a bit that > we'll be providing some footguns, but I guess we'll just need to hold > our noses and do whatever it takes. Yeah. One advantage of the GUC approach is we could make 'em SUSET. I don't actually see

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Andrew Dunstan
Tom Lane wrote: Alvaro Herrera writes: Dimitri Fontaine wrote: It seems harder to come up with a general purpose syntax to support the feature in case of toast tables, though. There's already general purpose syntax for relation options which can be used to get options th

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Tom Lane
Alvaro Herrera writes: > Dimitri Fontaine wrote: >> It seems harder to come up with a general purpose syntax to support the >> feature in case of toast tables, though. > There's already general purpose syntax for relation options which can be > used to get options that do not ultimately end up in

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Alvaro Herrera
Dimitri Fontaine wrote: > Tom Lane writes: > > We could stop doing that > > once we have all the user tables in place --- I don't believe it's > > necessary to preserve the OIDs of user indexes. But we need to > > preserve toast table OIDs, and toast table index OIDs too if those > > are created

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Peter Eisentraut
On Thursday 06 August 2009 06:32:06 Bruce Momjian wrote: > I have applied the attached patch to pg_migrator to detect enum, > composites, and arrays. I tested it and the only error I got was with > the breakmigrator table that was supplied by Jeff, and once I removed > that table the migration wen

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Boszormenyi Zoltan
Tom Lane írta: > At the moment it looks to me like pg_migrator has crashed and burned > for 8.4, at least for general-purpose usage. It means that you don't have the restraint that you thought you have. So you can change the RedHat/Fedora PostgreSQL 8.4 packages to use the upstream default for int

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-06 Thread Dimitri Fontaine
Tom Lane writes: > Andrew Dunstan writes: >> preventing a clash might be fairly difficult. > > Yeah, I was just thinking about that. The easiest way to avoid > collisions would be to make pg_dump (in --binary-upgrade mode) > responsible for being sure that *every* new pg_type and pg_class row >

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Bruce Momjian
Bruce Momjian wrote: > Andrew Dunstan wrote: > > > > > > Bruce Momjian wrote: > > > Do we have no composite types in the regression tests, or do we not > > > store any in the database? Same the enums. > > > > > > > > > > Looks like the enum regression tests at least drop all their tables :-(

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Bruce Momjian
Andrew Dunstan wrote: > > > Tom Lane wrote: > > Andrew Dunstan writes: > > > >> preventing a clash might be fairly difficult. > >> > > > > Yeah, I was just thinking about that. The easiest way to avoid > > collisions would be to make pg_dump (in --binary-upgrade mode) > > responsible fo

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Tom Lane
Andrew Dunstan writes: > Is there any danger that an oid used in, say, pg_enum in the old version > will be used in the catalog bootstrap in the new version? No. All initdb-assigned OIDs are less than 16K, and we never assign such an OID post-initdb (not even when wrapping around). We might ge

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Bruce Momjian
Andrew Dunstan wrote: > > > Bruce Momjian wrote: > > Do we have no composite types in the regression tests, or do we not > > store any in the database? Same the enums. > > > > > > Looks like the enum regression tests at least drop all their tables :-( > > > To allow pg_migrator to work, I w

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan writes: preventing a clash might be fairly difficult. Yeah, I was just thinking about that. The easiest way to avoid collisions would be to make pg_dump (in --binary-upgrade mode) responsible for being sure that *every* new pg_type and pg_class row OI

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Tom Lane
Andrew Dunstan writes: > preventing a clash might be fairly difficult. Yeah, I was just thinking about that. The easiest way to avoid collisions would be to make pg_dump (in --binary-upgrade mode) responsible for being sure that *every* new pg_type and pg_class row OID matches what it was in the

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Andrew Dunstan
Bruce Momjian wrote: Do we have no composite types in the regression tests, or do we not store any in the database? Same the enums. Looks like the enum regression tests at least drop all their tables :-( To allow pg_migrator to work, I would need to reserve the oids in pg_type, import

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Tom Lane
Bruce Momjian writes: > To allow pg_migrator to work, I would need to reserve the oids in > pg_type, import the dump, and renumber the pg_type entries (and > everything pointing to them) to the proper pg_type.oid. The big problem > there is that I don't have access at the SQL level to set or chan

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Bruce Momjian
Tom Lane wrote: > Alvaro Herrera writes: > > Tom Lane wrote: > >> Hm ... has anyone tested pg_migrator using either composite types or > >> arrays of user-defined types? Both of them have got user-defined-type > >> OIDs in on-disk data, now that I think about it. For that matter, enums > >> are

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian writes: > > I received the following pg_migrator bug report today and was able to > > reproduce the reported failure when using composite types: > > > test=> SELECT * FROM breakmigrator; > > ERROR: cache lookup failed for type 27604 > > Hm ... has anyone

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> Hm ... has anyone tested pg_migrator using either composite types or >> arrays of user-defined types? Both of them have got user-defined-type >> OIDs in on-disk data, now that I think about it. For that matter, enums >> are going to be a problem too.

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Alvaro Herrera
Tom Lane wrote: > Bruce Momjian writes: > > I received the following pg_migrator bug report today and was able to > > reproduce the reported failure when using composite types: > > > test=> SELECT * FROM breakmigrator; > > ERROR: cache lookup failed for type 27604 > > Hm ... has anyone

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Tom Lane
Bruce Momjian writes: > I received the following pg_migrator bug report today and was able to > reproduce the reported failure when using composite types: > test=> SELECT * FROM breakmigrator; > ERROR: cache lookup failed for type 27604 Hm ... has anyone tested pg_migrator using eit

Re: [HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Bruce Momjian
Bruce Momjian wrote: > > I received the following pg_migrator bug report today and was able to > reproduce the reported failure when using composite types: > > test=> SELECT * FROM breakmigrator; > ERROR: cache lookup failed for type 27604 > > test=> ANALYZE VERBOSE public.bre

[HACKERS] Re: [Pg-migrator-general] Composite types break pg_migrated tables

2009-08-05 Thread Bruce Momjian
I received the following pg_migrator bug report today and was able to reproduce the reported failure when using composite types: test=> SELECT * FROM breakmigrator; ERROR: cache lookup failed for type 27604 test=> ANALYZE VERBOSE public.breakmigrator; INFO: anal