FW: Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Adrian Klaver
-- Forwarded Message: -- From: [EMAIL PROTECTED] (Adrian Klaver) To: Shawn [EMAIL PROTECTED] Subject: Re: [SQL] Part 1 of several - Converting a varchar to an interval Date: Wed, 26 Mar 2008 16:16:58 + -- Original message

Re: FW: Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Adrian Klaver
-- Original message -- From: Tom Lane [EMAIL PROTECTED] [EMAIL PROTECTED] (Adrian Klaver) writes: select ('134987'::int/1000.00) * interval ' 1 second' ; ?column? -- 00:02:14.987 (1 row) Or even easier: regression=# select

Re: FW: Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Adrian Klaver
-- Original message -- From: Tom Lane [EMAIL PROTECTED] [EMAIL PROTECTED] (Adrian Klaver) writes: Select 134987 * interval '1 msec'; ERROR: invalid input syntax for type interval: 1 msec SELECT version

Re: [SQL] Dropping Functions

2008-03-26 Thread Adrian Klaver
message if any? -- Adrian Klaver [EMAIL PROTECTED] -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Bounce test

2008-02-25 Thread Adrian Klaver
it. Sincerely, Dean Test -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Bounce test

2008-02-25 Thread Adrian Klaver
it. Sincerely, Dean It bounced. -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] Bounce test

2008-02-25 Thread Adrian Klaver
On Monday 25 February 2008 7:32 pm, Scott Marlowe wrote: On Mon, Feb 25, 2008 at 9:17 PM, Adrian Klaver [EMAIL PROTECTED] wrote: On Monday 25 February 2008 7:13 pm, Dean Gibson (DB Administrator) wrote: I have changed something in my eMail client regarding receiving messages

Re: [SQL] Bounce test

2008-02-25 Thread Adrian Klaver
On Monday 25 February 2008 8:07 pm, Scott Marlowe wrote: On Mon, Feb 25, 2008 at 9:54 PM, Adrian Klaver [EMAIL PROTECTED] wrote: So, your email client puts Dean's email address back in? Might I ask what option you chose? And if you have more than one? On gmail there's the reply

Re: [SQL] can a insert with a returning clause be subquery ?

2008-02-02 Thread Adrian Klaver
to it for 8.4. Would this be a variation of this item from the TODO: * Allow INSERT/UPDATE ... RETURNING inside a SELECT 'FROM' clause http://archives.postgresql.org/pgsql-general/2006-09/msg00803.php http://archives.postgresql.org/pgsql-hackers/2006-10/msg00693.php -- Adrian Klaver [EMAIL

Re: [SQL] extract or date_part on an interval? How many e

2008-01-27 Thread Adrian Klaver
('1987-02-01'::timestamp); age -- 20 years 11 mons 26 days (1 row) -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] date format

2008-01-24 Thread Adrian Klaver
to choose an index scan if your joining column's datatypes do not match -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] temp table existence

2007-12-29 Thread Adrian Klaver
such tables created in other sessions. Or maybe anyone knows the identification (apart from 'others') of error to trap it with EXCEPTION clause? select * from temp_table limit 1; Trap error 42P01 Undefined table. -- Adrian Klaver [EMAIL PROTECTED] - ---BeginMessage--- Hi all. Is there a way

Re: [SQL] request for help with COPY syntax

2007-10-23 Thread Adrian Klaver
it to work with your sample data by using the COPY command as follows: COPY geo.orig_city_maxmind FROM '/home/www/geo/DATA/MAXMIND.com/cities_no_header.txt' CSV quote as ; -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast

Re: [SQL] Question on pgpsql function

2007-04-08 Thread Adrian Klaver
it a field of type bit (week_flag) where the function needs a text type. See the documentation for bit functions- http://www.postgresql.org/docs/8.2/interactive/functions-bitstring.html There are some bit compatible string functions mentioned. -- Adrian Klaver [EMAIL PROTECTED

Re: [SQL] For loop

2007-03-13 Thread Adrian Klaver
: syntax error at or near LOOP SQL state: 42601 Character: 1 I installed the pgsql but I don't think it is a problem of language. What could be wrong ? I am not using functions too. I am using the SQL tool of PgAdmin III. Any help would be glad. Can we see the complete function? -- Adrian

