pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6618: incorrect restore for composite columns when order changes
3+ messages / 3 participants
[nested] [flat]

* BUG #6618: incorrect restore for composite columns when order changes
@ 2012-04-26 22:20 rikard.pavelic@zg.htnet.hr
  2012-04-26 22:39 ` Re: BUG #6618: incorrect restore for composite columns when order changes Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: rikard.pavelic@zg.htnet.hr @ 2012-04-26 22:20 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      6618
Logged by:          Rikard Pavelic
Email address:      rikard.pavelic@zg.htnet.hr
PostgreSQL version: 9.1.3
Operating system:   Windows 7
Description:        

We've run into another issue with composite types.
I've search internets but didn't find any reference to this, so I guess it's
not a documented problem.

Steps to reproduce problem:
1) create composite type
2) use composite type as column in a table
3) clone database
4) change order of attributes in cloned database
5) dump to plain sql with column names
6) restore sql dump to cloned database

Problem:
Composite type will be restored in order from original instead of cloned
database.

While I don't see a nice solution to this problem, it's not a too big issue
for us.
Just trying to document some more gotchas with composite types ;(




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #6618: incorrect restore for composite columns when order changes
  2012-04-26 22:20 BUG #6618: incorrect restore for composite columns when order changes rikard.pavelic@zg.htnet.hr
@ 2012-04-26 22:39 ` Tom Lane <tgl@sss.pgh.pa.us>
  2012-04-27 06:57   ` Re: BUG #6618: incorrect restore for composite columns when order changes Rikard Pavelic <rikard.pavelic@zg.htnet.hr>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2012-04-26 22:39 UTC (permalink / raw)
  To: rikard.pavelic@zg.htnet.hr; +Cc: pgsql-bugs

rikard.pavelic@zg.htnet.hr writes:
> Steps to reproduce problem:
> 1) create composite type
> 2) use composite type as column in a table
> 3) clone database
> 4) change order of attributes in cloned database
> 5) dump to plain sql with column names
> 6) restore sql dump to cloned database

There is no supported method for changing the order of attributes in a
composite type, so I wonder exactly how you did step 4.  If it involved
direct manipulation of the system catalogs, I would say this falls in
the category of "if you break it, you get to keep both pieces".

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #6618: incorrect restore for composite columns when order changes
  2012-04-26 22:20 BUG #6618: incorrect restore for composite columns when order changes rikard.pavelic@zg.htnet.hr
  2012-04-26 22:39 ` Re: BUG #6618: incorrect restore for composite columns when order changes Tom Lane <tgl@sss.pgh.pa.us>
@ 2012-04-27 06:57   ` Rikard Pavelic <rikard.pavelic@zg.htnet.hr>
  0 siblings, 0 replies; 3+ messages in thread

From: Rikard Pavelic @ 2012-04-27 06:57 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs

On 27.4.2012. 0:39, Tom Lane wrote:
>
> There is no supported method for changing the order of attributes in a
> composite type, so I wonder exactly how you did step 4.  If it involved
> direct manipulation of the system catalogs, I would say this falls in
> the category of "if you break it, you get to keep both pieces".
>
> 			regards, tom lane
>

Well, there is no supported method for changing order of columns too, but
doesn't stop you from creating new and dropping old until you have
order which you want.

To be exact I didn't clone the database, I let our tool build it.
It built types with different order because our schema changed in the meantime.

Regards,
Rikard



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2012-04-27 06:57 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-04-26 22:20 BUG #6618: incorrect restore for composite columns when order changes rikard.pavelic@zg.htnet.hr
2012-04-26 22:39 ` Tom Lane <tgl@sss.pgh.pa.us>
2012-04-27 06:57   ` Rikard Pavelic <rikard.pavelic@zg.htnet.hr>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox