Re: [SQL] Function returning SETOF using plpythonu

2007-01-29 Thread Adrian Klaver
#x27;s missing on this version or I'm I doing > something wrong on code? If is a feature missing, is already implemented > on some version afterwards? > > Best regards, > Luís Sousa > > > ---(end of broadcast)--- > TIP 4: Have you searched our list archives? > >http://archives.postgresql.org SETOF in pl/pythonu appeared in 8.2 -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

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

2007-03-01 Thread Adrian Klaver
; They are completely different. > > Ezequias > 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)

Re: [SQL] For loop

2007-03-13 Thread Adrian Klaver
ctions too. I am using the SQL > tool of PgAdmin III. > > Any help would be glad. > Can we see the complete function? -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] For loop

2007-03-13 Thread Adrian Klaver
e: 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. > > > > Ezequias &g

Re: [SQL] Question on pgpsql function

2007-04-08 Thread Adrian Klaver
x27;t want to do it in > view. Can somebody help me? > > Regards > skarthi The problem is with your use of the substr() function. You are passing 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

Re: [SQL] request for help with COPY syntax

2007-10-23 Thread Adrian Klaver
those " or ' > within the data? After a couple days I wasn't able to find any examples to > help. > > ---(end of broadcast)--- > TIP 4: Have you searched our list archives? > > http://archives.po

Re: [SQL] temp table existence

2007-12-29 Thread Adrian Klaver
not enough because there may be other 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

Re: [SQL] date format

2008-01-24 Thread Adrian Klaver
gt; best, > iuri > > > > > ---(end of broadcast)--- > TIP 9: In versions below 8.0, the planner will ignore your desire to >choose an index scan if your joining column's datatypes do not >

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

2008-01-27 Thread Adrian Klaver
365 as age; seems messy. > select (now()-'1987-02-01')/365; gives extraneous junk. > > Thanks! SELECT age('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] can a insert with a returning clause be subquery ?

2008-02-02 Thread Adrian Klaver
/2006-09/msg00803.php http://archives.postgresql.org/pgsql-hackers/2006-10/msg00693.php -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] Bounce test

2008-02-25 Thread Adrian Klaver
ot;Reply All" to this message, I'd > appreciate 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
ot;Reply All" to this message, I'd > appreciate 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 r

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 th

FW: Re: [SQL] Question 2 Interval and timestamptz

2008-03-26 Thread Adrian Klaver
-- Forwarded Message: -- From: [EMAIL PROTECTED] (Adrian Klaver) To: Shawn <[EMAIL PROTECTED]> Subject: Re: [SQL] Question 2 Interval and timestamptz Date: Wed, 26 Mar 2008 16:24:39 + > > -- Original message -- > From

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 + > > > > > --

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? > > -- >

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? > > -- >

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:

Re: [SQL] Dropping Functions

2008-03-26 Thread Adrian Klaver
Can you show the error 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] Problem with now() in function pgsql

2008-04-05 Thread Adrian Klaver
ou found out now() fixes the time at the start of the transaction and does not change, clock_timestamp() does. See URL below for a more complete explanation: http://www.postgresql.org/docs/8.2/interactive/functions-datetime.html -- Adrian Klaver [EMAIL PROTECTED] -- Sent via pgsql-sql mailing l

Re: [SQL] cross-database references are not implemented

2008-06-03 Thread Adrian Klaver
; > > > How can I solve this? > > > > Met vriendelijke groet, > > > > Paul Dam You will need to show the actual query, but I suspect you have an extra period in your table name. Instead of public.table_name you have something like public.table.name. -- Adrian Klav

Re: [SQL] Problem inserting data

2008-06-20 Thread Adrian Klaver
mplied for the int4,bool cast. See for more details: http://www.postgresql.org/docs/8.3/interactive/catalog-pg-cast.html -- 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] PL/pgSQL function syntax question?

2008-09-08 Thread Adrian Klaver
ERROR: loop variable of loop over rows must be record or row variable at or > near "loop" at character 195 > > ** Error ** > > ERROR: loop variable of loop over rows must be record or row variable at or > near "loop" > SQL state: 42601 > Char

Re: [SQL] Problem with delete trigger: how to allow only triggers to delete a row?

2008-10-10 Thread Adrian Klaver
ger examine the row to see if it meets the criteria for deletion. If it does RETURN a NON NULL value so the trigger completes, otherwise RETURN NULL to prevent the DELETE. -- 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] Problem with delete trigger: how to allow only triggers to delete a row?

2008-10-10 Thread Adrian Klaver
RETURN OLD; ELSIF current_user != 'privileged_user' AND old.deduced ='t' THEN RETURN NULL; ELSIF current_user = 'priviliged_user' THEN RETURN OLD END; $Body$ LANGUAGE plpgsql; -- 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] Problem with delete trigger: how to allow only triggers to delete a row?

2008-10-10 Thread Adrian Klaver
On Friday 10 October 2008 1:57:28 pm Adrian Klaver wrote: > On Friday 10 October 2008 11:25:05 am Christopher Maier wrote: > > On Oct 10, 2008, at 2:05 PM, Alvaro Herrera wrote: > > > Looks like you should revoke DELETE privilege from plain users, and > > > have your d