Re: [SQL] How to store a password encripted in a userdefinedtable

2007-03-01 Thread Adrian Klaver
. Ezequias Snip Try select md5('password'||'user') The generated hash is a combination of the password and the user name. -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate

Re: [SQL] Grants

2006-12-01 Thread Adrian Klaver
NOINHERIT. This means ezequias does not automatically assume the privileges of the ROLES it belongs to. To acquire the privileges you have to do a SET ROLE administrators at the connection. -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast

Re: [SQL] select into

2006-11-27 Thread Adrian Klaver
one planning to add it? It can come it handy I bet. Thanks again, Mustafa... It may not be a shortcoming of the language, but a shortcoming in how well I understand it. I haven't given up hope I can make it work in plpgsql. The problem was I was going in circles. -- Adrian Klaver

Re: [SQL] select into

2006-11-26 Thread Adrian Klaver
where table_name~svc_tbl_name loop raise notice 'Column name:%', col_name.column_name; raise notice 'Value: %', svc_data_rec[col_name.column_name]; end loop; Thank you, Mustafa ... I am afraid I can't make it work either. -- Adrian Klaver [EMAIL

Re: [SQL] select into

2006-11-26 Thread Adrian Klaver
On Sunday 26 November 2006 02:45 pm, Adrian Klaver wrote: I am afraid I can't make it work either. I could not make it work with pl/pgsql, but I did manage to come up with a solution using pl/pythonu. The function is as follows- CREATE OR REPLACE FUNCTION dat_col_py(text) RETURNS text

Re: [SQL] select into

2006-11-24 Thread Adrian Klaver
. The change is reflected in the HISTORY text though. How is the best way to get a change made to the documentation? -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire

Re: [SQL] select into

2006-11-24 Thread Adrian Klaver
On Friday 24 November 2006 06:55 am, Andreas Kretschmer wrote: Adrian Klaver [EMAIL PROTECTED] schrieb: On Thursday 23 November 2006 08:45 pm, Tom Lane wrote: Mulham freshcode [EMAIL PROTECTED] writes: execute sql_str1 into svc_data_rec ; svc_data_rec is a RECORD, which

Re: [SQL] select into

2006-11-24 Thread Adrian Klaver
are looking for data from a single field couldn't you dispense with the RECORD variable and just build a query of the form SELECT col_name FROM tbl_name. If you want to go through a set of fields then it would involve some nested loops. -- Adrian Klaver [EMAIL PROTECTED

Re: [SQL] select into

2006-11-23 Thread Adrian Klaver
#PLPG SQL-STATEMENTS-EXECUTING-DYN Andreas My guess is that the error message is correct, the svc_data_rec has not had any values assigned to it. In other words the EXECUTE statement is not working the way you think it is. Could you post the EXECUTE string? -- Adrian Klaver [EMAIL

Re: [SQL] Trigger, record old is not assigned yet

2006-07-13 Thread Adrian Klaver
old is not assigned. Is there a way to distinguish in the trigger procedure from an insert statement to an update statement? Regards, -- Daniel CAUNE Ubisoft Online Technology (514) 490 2040 ext. 3613 -- Adrian Klaver [EMAIL PROTECTED] ---(end

Re: [SQL] Executing plpgsql scripts using psql, is that possible?

2006-01-16 Thread Adrian Klaver
for information on using COPY to load data from a file into a table- www.postgresql.org/docs/8.1/interactive/sql-copy.html -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your

Re: [SQL] Is it possible to redirect an update/insert/delete to a different table?

2005-11-20 Thread Adrian Klaver
. Andy ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] ERROR: Invalid regular expression: parentheses ( ) not balanced

2004-08-25 Thread Adrian Klaver
see is that it is called at 1 and a '(' shows up to the left of the prompt at 2 and stays there indicating to me at least the parser is not happy. -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] begin update ... syntax error

2004-04-10 Thread Adrian Klaver
? http://www.postgresql.org/docs/faqs/FAQ.html -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

<    1   2