Skip site navigation (1) Skip section navigation (2)

Re: PATCH for CREATE DATABASE with COLLATE, CTYPE & CONNECTION LIMIT

From: "Dave Page" <dpage(at)pgadmin(dot)org>
To: "Ashesh D Vashi" <ashesh(dot)vashi(at)enterprisedb(dot)com>
Cc: "Guillaume Lelarge" <guillaume(at)lelarge(dot)info>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: PATCH for CREATE DATABASE with COLLATE, CTYPE & CONNECTION LIMIT
Date: 2008-11-17 17:11:24
Message-ID: 937d27e10811170911p46334871ub7bcda0095b7cba3@mail.gmail.com (view raw or flat)
Thread:
Lists: pgadmin-hackers
Hi

On Mon, Nov 17, 2008 at 12:56 PM, Ashesh D Vashi
<ashesh(dot)vashi(at)enterprisedb(dot)com> wrote:
> Hi All,
>
> Please find the attached updated patch.
>
> Patch contains following changes:
> * Added "ctype" in keyword list as RESERVED
> * Added support for COLLATE, CTYPE & CONNECTION LIMIT in pgDatabase
> * Added reverse engineering support for SQL generation from existing schema
> * Added these variable in properties list.
>   (Made them disabled for the not-supported versions of PostgreSQL)
> * Added them in property list (forgot to add it in the previous patch)
> * Used wxTextCtrl instead of wxSpinCtrl for connection limit control in
>   properties dialog, as we don't want to put any restriction on the maximum
>   limit for it.

Some thoughts (all minor), in no particular order:

- Let's use 'Collation' and 'Character type' in both the properties
list view and on the dialog for the labels - it'll look much nicer
than COLLATE and CTYPE I think.

- dlgDatabase needs to have it's sizing fixed - the cell holding the
CTYPE controls is stretching, but it should be the comment cell that
stretches (<growablerows> needs to change to 11 perhaps?).

- Entering a new connection limit, and clicking the SQL tab doesn't
show me an SQL statement if the value entered is too large, but does
enable the OK button The easiest fix is probably to limit the number
of characters the control will access. That should still allow a huge
number to entered.

- Entering a connection limit of -<anything but 1> is silently
converted to 1. We should just ignore anything that isn't 1, rather
than trying to correct it for the user.

- 'Connection Limit' in the properties list should not have a capital L.

- This code in dlgDatabase may be uneeded now?

+    // As some of the controls has been made hidden,
+    // Update() will help to rearrange all the other controls properly.
+    this->Update();

- The COLLATE and CTYPE options should be omitted from the CREATE
DATBASE SQL generated by dlgDatabase, if the user hasn't specified
values.

- The CONNECTION LIMIT option seems to have an additional space in the indent:

CREATE DATABASE foobar
  WITH ENCODING='UTF8'
       COLLATE=''
       CTYPE=''
        CONNECTION LIMIT=99;

Looks pretty good though in general :-)

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

In response to

Responses

pgadmin-hackers by date

Next:From: Quan ZongliangDate: 2008-11-18 04:41:30
Subject: Re: the patch: support for DESC/NULLS FIRST/NULLS LAST
Previous:From: Ashesh D VashiDate: 2008-11-17 12:56:28
Subject: Re: PATCH for CREATE DATABASE with COLLATE, CTYPE & CONNECTION LIMIT

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group