Re: [GENERAL] CREATE TABLE LIKE and SERIAL

View: New views
5 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: [GENERAL] CREATE TABLE LIKE and SERIAL

by Guillaume Lelarge-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le vendredi 30 octobre 2009 à 23:48:45, Tom Lane a écrit :
> Thom Brown <thombrown@...> writes:
> > How is pgAdmin determining the serial type in this case?
>
> Most likely it's looking for the pg_depend entry that shows the sequence
> as being "owned by" the column.  However, that's an oversimplification
> of reality.  I would imagine that pgAdmin will lie to you in exactly
> the same cases that used to break pg_dump (notably, where someone has
> manually adjusted either the default expression or the sequence...)
>

I've just read this. I wasn't aware of this. Should we suppress this behavior
of pgAdmin?


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Re: [GENERAL] CREATE TABLE LIKE and SERIAL

by Dave Page-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 30, 2009 at 11:12 PM, Guillaume Lelarge
<guillaume@...> wrote:

> Le vendredi 30 octobre 2009 à 23:48:45, Tom Lane a écrit :
>> Thom Brown <thombrown@...> writes:
>> > How is pgAdmin determining the serial type in this case?
>>
>> Most likely it's looking for the pg_depend entry that shows the sequence
>> as being "owned by" the column.  However, that's an oversimplification
>> of reality.  I would imagine that pgAdmin will lie to you in exactly
>> the same cases that used to break pg_dump (notably, where someone has
>> manually adjusted either the default expression or the sequence...)
>>
>
> I've just read this. I wasn't aware of this. Should we suppress this behavior
> of pgAdmin?

Do you have a proposed fix? I suspect people won't want us to stop
showing columns as 'SERIAL' when they actually were created that way.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
PGDay.EU 2009 Conference: http://2009.pgday.eu/start

--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Re: [GENERAL] CREATE TABLE LIKE and SERIAL

by Guillaume Lelarge-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le dimanche 1 novembre 2009 à 13:24:10, Dave Page a écrit :

> On Fri, Oct 30, 2009 at 11:12 PM, Guillaume Lelarge
>
> <guillaume@...> wrote:
> > Le vendredi 30 octobre 2009 à 23:48:45, Tom Lane a écrit :
> >> Thom Brown <thombrown@...> writes:
> >> > How is pgAdmin determining the serial type in this case?
> >>
> >> Most likely it's looking for the pg_depend entry that shows the sequence
> >> as being "owned by" the column.  However, that's an oversimplification
> >> of reality.  I would imagine that pgAdmin will lie to you in exactly
> >> the same cases that used to break pg_dump (notably, where someone has
> >> manually adjusted either the default expression or the sequence...)
> >
> > I've just read this. I wasn't aware of this. Should we suppress this
> > behavior of pgAdmin?
>
> Do you have a proposed fix? I suspect people won't want us to stop
> showing columns as 'SERIAL' when they actually were created that way.
>

Other ideas than doing what pg_dump does? I'm afraid not.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Re: [GENERAL] CREATE TABLE LIKE and SERIAL

by Dave Page-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Nov 12, 2009 at 8:00 AM, Guillaume Lelarge
<guillaume@...> wrote:

> Le dimanche 1 novembre 2009 à 13:24:10, Dave Page a écrit :
>> On Fri, Oct 30, 2009 at 11:12 PM, Guillaume Lelarge
>>
>> <guillaume@...> wrote:
>> > Le vendredi 30 octobre 2009 à 23:48:45, Tom Lane a écrit :
>> >> Thom Brown <thombrown@...> writes:
>> >> > How is pgAdmin determining the serial type in this case?
>> >>
>> >> Most likely it's looking for the pg_depend entry that shows the sequence
>> >> as being "owned by" the column.  However, that's an oversimplification
>> >> of reality.  I would imagine that pgAdmin will lie to you in exactly
>> >> the same cases that used to break pg_dump (notably, where someone has
>> >> manually adjusted either the default expression or the sequence...)
>> >
>> > I've just read this. I wasn't aware of this. Should we suppress this
>> > behavior of pgAdmin?
>>
>> Do you have a proposed fix? I suspect people won't want us to stop
>> showing columns as 'SERIAL' when they actually were created that way.
>>
>
> Other ideas than doing what pg_dump does? I'm afraid not.

pg_dump isn't designed to make the output look pretty, which is the
major issue here. We're trying to do both.

It seems to me that correctness trumps aesthetics, so we probably will
have to do what pg_dump does. Care to work up a patch?

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Re: [GENERAL] CREATE TABLE LIKE and SERIAL

by Guillaume Lelarge-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le jeudi 12 novembre 2009 à 10:12:00, Dave Page a écrit :

> On Thu, Nov 12, 2009 at 8:00 AM, Guillaume Lelarge
>
> <guillaume@...> wrote:
> > Le dimanche 1 novembre 2009 à 13:24:10, Dave Page a écrit :
> >> On Fri, Oct 30, 2009 at 11:12 PM, Guillaume Lelarge
> >>
> >> <guillaume@...> wrote:
> >> > Le vendredi 30 octobre 2009 à 23:48:45, Tom Lane a écrit :
> >> >> Thom Brown <thombrown@...> writes:
> >> >> > How is pgAdmin determining the serial type in this case?
> >> >>
> >> >> Most likely it's looking for the pg_depend entry that shows the
> >> >> sequence as being "owned by" the column.  However, that's an
> >> >> oversimplification of reality.  I would imagine that pgAdmin will lie
> >> >> to you in exactly the same cases that used to break pg_dump (notably,
> >> >> where someone has manually adjusted either the default expression or
> >> >> the sequence...)
> >> >
> >> > I've just read this. I wasn't aware of this. Should we suppress this
> >> > behavior of pgAdmin?
> >>
> >> Do you have a proposed fix? I suspect people won't want us to stop
> >> showing columns as 'SERIAL' when they actually were created that way.
> >
> > Other ideas than doing what pg_dump does? I'm afraid not.
>
> pg_dump isn't designed to make the output look pretty, which is the
> major issue here. We're trying to do both.
>

Yes.

> It seems to me that correctness trumps aesthetics, so we probably will
> have to do what pg_dump does.

That's the main reason I started this thread :)

> Care to work up a patch?
>

Yep. On my TODO list right now.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers