Re: [SQL] [pgadmin-support] Groups and Roles and Users

2006-11-16 Thread Jim Nasby
On Nov 6, 2006, at 12:18 PM, Ezequias Rodrigues da Rocha wrote: Could someone suggest me how to get a documentation about Groups and Roles and Users ? It would be nice to see a simple and easy documentation (a tutorial could be better, with pgadmin much better). Have you looked in the Post

Re: [SQL] Question about time

2006-11-16 Thread Hector Villarreal
Try this one: SELECT date_trunc('seconds',now())::time; "15:11:42" So it should be select date_trunc('seconds', fecha_hora_factura)::time from nota_venta; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joe Sent: Thursday, November 16, 2006 2:24 PM To:

Re: [SQL] Question about time

2006-11-16 Thread Joe
On Thu, 2006-11-16 at 10:14 -0600, Judith wrote: > Hi everyone I'm doing a query like this: > > SELECT CAST(fecha_hora_factura as time) FROM nota_venta > > and I get: > > 14:16:52.824395 > > the field is timestamp type... I just want the HOUR:MINUTE:SECOND > > the q

Re: [SQL] Question about time

2006-11-16 Thread Phillip Smith
Try the to_char() function instead of cast() SELECT to_char(fecha_hora_factura, 'HH:MM:SS') FROM nota_venta Cheers, -p -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Judith Sent: Friday, 17 November 2006 5:14 AM To: pgsql-sql@postgresql.org Subject: [SQ

[SQL] Question about time

2006-11-16 Thread Judith
Hi everyone I'm doing a query like this: SELECT CAST(fecha_hora_factura as time) FROM nota_venta and I get: 14:16:52.824395 the field is timestamp type... I just want the HOUR:MINUTE:SECOND the question is how I drop the millisecond?? Thnx in advanced!!! --

Re: [SQL] Random()

2006-11-16 Thread Andrew Sullivan
On Thu, Nov 16, 2006 at 06:54:42PM -0200, Ezequias Rodrigues da Rocha wrote: > My bigint field has 20,000 numbers and I'd like to make real random (used > like lottery). If you want _real_ random, you have to use a non-computer source for your randomness. The best you get on a computer is pseudo-

Re: [SQL] Random()

2006-11-16 Thread Ezequias Rodrigues da Rocha
Just another question. I can trust on this random number ? The rule to it is quite tested ? I am thinking in implementing a function that return allways a random number. What do you think of the trust of this function (random()) ? My bigint field has 20,000 numbers and I'd like to make real rand

Re: [SQL] Random()

2006-11-16 Thread Ezequias Rodrigues da Rocha
Thank you so much andreas. Regards http://ezequiasrocha.blogspot.com 2006/11/16, A. Kretschmer <[EMAIL PROTECTED]>: am Thu, dem 16.11.2006, um 16:31:14 -0200 mailte Ezequias Rodrigues da Rocha folgendes: > Hi list, > > I have a bigint collumn and I would like to generate a random number withi

[SQL] convert with libpq

2006-11-16 Thread lms
Hi I must convert some records from database. I have table named "langset" in unicode database. When I try use command select convert((SELECT "1" from langset where id_langset=5) using utf_8_to_iso_8859_2) in PGadmin, all is ok, sql return 1 record. But where i execute the same command in li

Re: [SQL] Random()

2006-11-16 Thread A. Kretschmer
am Thu, dem 16.11.2006, um 16:31:14 -0200 mailte Ezequias Rodrigues da Rocha folgendes: > Hi list, > > I have a bigint collumn and I would like to generate a random number within > the > numbers of my column. select from order by random() limit 1; Andreas -- Andreas Kretschmer Kontakt: H

[SQL] Random()

2006-11-16 Thread Ezequias Rodrigues da Rocha
Hi list, I have a bigint collumn and I would like to generate a random number within the numbers of my column. Is it possible ? =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Atenciosamente (Sincerely) Ezequias Rodr

Re: [SQL] psql -F

2006-11-16 Thread Kazuyuki Maejima
Joe Conway wrote: Try: psql -A -t -U $DBUSER -d $DB -c "$QUERY" -F $'\t' That's excellent, but please let me post a different way :) by passing commands from stdin: #!/bin/sh cat <

[SQL] Apoie o estudo das células tronco

2006-11-16 Thread Ezequias Rodrigues da Rocha
Visitem: http://www.michaeljfox.org/ http://www.youtube.com/watch?v=DKVfsjIp98w =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Re: [SQL] psql -F

2006-11-16 Thread T E Schmitz
Joe Conway wrote: T E Schmitz wrote: Alvaro Herrera wrote: T E Schmitz wrote: I have written a shell script to export data: psql -A -t -U $DBUSER -d $DB -c "$QUERY" -F ' ' How can I specify a TAB character with the -F option? Try: psql -A -t -U $DBUSER -d $DB -c "$QUERY" -F $'\t' Y

Re: [SQL] recursive SQL and with clause

2006-11-16 Thread Jonah H. Harris
On 11/15/06, Christopher Browne <[EMAIL PROTECTED]> wrote: If I recall correctly, Jim Nasby was considering it; he hadn't heard much interest back, and got to other things in the 8.2 cycle. I was working on it for 8.2, but it didn't make it. Mark Cave-Ayland will probably be picking it up for

Re: [SQL] psql -F

2006-11-16 Thread Joe Conway
T E Schmitz wrote: Alvaro Herrera wrote: T E Schmitz wrote: I have written a shell script to export data: psql -A -t -U $DBUSER -d $DB -c "$QUERY" -F ' ' Currently, I am using spaces as field separator but what I really want is tabs. How can I specify a TAB character with the -F option?

Re: [SQL] psql -F

2006-11-16 Thread T E Schmitz
Alvaro Herrera wrote: T E Schmitz wrote: I have written a shell script to export data: psql -A -t -U $DBUSER -d $DB -c "$QUERY" -F ' ' Currently, I am using spaces as field separator but what I really want is tabs. How can I specify a TAB character with the -F option? This is really a s

Re: [SQL] psql -F

2006-11-16 Thread Alvaro Herrera
T E Schmitz wrote: > I have written a shell script to export data: > > psql -A -t -U $DBUSER -d $DB -c "$QUERY" -F ' ' > > Currently, I am using spaces as field separator but what I really want > is tabs. > > How can I specify a TAB character with the -F option? This is really a shell question

[SQL] psql -F

2006-11-16 Thread T E Schmitz
I have written a shell script to export data: psql -A -t -U $DBUSER -d $DB -c "$QUERY" -F ' ' Currently, I am using spaces as field separator but what I really want is tabs. How can I specify a TAB character with the -F option? -- Regards, Tarlika Elisabeth Schmitz --