Re: New mug design

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: New mug design
Дата
Msg-id 200911282257.nASMvc307050@momjian.us
обсуждение исходный текст
Ответ на Re: New mug design  ("Marc G. Fournier" <scrappy@hub.org>)
Ответы Re: New mug design  (Scrappy <scrappy@hub.org>)
Re: New mug design  (Andreas 'ads' Scherbaum <adsmail@wars-nicht.de>)
Re: New mug design  (Andreas 'ads' Scherbaum <adsmail@wars-nicht.de>)
Re: New mug design  (Florian Weimer <fweimer@bfk.de>)
Список pgsql-advocacy
Marc G. Fournier wrote:
> > You mean:
> >
> >     BEGIN;
> >     CREATE TABLE pg_mug (contents TEXT);
> >     INSERT INTO pg_mug VALUES('coffee', 'sugar', 'cream');
> >     COMMIT;
> >
> > ?
> >
> > I don't think "water" makes sense unless you are making instant coffee,
> > which I think is atypical.
>
> Ummm ... last I checked, that query will fail with too many fields? :)

Yep, only I could inject a bug into a mug.  :-(

The correct query is:

    BEGIN;
    CREATE TABLE pg_mug (contents TEXT);
    INSERT INTO pg_mug VALUES('coffee'), ('sugar'), ('cream');
    COMMIT;

That highlights our multi-value INSERT too.  :-)  With proper wrap it
would be:

    BEGIN;
    CREATE TABLE pg_mug (contents TEXT);
    INSERT INTO pg_mug
      VALUES('coffee'), ('sugar'), ('cream');
    COMMIT;

You can even add stirring:

    BEGIN;
    CREATE TABLE pg_mug (contents TEXT);
    INSERT INTO pg_mug
      VALUES('coffee'), ('sugar'), ('cream');
    -- stir
    SELECT * FROM pg_mug ORDER BY random();
    COMMIT;

FYi, I am just shooting out ideas until someone tells me to stop.  ;-)

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: New mug design
Следующее
От: Scrappy
Дата:
Сообщение: Re: New mug design