Re: [pgadmin-hackers] [PATCH] Fix column SQL

2012-08-23 Thread Dave Page
On Thu, Aug 23, 2012 at 7:19 AM, Timon  wrote:
> attached patch fixes SQL of column in SQL pane.
> sql should be like
> ALTER TABLE table ADD COLUMN tms timestamp without time zone NOT NULL
> DEFAULT now();
> and not
> ALTER TABLE table ADD COLUMN tms timestamp without time zone;
> ALTER TABLE table ALTER COLUMN tms SET NOT NULL;
> ALTER TABLE table ALTER COLUMN tms SET DEFAULT now();
>
> it avoids not null constraint problem when you add column to existing
> table with some data

I can't find the references in the archives (I'm sure this has come up
before), but iirc, we intentionally didn't do this as it wouldn't be
clear to the user that despite they might be about to cause a huge
write. I'm sure there was more to it than that, but my Google-fu is
failing me at the moment.



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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


Re: [pgadmin-support] [pgadmin-hackers] [PATCH] Fix column SQL

2012-08-23 Thread Timon
maybe we should show this script as comment in sql pane? like DROP column sql

2012/8/23 Dave Page :
> On Thu, Aug 23, 2012 at 9:33 AM, Timon  wrote:
>> I found it
>> http://archives.postgresql.org/pgadmin-support/2012-07/msg7.php
>
> Yeah, that was the most recent one (though, that was really about the
> "generate script" options), but I'm sure there was something
> previously.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company



-- 
All bugs reserved


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


Re: [pgadmin-support] [pgadmin-hackers] [PATCH] Fix column SQL

2012-08-23 Thread Dave Page
That doesn't seem unreasonable. It should probably include a comment
in that case, explaining why there are two versions of the SQL.

On Thu, Aug 23, 2012 at 10:09 AM, Timon  wrote:
> maybe we should show this script as comment in sql pane? like DROP column sql
>
> 2012/8/23 Dave Page :
>> On Thu, Aug 23, 2012 at 9:33 AM, Timon  wrote:
>>> I found it
>>> http://archives.postgresql.org/pgadmin-support/2012-07/msg7.php
>>
>> Yeah, that was the most recent one (though, that was really about the
>> "generate script" options), but I'm sure there was something
>> previously.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>
>
> --
> All bugs reserved
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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