Re: [SQL] psql -F TAB

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. On

Re: [SQL] psql -F TAB

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

Re: [SQL] psql -F TAB

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] 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 TAB

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'

[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 TAB

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 EOT | psql -q -A -t -U $DBUSER -d $DB \f '\t' $QUERY EOT I think this will work even if your /bin/sh is not bash

[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

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 bigint_column from your_table order by random() limit 1; Andreas -- Andreas

[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 libpq

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 within

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

[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] 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:

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 question is

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] [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