Re: [SQL] Order of trigger execution: AFTER DELETE ON EACH ROW doesn't appear to be working properly

2008-10-13 Thread Adrian Klaver
cause if > dependent rows are not deleted immediately after the row that supports > it, then I can get "orphaned" rows left in the table that have no > supporting rows. > > Thanks, > Chris > Is not possible to delete the dependent rows from within the BEFORE trigger

Re: [SQL] effectiveness tool

2008-10-14 Thread Adrian Klaver
somebody can help me > > Thanks in advanced!! Take a look at: http://www.postgresql.org/docs/8.3/interactive/sql-explain.html and: http://www.postgresql.org/docs/8.3/interactive/using-explain.html -- Adrian Klaver [EMAIL PROTECTED] -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.o

Re: [SQL] How to excute dynamically a generated SQL command?

2009-01-04 Thread Adrian Klaver
ghtmap.tif') > ^ > > I would appreciate a lot if you offer your input. Thanks a lot. > > John -- Adrian Klaver akla...@comcast.net -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Fwd: Re: [SQL] Creating a function with single quotes

2009-02-19 Thread Adrian Klaver
Oops, forgot to reply to list. -- Forwarded Message -- Subject: Re: [SQL] Creating a function with single quotes Date: Thursday 19 February 2009 From: Adrian Klaver To: stay...@washoecounty.us On Thursday 19 February 2009 7:41:11 am Shawn Tayler wrote: > Hello, > >

Fwd: Re: [SQL] Creating a function with single quotes

2009-02-20 Thread Adrian Klaver
Memo to self: Remember hit reply all. -- Forwarded Message -- Subject: Re: [SQL] Creating a function with single quotes Date: Friday 20 February 2009 From: Adrian Klaver To: "Leif B. Kristensen" On Friday 20 February 2009 6:13:03 am you wrote: > On Friday 20.

Re: [SQL] Creating a function with single quotes

2009-02-20 Thread Adrian Klaver
On Friday 20 February 2009 6:29:43 am Leif B. Kristensen wrote: > On Friday 20. February 2009, Adrian Klaver wrote: > >Actually you need both semicolons. One after the RETURN statement and > > one after the END statement > >See below for full details: > >http://

Re: [SQL] FUNCTION problem

2009-04-01 Thread Adrian Klaver
st_function" line 5 at SQL statement You have declared function to RETURN SETOF. In order for that to work you need to do RETURN NEXT. See below for difference between RETURN and RETURN NEXT: http://www.postgresql.org/docs/8.3/interactive/plpgsql-control-structures.html#PLPGSQL-CONTROL-STRUCTU

Re: [SQL] FUNCTION problem

2009-04-02 Thread Adrian Klaver
- "Peter Willis" wrote: > Adrian Klaver wrote: > > On Wednesday 01 April 2009 4:31:20 pm Peter Willis wrote: > >> Hello, > >> > >> I am having a problem with a FUNCTION. > >> The function creates just fine with no errors. > >

Re: [SQL] FUNCTION problem

2009-04-02 Thread Adrian Klaver
On Thursday 02 April 2009 4:22:06 pm Peter Willis wrote: > Adrian Klaver wrote: > > Did you happen to catch this: > > Note that functions using RETURN NEXT or RETURN QUERY must be called as a > > table source in a FROM clause > > > > Try: > > select * from te

Re: [SQL] Text cast problem

2009-04-03 Thread Adrian Klaver
is put a trigger on the table that trims the strings on INSERT or UPDATE. > > > > Volkmar -- Adrian Klaver akla...@comcast.net -- 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] FUNCTION problem

2009-04-03 Thread Adrian Klaver
On Thursday 02 April 2009 6:16:44 pm Adrian Klaver wrote: > > > Now I remember. Its something that trips me up, the RECORD in RETURN setof > RECORD is not the same thing as the RECORD in DECLARE RECORD. See below for > a better explanation- > http://www.postgresql.org/docs/8.3/i

Re: [SQL] FUNCTION problem

2009-04-03 Thread Adrian Klaver
On Friday 03 April 2009 6:51:05 am Adrian Klaver wrote: > On Thursday 02 April 2009 6:16:44 pm Adrian Klaver wrote: > > Now I remember. Its something that trips me up, the RECORD in RETURN > > setof RECORD is not the same thing as the RECORD in DECLARE RECORD. See > &g

Re: [SQL] FUNCTION problem

2009-04-03 Thread Adrian Klaver
- "Peter Willis" wrote: > Adrian Klaver wrote: > > On Friday 03 April 2009 6:51:05 am Adrian Klaver wrote: > >> On Thursday 02 April 2009 6:16:44 pm Adrian Klaver wrote: > >>> Now I remember. Its something that trips me up, the RECORD in > RETURN

Re: [SQL] Need help combining 2 tables together

2009-05-22 Thread Adrian Klaver
id | topic | message +--+-- 1 | My favorite food | I like lasagna! 2 | My favorite food | Pizza is also a favorite 3 | Are squares better then circles?

<    1   2