pga3: SQL Formatting

Поиск
Список
Период
Сортировка
От Dave Page
Тема pga3: SQL Formatting
Дата
Msg-id 03AF4E498C591348A42FC93DEA9661B83AF082@mail.vale-housing.co.uk
обсуждение исходный текст
Список pgadmin-hackers
Hi all,

I'm after some thoughts on SQL formatting for the SQL pane in pgAdmin 3,
not so much about how it's indented etc, but whether we include DROPs,
ALTER's etc.

For example, for a simple table we might have:

-- Table: public.foo
CREATE TABLE public.foo (
  bar INTEGER
);

or should we have:

-- Table: public.foo

DROP TABLE public.foo;

CREATE TABLE public.foo (
  bar INTEGER
);

or

-- Table: public.foo

-- DROP TABLE public.foo;

CREATE TABLE public.foo (
  bar INTEGER
);

In the case of an alter command, we could use something more like:

-- Check: bar_val

ALTER TABLE foo DROP CONSTRAINT bar_val;

ALTER TABLE foo
  ADD CONSTRAINT bar_val
  CHECK (bar > 100);

or a variant thereof.

Comments, thoughts? I'm leaning towards including both the DROP and
CREATE myself, without commenting out either.

Regards, Dave.


В списке pgadmin-hackers по дате отправления:

Предыдущее
От: "Dave Page"
Дата:
Сообщение: Re: Pga2: Add retun set in form function
Следующее
От: Andreas Pflug
Дата:
Сообщение: Re: pga3: SQL Formatting