Re: [GENERAL] Maximum number of columns in a table

2009-04-11 Thread Martin Gainty
*guess i'm not used to seeing such thoughtful responses* please keep us all apprised on how your implementation progresses! Martin __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité This mes

Re: [GENERAL] Maximum number of columns in a table

2009-04-11 Thread Gerry Scales
Thank you gentlemen. I believe I am now enlightened. 1. The maximum number of rows per table is not limited by an algorithm at CREATE/ALTER TABLE other than to enforce an absolute maximum number of columns of 1600. 2. The ability to store any individual row depends on its content. I hasten t

Re: [GENERAL] Maximum number of columns in a table

2009-04-11 Thread Tom Lane
Sam Mason writes: > Just out of interest; what would happen if you had: > CREATE TABLE wider ( > col0001 TEXT, > col0002 TEXT, > -- [ ] > col9998 TEXT, > col TEXT > ); > CREATE TABLE store ( > pk1 INTEGER, > pk2 TEXT, > PRIMARY KEY (pk1,pk2), >

Re: [GENERAL] Maximum number of columns in a table

2009-04-11 Thread Sam Mason
On Sat, Apr 11, 2009 at 05:43:06PM -0400, Tom Lane wrote: > In principle, every varchar column could get toasted into an 18-byte > (more in pre-8.3 versions) TOAST pointer, meaning you could get to > somewhere around 450 columns in 8K regardless of how wide they are. Wow, never realised it was tha

Re: [GENERAL] Maximum number of columns in a table

2009-04-11 Thread Gerry Scales
Thanks Sam, that's excellent advice. If a developer doesn't jump in with a definitive formula, that is the path I will take. Regards Gerry - Original Message - From: "Sam Mason" To: Sent: Sunday, April 12, 2009 7:23 AM Subject: Re: [GENERAL] Maximum number of columns in a table

Re: [GENERAL] Maximum number of columns in a table

2009-04-11 Thread Tom Lane
Sam Mason writes: > On Sun, Apr 12, 2009 at 05:33:35AM +1000, Gerry Scales wrote: >> I have a situation where I need to load tables from another database >> which may theoretically contain up to 1000 columns per table and this >> information will determine whether I need to rebuild PostgreSQL with

Re: [GENERAL] Maximum number of columns in a table

2009-04-11 Thread Sam Mason
On Sun, Apr 12, 2009 at 05:33:35AM +1000, Gerry Scales wrote: > The FAQs state "Maximum number of columns in a table? 250-1600 > depending on column types". > > Is there a location which gives instructions for calculating whether a > number of columns of different types can be accommodated? > > I

Re: [GENERAL] Maximum number of columns in a table

2009-04-11 Thread Gerry Scales
varlena columns can be supported in a table with a standard 8K blocksize? Gerry __ Information from ESET NOD32 Antivirus, version of virus signature database 4001 (20090411) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com

Re: [GENERAL] Maximum number of columns in a table

2009-04-11 Thread Martin Gainty
information will determine whether I need to rebuild PostgreSQL with a larger blocksize. Splitting into multiple tables is not always an easy option. Many thanks Gerry __ Information from ESET NOD32 Antivirus, version of virus signature database 4001 (20090411) __ The messa

[GENERAL] Maximum number of columns in a table

2009-04-11 Thread Gerry Scales
Antivirus, version of virus signature database 4001 (20090411) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread Tom Lane
Sam Mason writes: > As others have said; the design of PG is such that it's built to assume > you're always connected to exactly one database. I'd guess this is an > artifact from a long time ago when PG didn't have multiple databases. It's possible that that was true way back in Berkeley prehis

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread li...@mgreg.com
On Apr 11, 2009, at 1:49 PM, Sam Mason wrote: As others have said; the design of PG is such that it's built to assume you're always connected to exactly one database. I'd guess this is an artifact from a long time ago when PG didn't have multiple databases. -- Sam http://samason.me.uk/

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread Sam Mason
On Sat, Apr 11, 2009 at 01:15:44PM -0400, li...@mgreg.com wrote: > > On Apr 11, 2009, at 12:56 PM, Tom Lane wrote: > > > >There is no such edge case. DROP DATABASE has to be issued while > >connected to some database, and it won't let you drop the DB you're > >connected to. > > > >And CREATE DATA

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread Christophe
On Apr 11, 2009, at 10:15 AM, li...@mgreg.com wrote: So, how does needing to connect to a database before querying about existing databases make any sense? Well, you have to connect to the database server, no matter what, in order to check on the existence of a database (unless you are doin

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread Adrian Klaver
On Saturday 11 April 2009 10:15:44 am li...@mgreg.com wrote: > On Apr 11, 2009, at 12:56 PM, Tom Lane wrote: > > There is no such edge case. DROP DATABASE has to be issued while > > connected to some database, and it won't let you drop the DB you're > > connected to. > > > > And CREATE DATABASE ha

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread li...@mgreg.com
On Apr 11, 2009, at 12:56 PM, Tom Lane wrote: There is no such edge case. DROP DATABASE has to be issued while connected to some database, and it won't let you drop the DB you're connected to. And CREATE DATABASE has to be issued while connected to some database, so createdb still has to have

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread Tom Lane
[ forgot to respond to this bit... ] "li...@mgreg.com" writes: > What if you hit that edge case where there are in fact no databases? There is no such edge case. DROP DATABASE has to be issued while connected to some database, and it won't let you drop the DB you're connected to. > I suppose y

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread John R Pierce
li...@mgreg.com wrote: I'm sorry, I'm confused by your reply. I may have said "table" when I meant "database". I believe it absolutely *does* make sense to connect without specifying a database first. What if you hit that edge case where there are in fact no databases? I suppose you could

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread Tom Lane
"li...@mgreg.com" writes: > What do you mean when you say the "catalogs...are database- > specific" ? If I'm understanding what you're saying, my whole point > is that I don't want to be tied to a database to do any kind of > querying about the PG engine itself. Does that make sense? No, i

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread Adrian Klaver
On Saturday 11 April 2009 9:10:33 am li...@mgreg.com wrote: > On Apr 11, 2009, at 11:56 AM, Tom Lane wrote: > > There are, although we don't spell the commands like that. This is > > not > > relevant to the question of whether it makes sense to connect without > > being connected to a specific dat

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread li...@mgreg.com
On Apr 11, 2009, at 11:56 AM, Tom Lane wrote: There are, although we don't spell the commands like that. This is not relevant to the question of whether it makes sense to connect without being connected to a specific database. It doesn't, because the catalogs that you have to inspect to fi

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread Ries van Twisk
On Apr 11, 2009, at 10:49 AM, li...@mgreg.com wrote: On Apr 11, 2009, at 11:39 AM, Raymond O'Donnell wrote: The answer is still "no". :-) The usual thing it to connect to the "postgres" database (or to "template1" in older versions of PG), and then you can issue queries to see what's the

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread Sam Mason
On Sat, Apr 11, 2009 at 11:49:25AM -0400, li...@mgreg.com wrote: > I was > hoping there were some higher level management items like "show > databases", and "show tables", etc in Postgres as well. The standard way would be to use the "information_schema", it's in the SQL standard and supported

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread Tom Lane
"li...@mgreg.com" writes: > Hrm...Ok, well, for the record, I'm moving some systems from MySQL to > Postgres and am in the process of getting familiar with it. I was > hoping there were some higher level management items like "show > databases", and "show tables", etc in Postgres as well.

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread li...@mgreg.com
On Apr 11, 2009, at 11:39 AM, Raymond O'Donnell wrote: The answer is still "no". :-) The usual thing it to connect to the "postgres" database (or to "template1" in older versions of PG), and then you can issue queries to see what's there. You're pretty much guaranteed that one of those data

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread Raymond O'Donnell
On 11/04/2009 16:30, li...@mgreg.com wrote: > Quick question: Does PGSQL provide a mechanism by which to connect to > the server without specifying a database? I saw a thread back in 2005 > that said "no" > (http://archives.postgresql.org//pgsql-interfaces/2005-02/msg00031.php), > but I was curi

Re: [GENERAL] Connect without specifying a database?

2009-04-11 Thread Sam Mason
On Sat, Apr 11, 2009 at 11:30:00AM -0400, li...@mgreg.com wrote: > Quick question: Does PGSQL provide a mechanism by which to connect to > the server without specifying a database? I saw a thread back in 2005 > that said "no" > (http://archives.postgresql.org//pgsql-interfaces/2005-02/msg000

[GENERAL] Connect without specifying a database?

2009-04-11 Thread li...@mgreg.com
Hi All, Quick question: Does PGSQL provide a mechanism by which to connect to the server without specifying a database? I saw a thread back in 2005 that said "no" (http://archives.postgresql.org//pgsql-interfaces/2005-02/msg00031.php ), but I was curious as to whether that's changed. Basi

Re: [GENERAL] Internationalization

2009-04-11 Thread Pedro Doria Meunier
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thank you Sam for the valuable input! Best regards, Pedro Doria Meunier GSM: +351 96 17 20 188 Skype: pdoriam Sam Mason wrote: > On Sat, Apr 11, 2009 at 02:47:53AM +0100, Pedro Doria Meunier wrote: >> Actually what I have is a fully internationa

Re: [GENERAL] Internationalization

2009-04-11 Thread Sam Mason
On Sat, Apr 11, 2009 at 02:47:53AM +0100, Pedro Doria Meunier wrote: > Actually what I have is a fully internationalized site by means of > getttext. > *Some* of the content comes from the PGSQL database where 2 tables > relation with others (namely for sensor data description). Why not continue u

Re: [GENERAL] existence of column name

2009-04-11 Thread Jasen Betts
On 2009-04-09, Eric Smith wrote: > All, > > From the C API, how do I check for the existence of a column name in > a given table? you can look at the information schema, column-names in a result-set, or error messages. which is most apropriate depends on the context. -- Sent via pgsql-gen

Re: [GENERAL] Convert Oracle function to PostgreSQL

2009-04-11 Thread Jasen Betts
On 2009-04-06, SHARMILA JOTHIRAJAH wrote: > Hi, > I use this Oracle function(from AskTom - > http://asktom.oracle.com/pls/asktom/f?p=100:11:0P11_QUESTION_ID:210612357425) > > ops$tk...@dev8i> create or replace > function in_list( p_string in varchar2 ) return myTableType > How ca

Re: [GENERAL] Connect to server PG from laptop java app

2009-04-11 Thread Jasen Betts
On 2009-04-05, Johan Nel wrote: > Jennifer, > > Jennifer Trey wrote: >> Hi, I am trying to create my DB schema on the server through my >> development laptop. >> >> I have installed Web Server 2008 and PostgreSQL. They are both running. >> For some reason its not working. Do I need to open som