From: Tom Lane on 1 Mar 2010 16:29 Peter Eisentraut <peter_e(a)gmx.net> writes: > SQL standard: > <SQL-data access indication> ::= > NO SQL > | CONTAINS SQL > | READS SQL DATA > | MODIFIES SQL DATA Huh. I understand three of those, but what is the use of CONTAINS SQL? Seems like that would have to be the same as the last one, or maybe the next-to-last one if you're prepared to assume it's read-only SQL. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Boszormenyi Zoltan on 1 Mar 2010 16:40 Jaime Casanova írta: > On Mon, Mar 1, 2010 at 2:56 PM, Peter Eisentraut <peter_e(a)gmx.net> wrote: > >> On tis, 2010-02-23 at 16:54 -0500, Jaime Casanova wrote: >> >>> On Tue, Feb 23, 2010 at 2:02 PM, Tom Lane <tgl(a)sss.pgh.pa.us> wrote: >>> >>>> There may be some value in inventing a "has no side effects" marker, but >>>> that should not be confused with IMMUTABLE/STABLE. >>>> >>>> >>> a READONLY function? >>> >> SQL standard: >> >> <SQL-data access indication> ::= >> NO SQL >> | CONTAINS SQL >> | READS SQL DATA >> | MODIFIES SQL DATA >> >> > > good! > > >> Notice also that this is separate from >> >> <deterministic characteristic> ::= >> DETERMINISTIC >> | NOT DETERMINISTIC >> >> > > so IMMUTABLE = DETERMINISTIC NO SQL, > STABLE = DETERMINISTIC READS SQL DATA > VOLATILE = NOT DETERMINISTIC MODIFIES SQL DATA > > >> which is the SQL standard's variant of volatility. >> >> So someone has already had the idea that these two should exist >> separately. >> >> > > seems something we should implement > At least the combinations to recognize the current IMMUTABLE/STABLE/VOLATILE features. By definition, READS SQL DATA and MODIFIES SQL DATA cannot be DETERMINISTIC. But I can imagine some C and PL/Perl functions that are NOT DETERMINISTIC NO SQL. And what does "CONTAINS SQL" mean? Is it distinct from the other two READS/MODIFIES SQL DATA markers? "SELECT CURRENT_TIMESTAMP" may be an example but it doesn't seem to be significantly different from $$SELECT $1 || $2;$$ LANGUAGE SQL or the same written in PL/Perl or C. Best regards, Zoltán Böszörményi -- Bible has answers for everything. Proof: "But let your communication be, Yea, yea; Nay, nay: for whatsoever is more than these cometh of evil." (Matthew 5:37) - basics of digital technology. "May your kingdom come" - superficial description of plate tectonics ---------------------------------- Zoltán Böszörményi Cybertec Schönig & Schönig GmbH http://www.postgresql.at/ -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Jaime Casanova on 1 Mar 2010 17:36 On Mon, Mar 1, 2010 at 4:29 PM, Tom Lane <tgl(a)sss.pgh.pa.us> wrote: > Peter Eisentraut <peter_e(a)gmx.net> writes: >> SQL standard: > >> <SQL-data access indication> ::= >> NO SQL >> | CONTAINS SQL >> | READS SQL DATA >> | MODIFIES SQL DATA > > Huh.  I understand three of those, but what is the use of CONTAINS SQL? > Seems like that would have to be the same as the last one > i guess the safer asumption is: treat it as MODIFIES SQL DATA -- Atentamente, Jaime Casanova Soporte y capacitación de PostgreSQL AsesorÃa y desarrollo de sistemas Guayaquil - Ecuador Cel. +59387171157 -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: "Kevin Grittner" on 1 Mar 2010 18:09 Tom Lane <tgl(a)sss.pgh.pa.us> wrote: > Peter Eisentraut <peter_e(a)gmx.net> writes: >> SQL standard: > >> <SQL-data access indication> ::= >> NO SQL >> | CONTAINS SQL >> | READS SQL DATA >> | MODIFIES SQL DATA > > Huh. I understand three of those, but what is the use of CONTAINS > SQL? Seems like that would have to be the same as the last one, > or maybe the next-to-last one if you're prepared to assume it's > read-only SQL. On a quick search of the spec, the best I was able to tell was that you are required to use "CONTAINS SQL" if the language is SQL. Perhaps it figures that the database engine can determine the read/write behavior directly if the language is SQL, and you tell it what it does if you're coding in some other language. -Kevin -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Peter Eisentraut on 2 Mar 2010 05:26
On mån, 2010-03-01 at 15:30 -0500, Jaime Casanova wrote: > so IMMUTABLE = DETERMINISTIC NO SQL, > STABLE = DETERMINISTIC READS SQL DATA > VOLATILE = NOT DETERMINISTIC MODIFIES SQL DATA It might be tempting to create such a mapping, but there could be a number of pitfalls, especially if you define it as a commutative equivalence rather than say logical implications. For example, MODIFIES SQL DATA ought to imply VOLATILE, but the reverse is not true. When the volatility attribute was introduced, we briefly looked at the standard "deterministic" attribute, but concluded that it would be better to create settings that describe how the PostgreSQL planner/executor works instead of some abstract setting that is descriptive but doesn't actually help optimizing the query. We might actually end up with all three groups of settings at some point. -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |