Re: Better name/syntax for "online" index creation

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Greg Stark <gsstark(at)mit(dot)edu>
Subject: Re: Better name/syntax for "online" index creation
Date: 2006-07-26 14:31:27
Message-ID: 877j20qvy8.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:

> Greg Stark wrote:
> > One thing to think about, what will the command to execute stored
> > procedures look like? Those will also need to be called from outside
> > a transaction.
>
> Huh? Only if you invent your own stored-procedure theory or have a
> hitherto unknown interpretation of the SQL standard.

Well I haven't read that section of the standard. But from discussions on the
mailing list the key feature distinguishing "stored procedures" from
"functions" will be whether they live inside or outside transactions.

Functions are called within WHERE clauses and elsewhere and cannot start or
end transactions since that would be nonsensical.

Stored procedures are basically shell scripts running in the database engine
and can do pretty much anything the user can do from a psql prompt including
things like starting and end transactions and mutating state variables.

I suppose there's nothing stopping them from being called with a transaction
already opened, closing it and starting a new one but it seems like that would
be very confusing for users. Essentially that's why CLUSTER and CREATE INDEX
... ONLINE make sure there isn't a user started transaction already. Not
because it wouldn't work but because the interface would just be surprising
and confusing for users. I guess that never stopped the SQL standard committee
before, why should it start now? p

--
greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2006-07-26 14:55:51 Re: patch implementing the multi-argument aggregates (SOC project)
Previous Message Mónica Ivonne Herrera Alonso 2006-07-26 14:30:57 About "ALTER USER" command