Re: [SQL] How to trim values?

2000-12-30 Thread Karel Zak
On Thu, 28 Dec 2000, Oliver Elphick wrote: > [EMAIL PROTECTED] wrote: > >Hi, > > > >I'm trying to figure out how to take a value like 3.68009074974387 > >(that is calculated from values in my database) and have PostgreSQL > >hand me 3.68. Any suggestions would be appreciated. > > cast

Re: [SQL] Date/Time problem -(((

2000-12-30 Thread Kaare Rasmussen
> Is there any Date/Time function in PGSQL? I want as shown in this > example delete entries older than 300 secounds. > > I postet to the list because I have found no solution in the > tutorials and search-engine (maybe searched with wrong words?) http://www.postgresql.org/users-lounge/docs/7.0/p

[SQL] References to SERIAL

2000-12-30 Thread Thomas SMETS
Hi, If i create a "internal pk" buy defining on a table a field SERIAL. How do I reference this field in the other table to set the field possible value ? create table book ( /* This is an internal primary key for the book description */ book_pk serial, // End of Book def )

[SQL] Changing owner of tables, functions, etc.

2000-12-30 Thread Albert REINER
Saluton, is there a way to "donate" databases, tables, functions etc. to some other postgres user? The reason for this is that it would add some safety with respect to preventing one from accidentally DROPping some important data, as one would have to su to the other user first. Thanks in advan

[SQL] PL/pgSQL: returning array?

2000-12-30 Thread Albert REINER
Saluton, I am trying to write my first plpgsql-functions; I do not seem to be able to find a way of returning an array; here is what I tried: , | CREATE FUNCTION "concatallinstances2" (int4 ) RETURNS text[2] AS ' | declare | reslt text; | separator text; | instance record; | first te

[SQL] configure: what was used?

2000-12-30 Thread Albert REINER
Saluton, I have to work with a PostgreSQL-installation on a site where I am not the root (but I am supposed to act as the Postgres-superuser). The system administrator installed a bunch of 7.0.2-RPMs from the SuSE-site. How can I find out how that was configured? I am interested mainly in locale

Re: [SQL] References to SERIAL

2000-12-30 Thread Brett W. McCoy
On Sat, 30 Dec 2000, Thomas SMETS wrote: > If i create a "internal pk" buy defining on a table a field SERIAL. > How do I reference this field in the other table to set the field > possible value ? > > > create table book ( > /* This is an internal primary key for the book description */ >

Re: [SQL] References to SERIAL

2000-12-30 Thread Oliver Elphick
"Brett W. McCoy" wrote: >On Sat, 30 Dec 2000, Thomas SMETS wrote: > >> If i create a "internal pk" buy defining on a table a field SERIAL. >> How do I reference this field in the other table to set the field >> possible value ? ... > >You mean as a foreign key? You would do somethi

Re: [SQL] References to SERIAL

2000-12-30 Thread Thomas SMETS
Yeap, Tx Brett. The syntaxe you gave means much more to me than the one I got from the Book "PostresSQL : Introduction & Concept" from Bruce Momjian seems a bit short while the PostgreSQL user guide from Thomas LOCKHART has the full theorical description. I'll probably stick more with the seco

Re: [SQL] Looking for comments

2000-12-30 Thread Thomas SMETS
1. General comment: you use lettercase to divide words in table and fieldnames; this will be lost as soon as you create the tables, because PostgreSQL folds everything to lower case. Use _ to separate words instead. OK it should be done everywhere where I did some changes, at least. I