Re: [SQL] getting the current date

2002-10-17 Thread Ludwig Lim
--- Joseph Syjuco <[EMAIL PROTECTED]> wrote: > > how can i get the current date (without the time > part) in sql. --> try SELECT current_date(); ludwig. __ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com -

Re: [SQL] Slow performance on MAX(primary_key)

2002-10-17 Thread Richard Huxton
On Thursday 17 Oct 2002 12:46 am, Keith Gray wrote: > Getting MIN() adn MAX() seems fairly trivial to me. > > When is on an index or more importantly Primary > Key it must be a common SQL. > > Would it be possible in the code to look at > the field in MIN() or MAX() and if it is > indexed use a si

Re: [SQL] Use of reference table ('look-up-table') and FK constraint

2002-10-17 Thread Charles Hauser
Josh & Stephan, This helps a lot - thanks! Any idea what datatype 'Identifier_type IDENTITY' specifies? I don't see this in the postgres documentation. I'll see what I can find in sybase lingo. CREATE TABLE phone ( phone_id Identifier_type IDENTITY, phone_number

Re: [SQL] functions that return a dataset or set of rows

2002-10-17 Thread Gaetano Mendola
"Brian Ward" <[EMAIL PROTECTED]> wrote in message news:aofqbd$10v5$1@;news.hub.org... > How do I create a function that returns a set of row; > > I can't seem to find the datatype that the return set should be declared as. You should wait for Postgres 7.3 currently in beta. Ciao Gaetano

Re: [SQL] Messy Casts, Is there a better way?

2002-10-17 Thread Josh Berkus
Larry, > If I do that, and enter '72 months' in the contract_term field, how > can > I convince PostgreSQL to output the interval back in months? It > wants > to give me '5 Years'. That's on the TODO list, I'm afraid. From the sound of it, you should stick with your current schema and custom

Re: [SQL] Messy Casts, Is there a better way?

2002-10-17 Thread Larry Rosenman
On Thu, 2002-10-17 at 17:50, Josh Berkus wrote: > Larry, > > > If I do that, and enter '72 months' in the contract_term field, how > > can > > I convince PostgreSQL to output the interval back in months? It > > wants > > to give me '5 Years'. > > That's on the TODO list, I'm afraid. From the

[SQL] object oriented vs relational DB

2002-10-17 Thread Charles Hauser
Perhaps a mistake to ask this here (heresy I suspect) but I would be interested in the perspectives of people who make a living at this. Background: I am a molecular biologist trying to build a database containing genomic data, strain details, community info (people, publications etc). Every

Re: [SQL] Use of reference table ('look-up-table') and FK constraint

2002-10-17 Thread Stephan Szabo
On 17 Oct 2002, Charles Hauser wrote: > Josh & Stephan, > > This helps a lot - thanks! > > Any idea what datatype 'Identifier_type IDENTITY' specifies? I don't > see this in the postgres documentation. I'll see what I can find in > sybase lingo. As a rough guess, I'd say probably a serial colu

Re: [SQL] object oriented vs relational DB

2002-10-17 Thread Josh Berkus
Charles, > ".is perhaps evolving its schema _more_ now that sequencing is > finished and annotation is really picking up speed, you should not > think that > the changes are going to get less ! You will have to deal with > problems like > genes that get renamed but you still need the old name

Re: [SQL] object oriented vs relational DB

2002-10-17 Thread Richard Huxton
On Thursday 17 Oct 2002 4:03 pm, Josh Berkus wrote: > Charles, > > > as far as I aware, constantly evolving schema is not one of > > relational databases > > strengths." > > All of the above issues are easily solvable by a SQL expert. "You > show me somebody preaching about the 'limitations' of r

Re: [SQL] Messy Casts, Is there a better way?

2002-10-17 Thread Larry Rosenman
On Tue, 2002-10-15 at 13:54, Peter Eisentraut wrote: > Larry Rosenman writes: > > > I have a table with the following, in part: > > > > contract_start date > > contract_term int (term in MONTHS) > > Store contract_term as interval? If I do that, and enter '72 months' in the contract_term field,