Re: [SQL] [GENERAL] table column vs. out param [1:0]

2007-08-27 Thread Kristo Kaiv
On 27.08.2007, at 18:07, Tom Lane wrote: Kristo Kaiv <[EMAIL PROTECTED]> writes: From http://www.postgresql.org/docs/current/static/plpgsql- declarations.html#PLPGSQL-DECLARATION-RENAMING-VARS Note: RENAME appears to be broken as of PostgreSQL 7.3. Fixing this is of low priority, since

Re: [SQL] [GENERAL] table column vs. out param [1:0]

2007-08-27 Thread Kristo Kaiv
: RENAME appears to be broken as of PostgreSQL 7.3. Fixing this is of low priority, since ALIAS covers most of the practical uses of RENAME. Seems to work though. Could somebody please confirm/reject that this has been fixed? Kristo Kaiv http://kaiv.wordpress.com (PostgreSQL blog)

Re: [SQL] strange result for select * from table where id=random()*900

2007-07-27 Thread Kristo Kaiv
FROM _g2977 g, (SELECT floor(random() * (900) as rnd) r WHERE g.id = r.rnd should work better, haven't tested though. Kristo Kaiv http://kaiv.wordpress.com (PostgreSQL blog)

Re: [SQL] Random Unique Integer

2007-06-14 Thread Kristo Kaiv
On 14.06.2007, at 22:40, Campbell, Lance wrote: I have a web application that is used to create web surveys and web forms. Users can create any number of surveys or forms at any time. The primary key on one of my tables defines the ID for any given form or survey. I do NOT want the number s

Re: [SQL] show index from [table]

2007-06-10 Thread Kristo Kaiv
On 08.06.2007, at 18:25, Stefan Zweig wrote: but actually i would need the information from within a (postgres) sql-query. is there a possibility to get information about the indices which have been created on a table? if there is not, it might be sufficient for me to get the create ind

Re: [SQL] current_date / datetime stuff

2007-06-06 Thread Kristo Kaiv
true, didn't test it that thoroughly: mod 7 should be bit more beautiful select date_trunc('month',now()) + ( ((8 - extract('dow' from date_trunc('month',now()))%7) ||'days')::text)::interval; On 06.06.2007, at 18:54, Osvaldo Rosario Kussama wro

Re: [SQL] current_date / datetime stuff

2007-06-04 Thread Kristo Kaiv
oneliner: select date_trunc('month',now()) + ((8 - extract('dow' from date_trunc ('month',now()))||'days')::text)::interval; Kristo On 04.06.2007, at 19:39, Michael Glaesemann wrote: On Jun 4, 2007, at 10:59 , Michael Glaesemann wrote: On Jun 4, 2007, at 10:27 , Andrew Sullivan wrote: