Re: [HACKERS] single bit integer (TINYINT) revisited for 8.5

2009-07-04 Thread Simon Riggs
On Fri, 2009-07-03 at 13:38 -0400, Robert Treat wrote: On Thursday 02 July 2009 12:40:49 Simon Riggs wrote: On Wed, 2009-07-01 at 11:19 -0400, Caleb Cushing wrote: A couple of times I've been told you don't need tinyint, use boolean which is not true, several projects I've worked on I've

Re: [HACKERS] single bit integer (TINYINT) revisited for 8.5

2009-07-03 Thread Robert Treat
On Thursday 02 July 2009 12:40:49 Simon Riggs wrote: On Wed, 2009-07-01 at 11:19 -0400, Caleb Cushing wrote: A couple of times I've been told you don't need tinyint, use boolean which is not true, several projects I've worked on I've needed and integer field that supports number within a

Re: [HACKERS] single bit integer (TINYINT) revisited for 8.5

2009-07-02 Thread Simon Riggs
On Wed, 2009-07-01 at 11:19 -0400, Caleb Cushing wrote: I'd like to see this topic revisited since as far as I can see it hasn't been seriously discussed in years. I believe the main arguments against are why do we need more more numeric datatypes and increased maintenance. It would seem to

[HACKERS] single bit integer (TINYINT) revisited for 8.5

2009-07-01 Thread Caleb Cushing
I'd like to see this topic revisited since as far as I can see it hasn't been seriously discussed in years. I believe the main arguments against are why do we need more more numeric datatypes and increased maintenance. It would seem to me that a tinyint datatype maintenance wise would get all the

Re: [HACKERS] single bit integer (TINYINT) revisited for 8.5

2009-07-01 Thread Kevin Grittner
Caleb Cushing xenoterrac...@gmail.com wrote: most (if not all?) of posgresql's major competitor's (mysql, sql server, db2, etc) support a single bit integer datatype. A couple of times I've been told you don't need tinyint, use boolean which is not true, several projects I've worked on

Re: [HACKERS] single bit integer (TINYINT) revisited for 8.5

2009-07-01 Thread Josh Berkus
Caleb. I'd like to see this topic revisited since as far as I can see it hasn't been seriously discussed in years. I believe the main arguments against are why do we need more more numeric datatypes and increased maintenance. It would seem to me that a tinyint datatype maintenance wise would

Re: [HACKERS] single bit integer (TINYINT) revisited for 8.5

2009-07-01 Thread Tom Lane
Josh Berkus j...@agliodbs.com writes: But ... the nice thing about PostgreSQL is that data types can be loaded at runtime. Which means that you don't need INT1 in core for it to be useful to you and others; just write the data type and put it on pgFoundry. Yeah. The argument against that

[HACKERS] single bit integer (TINYINT) revisited for 8.5

2009-07-01 Thread Caleb Cushing
On Wed, Jul 1, 2009 at 11:41 AM, Kevin Grittnerkevin.gritt...@wicourts.gov wrote: I think you mean byte where you've said bit. you're correct. I'm being a nerf.  Boolean would be adequate for a single bit, and I haven't (so far) seen any database which supports both a single-bit type and a

Re: [HACKERS] single bit integer (TINYINT) revisited for 8.5

2009-07-01 Thread Tom Lane
Caleb Cushing xenoterrac...@gmail.com writes: On Wed, Jul 1, 2009 at 11:41 AM, Kevin Grittnerkevin.gritt...@wicourts.gov wrote: Many databases support a TINYINT type as a single-byte value, although I'm not sure there's consistency on whether that's a signed or unsigned value. wouldn't any

Re: [HACKERS] single bit integer (TINYINT) revisited for 8.5

2009-07-01 Thread Caleb Cushing
On Wed, Jul 1, 2009 at 12:09 PM, Josh Berkusj...@agliodbs.com wrote: The main reason not to have one is that given byte-alignment, 95% of the time using a tinyint would save no actual disk space or memory over just using INT2 (or indeed INT4).  I'll point out that the MySQLers are enamored of

Re: [HACKERS] single bit integer (TINYINT) revisited for 8.5

2009-07-01 Thread Greg Stark
Incidentally there *is* a single-byte integer data type in Postgres, it's called char (the quote marks are necessary in SQL due to the char(n) data type). It's a bit weird though, mainly because its output format is to output ascii characters -- kind of like how C's single-byte integer data type