Re: Better name/syntax for "online" index creation - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Better name/syntax for "online" index creation
Date
Msg-id 877j20qvy8.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Better name/syntax for "online" index creation  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.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



pgsql-hackers by date:

Previous
From: "jkzhao"
Date:
Subject: default lower case of identifier
Next
From: Gregory Stark
Date:
Subject: Re: [PATCHES] patch implementing the multi-argument aggregates (SOC project)