Re: [SQL] cannot create function that uses variable table name

2003-01-17 Thread D'Arcy J.M. Cain
On Thursday 16 January 2003 22:32, Matthew Nuzum wrote: > I have a number of tables in my database that use the concept of > “display order”, which is a field that can be used in an order by clause > to dictate what order the results should come out in. > > I thought I would be crafty and devise

[SQL] sum(time) problem

2003-01-17 Thread Oliver Vecernik
Hi all, I've got following table structure: sport=# \d polar Table "polar" Column | Type | Modifiers +--+--- ts | timestamp with time zone | not null time | time without time zone | sport | integer

Re: [SQL] sum(time) problem

2003-01-17 Thread Julian Scarfe
On 17/1/03 13:03, "Oliver Vecernik" <[EMAIL PROTECTED]> wrote: > sport=# \d polar >Table "polar" > Column | Type | Modifiers > +--+--- > ts | timestamp with time zone | not null > time | time without time zone | >

Re: [SQL] sum(time) problem

2003-01-17 Thread Tom Lane
Julian Scarfe <[EMAIL PROTECTED]> writes: >> It seems I've chosen the wrong type. Or is there another solution? > Correct diagnosis. You need the "interval" type, not the "time" type for > your second field. Interval is a time difference between two timestamps, > for example the time between the

[SQL] RCF: 2nd draft: A brief guide to Nulls

2003-01-17 Thread dev
Thanks all for the previous feedback. If no-one comes up with any errors in this draft I'll call it finished. - Richard Huxton A Brief Guide to NULLs == revision: 0.9 date: 2002-01-17 author: Richard Huxton <[EMAIL PROTECTED]> Overview This is a short guide to

[SQL] "Best practice" advice

2003-01-17 Thread Andrew Perrin
I'm developing the second stage of a database that will eventually be used to model networks of references between documents. I already have a table of core documents, and the next step is to track what documents each of these core documents refers to. (Is this confusing enough already?) The rela

Re: [SQL] "Best practice" advice

2003-01-17 Thread Josh Berkus
Andrew, > The relationship is one-to-many, and I can handle that fine. The issue > is: some of the references in the core documents will be to other core > documents. Other references will be to documents that are not in the core > documents table. I need to track whether the document referred t

Re: [SQL] [GENERAL] double precision to numeric overflow error

2003-01-17 Thread Jan Wieck
Thomas O'Connell wrote: > > Well, it would've immediately (rather than the several minutes it took) > given away the problem if it read something like: > > ERROR: overflow caused by cast of double precision value to numeric > without sufficient precision, scale (15, 6) > > or even, depending on

[SQL] Can I do this?

2003-01-17 Thread Wei Weng
I want to select some data out of database A, and insert them into database B. Is it possible to do in one SQL query?   Thanks   Wei  

Re: [SQL] Can I do this?

2003-01-17 Thread Josh Berkus
Wei, > I want to select some data out of database A, and insert them into database B. Is it possible to do in one SQL query? > No. Use a Perl script. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of broadcast)--- TIP 2: yo

Re: [SQL] Can I do this?

2003-01-17 Thread Bruce Momjian
See /contrib/dblink, or use an application that attaches to both databases, or use COPY somehow. --- Wei Weng wrote: > I want to select some data out of database A, and insert them into database B. Is it >possible to do in

[SQL] Problem with COPY FROM

2003-01-17 Thread Harry Yau
Hi all, I am trying to copy some date from a text file to pgsql. I am using pgsql 7.3 version. The problem i am face is that i try to copy a TEXT field to a table. I have serveral line in this field. Let say, I have a table T1, and three fields with it, F1, F2, F3. F1 is varchar(5), F2 is text and