[SQL] triggers and plpgsql question

2002-08-27 Thread Mathieu Arnold
Hi I want to do a generic function that I can add to triggers to add every inserts, updates and deletes from many differents tables into a common format in another table. the idea is : create function do_it_all () returns opaque ' begin IF TG_OP = ''INSERT'' THEN cycle through all of NEW

[SQL] decode('hallo',???)

2002-08-27 Thread Fritz Lehmann-Grube
hallo somebody, what do the functions encode and decode expect as arguments ? I was puzzled when I got the following: pgdocsample=# \encoding SQL_ASCII pgdocsample=# select decode('hallo','SQL_ASCII'); ERROR: No such encoding as 'SQL_ASCII' What have I understood wrong ? Fritz

Re: [SQL] decode('hallo',???)

2002-08-27 Thread Bruce Momjian
Fritz Lehmann-Grube wrote: hallo somebody, what do the functions encode and decode expect as arguments ? test= \df decode List of functions Result data type | Schema | Name | Argument data types

Re: [SQL] LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?

2002-08-27 Thread Bruce Momjian
OK, no one has commented on this, so I guess I am going to have to guess the group's preference. My guess, seeing as very few probably use LIMIT and FOR UPDATE together, is to swap them and document it in the release notes. Was I correct in my guess?

[SQL] IDENT authentication problem

2002-08-27 Thread Wei Weng
This is what I did: 1: I reinstalled postgresql RPMs from scratch (I removed all the logs, data files, backup files) 2: su root 3: su postgres 4: psql template1 And here I got the error message: psql: FATAL 1: IDENT authentication failed for user foobar User foobar was an old user I

Re: [SQL] LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?

2002-08-27 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: My guess, seeing as very few probably use LIMIT and FOR UPDATE together, is to swap them and document it in the release notes. That will surely piss someone off. Can't you try a little harder to support either order? regards,

Re: [SQL] LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?

2002-08-27 Thread Larry Rosenman
On Tue, 2002-08-27 at 17:07, Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: My guess, seeing as very few probably use LIMIT and FOR UPDATE together, is to swap them and document it in the release notes. That will surely piss someone off. Can't you try a little harder to support

Re: [SQL] IDENT authentication problem

2002-08-27 Thread Tom Lane
Wei Weng [EMAIL PROTECTED] writes: What could have gone wrong? I must have left the trace of user foobar somewhere in my system but I couldn't find it. PGUSER environment variable? regards, tom lane ---(end of

Re: [SQL] triggers and plpgsql question

2002-08-27 Thread Josh Berkus
Mathieu, The thing I need, is to be able to know what does NEW contains, and I have not found out any mean to do so. If it's not possible to do so, I'll write a function per table, but for the beauty of all this, I would have liked to do it the way above. You can't do this in PL/pgSQL.

Re: [SQL] Problems with version 7.1, could they be fixed in 7.2?

2002-08-27 Thread Ligia Pimentel
Yes we did. By the way, how often is it recomended? Ligia mark carew [EMAIL PROTECTED] wrote in message akgr6p$vp2$[EMAIL PROTECTED]">news:akgr6p$vp2$[EMAIL PROTECTED]... Hi Ligia, Are you running VACUUM ANALYSE or is it VACUUM ANALYZE (can never remember, though reasonably sure that its

Re: [SQL] LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?

2002-08-27 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: My guess, seeing as very few probably use LIMIT and FOR UPDATE together, is to swap them and document it in the release notes. That will surely piss someone off. Can't you try a little harder to support either order? Sure. I just

Re: [SQL] LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?

2002-08-27 Thread Christopher Kings-Lynne
OK, no one has commented on this, so I guess I am going to have to guess the group's preference. My guess, seeing as very few probably use LIMIT and FOR UPDATE together, is to swap them and document it in the release notes. Was I correct in my guess? I'm sure very few people do it - but

[SQL] Calculation Error on Epoch?

2002-08-27 Thread Josh Berkus
Folks, I'm having a problem with: SELECT date_part('epoch','2002-08-28'::TIMESTAMP) Which is consistently returning an epoch timestamp that evaluates to 8.27.2002. Is this a known issue? A cross-platform problem? Suggestions? -Josh Berkus ---(end of

Re: [SQL] Calculation Error on Epoch?

2002-08-27 Thread Tom Lane
Josh Berkus [EMAIL PROTECTED] writes: I'm having a problem with: SELECT date_part('epoch','2002-08-28'::TIMESTAMP) Which is consistently returning an epoch timestamp that evaluates to 8.27.2002. Is this a known issue? A cross-platform problem? In 7.2 I get: regression=# SELECT