On 25/05/2013 20:37, Moshe Jacobson wrote:
> I just created a new partition in a log table, and then built a check
> constraint on the recorded timestamp column.
>
> I have an index on this column, but the adding of the check constraint
> took a very, very long time.
>
> It seems that PostgreSQL
I just created a new partition in a log table, and then built a check
constraint on the recorded timestamp column.
I have an index on this column, but the adding of the check constraint took
a very, very long time.
It seems that PostgreSQL 9.1 does not check the index when building a check
constr
On 25 May 2013 18:14, Karel Riveron Escobar wrote:
> How would be if I would want to generate values among 3 and 5?
>
>
>
Hi Karel,
try something like:
SELECT floor(3 + random()*(5-3+1))::INT
Or generally:
CREATE OR REPLACE FUNCTION
random_range(INTEGER, INTEGER) RETURNS INTEGER
AS $$
SELEC
How would be if I would want to generate values among 3 and 5?
Regards, Karel Riverón
Student Scientific Council
Informatics Science University
- Original Message -
| From: "Szymon Guz"
| To: "Ian Lawrence Barwick"
| Cc: "bricklen" , "Karel Riveron Escobar"
| , pgsql-general@postgresql.
On 25 May 2013 17:56, Ian Lawrence Barwick wrote:
> 2013/5/26 bricklen :
> >
> > On Sat, May 25, 2013 at 8:45 AM, Karel Riveron Escobar
> > wrote:
> >>
> >> I want to generate random numbers in Pl/pgSQL. How can I do this?
> >> To be more specific, I have to generate random numbers among 0 and 5
Thanks bricklen.
I found another way in PostgreSQL 9.1.0 Documentation.
SELECT * INTO random_number FROM random(); -- random function gives me a random
value among 0.0 -- and 1.0
SELECT * INTO rounded_number FROM round(random_number * 5); -- this line is
completly obviously.
Saludos, Karel Ri
2013/5/26 bricklen :
>
> On Sat, May 25, 2013 at 8:45 AM, Karel Riveron Escobar
> wrote:
>>
>> I want to generate random numbers in Pl/pgSQL. How can I do this?
>> To be more specific, I have to generate random numbers among 0 and 5.
>
>
> One way:
> select n from unnest(ARRAY[0,1,2,3,4,5]) n orde
On Sat, May 25, 2013 at 8:45 AM, Karel Riveron Escobar <
kesco...@estudiantes.uci.cu> wrote:
> I want to generate random numbers in Pl/pgSQL. How can I do this?
> To be more specific, I have to generate random numbers among 0 and 5.
>
One way:
select n from unnest(ARRAY[0,1,2,3,4,5]) n order by r
Hello list,
I want to generate random numbers in Pl/pgSQL. How can I do this?
To be more specific, I have to generate random numbers among 0 and 5.
Thanks in advance.
Regards, Karel Riverón
Student Scientific Council
Informatics Science University
http://www.uci.cu