On Tue, May 10, 2011 at 10:29 PM, Joseph Adams
joeyadams3.14...@gmail.com wrote:
It seems to me a reasonable way to implement VARIANT would be to have
a data type called VARIANT that stores an OID of the inner type at the
beginning, followed by the binary data.
That's likely to be how it gets
On 05/11/2011 07:53 AM, Robert Haas wrote:
On Tue, May 10, 2011 at 10:29 PM, Joseph Adams
joeyadams3.14...@gmail.com wrote:
It seems to me a reasonable way to implement VARIANT would be to have
a data type called VARIANT that stores an OID of the inner type at the
beginning, followed by the
On Wed, May 11, 2011 at 7:53 AM, Robert Haas robertmh...@gmail.com wrote:
That's likely to be how it gets implemented, but you seem to have
missed the point of some of the discussion upthread: the big problem
with that is that someone might type DROP TYPE foo, and when they
do, you need an
Excerpts from Simon Riggs's message of mar may 10 17:57:20 -0400 2011:
On Wed, May 4, 2011 at 5:58 PM, Alvaro Herrera alvhe...@alvh.no-ip.org
wrote:
both Oracle and MS-SQL have it
Do they? What types are they called?
ANYTYPE
--
Álvaro Herrera alvhe...@commandprompt.com
The PostgreSQL
On Wed, May 11, 2011 at 11:43 AM, Joseph Adams
joeyadams3.14...@gmail.com wrote:
On Tue, May 10, 2011 at 5:19 PM, Darren Duncan dar...@darrenduncan.net
wrote:
Examples of open union types could be number, which all the numeric types
compose, and so you can know say that you can use the
Robert Haas wrote:
On Wed, May 11, 2011 at 11:43 AM, Joseph Adams
joeyadams3.14...@gmail.com wrote:
On Tue, May 10, 2011 at 5:19 PM, Darren Duncan dar...@darrenduncan.net wrote:
Examples of open union types could be number, which all the numeric types
compose, and so you can know say that you
To follow-up my earlier comments ...
I suspect for practical purposes we may want to limit the scope of some type
features.
For example, the greatest benefits for open union / mixin types is with
routines/operators, not so much with tables.
So, Pg could choose to support open unions but
Darren Duncan dar...@darrenduncan.net writes:
But I'm just citing numeric as an example; there would be a lot more
in practice, potentially one for every individual type, so for example
if operators were defined for the open union rather than for the base
type, then users/extensions could
Darren Duncan wrote:
To follow-up, an additional feature that would be useful and resembles union
types is the variant where you could declare a union type first and then
separately other types could declare they are a member of the union. I'm
talking about loosely what mixins or
Excerpts from Bruce Momjian's message of mar may 10 16:21:36 -0400 2011:
Darren Duncan wrote:
To follow-up, an additional feature that would be useful and resembles
union
types is the variant where you could declare a union type first and then
separately other types could declare they
Alvaro Herrera wrote:
Excerpts from Bruce Momjian's message of mar may 10 16:21:36 -0400 2011:
Darren Duncan wrote:
To follow-up, an additional feature that would be useful and resembles union
types is the variant where you could declare a union type first and then
separately other types
On Wed, May 4, 2011 at 5:58 PM, Alvaro Herrera alvhe...@alvh.no-ip.org wrote:
A customer came to us with this request: a way to store any data in a
column. We've gone back and forth trying to determine reasonable
implementation restrictions, safety and useful semantics for them.
I note that
On Tue, May 10, 2011 at 3:57 PM, Simon Riggs si...@2ndquadrant.com wrote:
On Wed, May 4, 2011 at 5:58 PM, Alvaro Herrera alvhe...@alvh.no-ip.org
wrote:
A customer came to us with this request: a way to store any data in a
column. We've gone back and forth trying to determine reasonable
It seems to me a reasonable way to implement VARIANT would be to have
a data type called VARIANT that stores an OID of the inner type at the
beginning, followed by the binary data. When you say
pg_typeof(somevariant), you'll get 'variant'. Instead, you'd use a
function like this:
On Tue, May 10, 2011 at 10:29 PM, Joseph Adams
joeyadams3.14...@gmail.com wrote:
The VARIANT type, or similar, would be useful for the JSON data type
I've been intermittently working on, as it would allow us to create a
function like this:
from_json(JSON) returns VARIANT
This occurred to
2011/5/11 Joseph Adams joeyadams3.14...@gmail.com:
On Tue, May 10, 2011 at 10:29 PM, Joseph Adams
joeyadams3.14...@gmail.com wrote:
The VARIANT type, or similar, would be useful for the JSON data type
I've been intermittently working on, as it would allow us to create a
function like this:
Excerpts from Darren Duncan's message of mié may 04 15:33:33 -0300 2011:
I see VARIANT/ANYTYPE as the most general case of supporting union types,
which,
say, could have more specific examples of allow any number or date here but
nothing else. If VARIANT is supported, unions in general
On 05/06/2011 04:08 PM, Alvaro Herrera wrote:
Excerpts from Darren Duncan's message of mié may 04 15:33:33 -0300 2011:
I see VARIANT/ANYTYPE as the most general case of supporting union types, which,
say, could have more specific examples of allow any number or date here but
nothing else.
Alvaro Herrera alvhe...@commandprompt.com writes:
Excerpts from Darren Duncan's message of mié may 04 15:33:33 -0300 2011:
I see VARIANT/ANYTYPE as the most general case of supporting union types,
which,
say, could have more specific examples of allow any number or date here but
nothing
On Fri, May 6, 2011 at 3:18 PM, Andrew Dunstan and...@dunslane.net wrote:
On 05/06/2011 04:08 PM, Alvaro Herrera wrote:
Excerpts from Darren Duncan's message of mié may 04 15:33:33 -0300 2011:
I see VARIANT/ANYTYPE as the most general case of supporting union types,
which,
say, could have
Thanks for picking up on my mentioning union types; I wasn't sure if anyone did.
Merlin Moncure wrote:
On Fri, May 6, 2011 at 3:18 PM, Andrew Dunstan and...@dunslane.net wrote:
On 05/06/2011 04:08 PM, Alvaro Herrera wrote:
Excerpts from Darren Duncan's message of mié may 04 15:33:33 -0300
To follow-up, an additional feature that would be useful and resembles union
types is the variant where you could declare a union type first and then
separately other types could declare they are a member of the union. I'm
talking about loosely what mixins or type-roles or interfaces etc are
On Wed, May 4, 2011 at 8:03 PM, Tom Lane t...@sss.pgh.pa.us wrote:
Alvaro Herrera alvhe...@commandprompt.com writes:
As a followup idea there exists the desire to store records as records
and not text representation of same (given differing record types, of
course), for which it'd be more
On May 4, 2011, at 6:24 PM, Andrew Dunstan wrote:
I'm far from convinced that storing deltas per column rather than per record
is a win anyway. I don't have hard numbers to hand, but my vague recollection
is that my tests showed it to be a design that used more space.
It depends on how many
On 05/05/2011 01:00 PM, Jim Nasby wrote:
On May 4, 2011, at 6:24 PM, Andrew Dunstan wrote:
I'm far from convinced that storing deltas per column rather than per record is
a win anyway. I don't have hard numbers to hand, but my vague recollection is
that my tests showed it to be a design
Alvaro Herrera alvhe...@alvh.no-ip.org wrote:
A customer came to us with this request: a way to store any data
in a column.
+1
More than once (usually in replication, interface, or audit
situations) I've had to create a table with one column each of a
number of different data types, only
Alvaro Herrera alvhe...@alvh.no-ip.org writes:
A customer came to us with this request: a way to store any data in a
column. We've gone back and forth trying to determine reasonable
implementation restrictions, safety and useful semantics for them.
Yes, it seems rather messy.
The main idea
Alvaro Herrera wrote:
A customer came to us with this request: a way to store any data in a
column. We've gone back and forth trying to determine reasonable
implementation restrictions, safety and useful semantics for them.
I note that this has been requested in the past:
On Wed, May 4, 2011 at 12:36 PM, Tom Lane t...@sss.pgh.pa.us wrote:
Alvaro Herrera alvhe...@alvh.no-ip.org writes:
A customer came to us with this request: a way to store any data in a
column. We've gone back and forth trying to determine reasonable
implementation restrictions, safety and
On 05/04/2011 01:36 PM, Tom Lane wrote:
The main idea is to be able to store column values in an audit table
like this:
old_value variant
new_value variant
Currently, they use text for old_value and new_value, but this is, of
course, not very satisfactory.
Just out of curiosity,
On Wed, May 4, 2011 at 2:55 PM, Andrew Dunstan and...@dunslane.net wrote:
On 05/04/2011 01:36 PM, Tom Lane wrote:
The main idea is to be able to store column values in an audit table
like this:
old_value variant
new_value variant
Currently, they use text for old_value and
Excerpts from Tom Lane's message of mié may 04 14:36:44 -0300 2011:
Alvaro Herrera alvhe...@alvh.no-ip.org writes:
The main idea is to be able to store column values in an audit table
like this:
old_valuevariant
new_valuevariant
Currently, they use text for old_value and
Alvaro Herrera alvhe...@commandprompt.com writes:
Excerpts from Tom Lane's message of mié may 04 14:36:44 -0300 2011:
Just out of curiosity, what actual functionality gain would ensue over
just using text? It seems like doing anything useful with the audit
table contents would still require
On May 4, 2011, at 3:04 PM, Alvaro Herrera wrote:
As someone commented downthread, they also want to have things such as a
typeof operator. It could be used in (say) a plpgsql function to
choose different branches of code.
FWIW, pg_typeof(any) has been in core since 9.0.
Best,
David
--
On 05/04/2011 07:05 PM, Tom Lane wrote:
Alvaro Herreraalvhe...@commandprompt.com writes:
Excerpts from Tom Lane's message of mié may 04 14:36:44 -0300 2011:
Just out of curiosity, what actual functionality gain would ensue over
just using text? It seems like doing anything useful with the
David E. Wheeler da...@kineticode.com writes:
On May 4, 2011, at 3:04 PM, Alvaro Herrera wrote:
As someone commented downthread, they also want to have things such as a
typeof operator. It could be used in (say) a plpgsql function to
choose different branches of code.
FWIW, pg_typeof(any)
Excerpts from Tom Lane's message of mié may 04 20:05:54 -0300 2011:
Alvaro Herrera alvhe...@commandprompt.com writes:
Excerpts from Tom Lane's message of mié may 04 14:36:44 -0300 2011:
Just out of curiosity, what actual functionality gain would ensue over
just using text? It seems like
Alvaro Herrera alvhe...@commandprompt.com writes:
As a followup idea there exists the desire to store records as records
and not text representation of same (given differing record types, of
course), for which it'd be more worthwhile.
Maybe. The conventional wisdom is that text representation
38 matches
Mail list logo