On Tue, Mar 06, 2001 at 09:22:25AM -0800, Josh Berkus wrote:
> Karel,
>
> > The 'interval' version of to_char() isn't implemented -- may be in 7.2
> > (it's high in my TODO list:-)
>
> Grazie. (One of the things I love about PostgreSQL is being able to
> get definitive answers on functio
From: "Jens Hartwig" <[EMAIL PROTECTED]>
> Hello Richard,
>
> this was a very precise analysis - thanks for the effort you made!
Precisely wrong in this case. My mistakes have some of the finest tolerances
in the world. 8-)
> Nevertheless the Tom's explanation of the behaviour in case of views
When I did the same task - I've writting a script on the perl, and if you
have stable databese structure, I think, it's a best way - write a script
which will run by cron /on-demand. Because, I don't remember exactly why
(date format is different or something else) but, I couldn't move data
from M
On Mon, Mar 05, 2001 at 02:12:15PM -0500, Jelle Ouwerkerk wrote:
> Hi
>
> What would be the best way to select a random row from a result set?
>
> Possibilities:
>
> 1) o get the total number of rows using count()
>o generate a random number between 1 and the total
>o select the n'th ro
On Wed, Mar 07, 2001 at 12:50:36PM +0100, Tomek Zielonka wrote:
> On Mon, Mar 05, 2001 at 02:12:15PM -0500, Jelle Ouwerkerk wrote:
> > Hi
> >
> > What would be the best way to select a random row from a result set?
> >
>
> Here's my approach. It allows to get random row from the table, not from
Hello!
It is possible to pass ie. insert fields and values to sql function in
trigger? I want to define a trigger on insert (select delete etc.) and log
some values in different table(s).
--
"Code reviews are like sex, just anyone can do it, but skill and training can
make you a lot better a
On Wed, Mar 07, 2001 at 03:03:59PM +0100, Andrzej Roszkowski wrote:
> Hello!
>
> It is possible to pass ie. insert fields and values to sql function in
> trigger? I want to define a trigger on insert (select delete etc.) and log
> some values in different table(s).
Sure, see docs about SPI in
Thomas, Karel,
> I agree with Karel's point that it may be a pain to use a procedural
> language to manipulate a "stringy" interval value. If you use a C
> function instead, you can get access to the internal manipulation
> functions already present, as well as access to system functions to
> ma
"Jens Hartwig" <[EMAIL PROTECTED]> writes:
> What would have happened, if I executed an unconditional DELETE?
> => DELETE FROM t_xyz;
> Which statement would have been generated by PostgreSQL in this case?
Unfortunately, I didn't keep the prior discussion, so I don't remember
exactly what the r
Hannu Krosing <[EMAIL PROTECTED]> writes:
> Boulat Khakimov wrote:
>> ERROR: Can't find function encrypt in file /[full path here]/encrypt.so
> Can _postgres_ user read /[full path here]/encrypt.so ?
Presumably so. If he were unable to load the .so file, he'd be getting
a different error mess
> [...]
> So - if you issue "DELETE FROM t_xyz" you'd want two things to happen:
>
> 1. where deleted is false set it to true
> 2. where deleted was true delete the record
>
> So - PG rewrites the query into two parts:
>
> DELETE FROM t_xyz WHERE old.deleted=false
> DELETE FROM t_xyz WHERE NOT(old
Hi,
What system table hold info of user defined function??
Acturally , I want to know how to retrive the defination of a function
from its name.
Thankes.
Jie LIANG
St. Bernard Software
10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873
[EMAIL PROTECTED]
www.st
> I'll take a stab at in in PLPGSQL and post the results.
OK. date_part() is your friend ;)
- Thomas
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL
I created a sample function:
CREATE FUNCTION concat_text (text, text) RETURNS text AS '
BEGIN
RETURN $1 || $2;
END; '
LANGUAGE 'plpgsql';
The creation was fine. But when I execute the function with : select
concat('a', 'b');
I get the error:
NOTICE: plpgsql: ERROR during compile of conc
Hello,
I have a problem with a sql query.I have two tables
: the first contains categories and the second subcategories.
What kind of select may I use to get something like
Yahoo! categories ( each "main" category gets *at most* three
sub-categories..
Thanks
Regards,
Rachel
> "bk" == Boulat Khakimov <[EMAIL PROTECTED]> writes:
bk> How do I grant permissions on everything in the selected
bk> databes?
bk> GRANT doesnt take as on object database name nor does it
bk> accept wild chars
Attached is some Perl code I wrote long ago to do this. Thi
Author: Rachel Coin <[EMAIL PROTECTED]>
I have a problem with a sql query.I have two tables : the first contains
categories and the second subcategories.
What kind of select may I use to get something like Yahoo! categories (
each "main" category gets *at most* three sub-categories..
Do yo
On 3/6/01, 5:55:05 AM, John GM <[EMAIL PROTECTED]> wrote regarding [SQL] Newbie:
execute function error!:
> I created a sample function:
> CREATE FUNCTION concat_text (text, text) RETURNS text AS '
> BEGIN
> RETURN $1 || $2;
> END; '
> LANGUAGE 'plpgsql';
> The creation was fine. But whe
Hi all, I just want to know how to put quotes around a string. Is there a
function to do so?
If not how can I escape a single quote.
Thank you in advance.
begin:vcard
n:Hashmi;Najm
x-mozilla-html:FALSE
org:Mondo-Live.com;www.flipr.com
adr:;;
version:2.1
email;internet:[EMAIL PROTECTED]
x-m
Here's a query that doesn't work on 7.1. Is this a bug or am I doing
something wrong?
The last two selects yield:
ERROR: Sub-SELECT uses un-GROUPed attribute m1.ropnum from outer
query
Basically, everything works until I apply the avg() function and try
to aggregate the results.
drop table mt
Najm Hashmi wrote:
>
> Hi all, I just want to know how to put quotes around a string. Is there a
> function to do so?
> If not how can I escape a single quote.
> Thank you in advance.
>
>
>
> ---
Kyle <[EMAIL PROTECTED]> writes:
> Here's a query that doesn't work on 7.1. Is this a bug or am I doing
> something wrong?
Hmm, I think you have found some subtle bugs in aggregate processing;
offhand it seems like both these queries should be legal. I'll see what
I can do about it.
Hi Najm,
Is this what you mean?
CREATE FUNCTION foobar(int4) returns int4
as 'DECLARE
textbuf varchar(120);
BEGIN
textbuf := ''Example Text '';
insert into sometable (something) values (textbuf);
RETURN 0;
END;'
LANGUAGE 'plpgsql';
Najm Hashmi wrote:
>
> Hi all, I
On Thu, Mar 08, 2001 at 05:54:38PM -0500, Najm Hashmi wrote:
> Hi all, I just want to know how to put quotes around a string. Is there a
> function to do so?
> If not how can I escape a single quote.
Others have answered how to quote a single string. I wrote an entire
section on quotes o
>> Here's a query that doesn't work on 7.1. Is this a bug or am I doing
>> something wrong?
> Hmm, I think you have found some subtle bugs in aggregate processing;
> offhand it seems like both these queries should be legal. I'll see what
> I can do about it.
Not so subtle after all :-(. Curio
I have 2 plpgsql defined functions, say:
create function A() returns ... as'
.
'language 'plpgsql';
create function B() returns ... as '
declare
begin
select A(..) into myvar from
end;
'language 'plpgsql';
If I modify function A (drop && re_create), then I have t
DELPHI can't use TABLE component
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
chris=# select *, array_element_count(pupils_on_leave) as
number_awol_pupils from absence ;
date | lesson_number | pupils_on_leave | pupils_awol
| number_awol_pupils
+---+-+---+
2001-03-08 0
> > Given the lack of to_char(interval), I'd like to write a PLPGSQL
> > function to fill the gap in the meantime...
> I mean is too much difficult write a 'interval' to_char() version in
> some procedural language without access to real (internal) form of
> 'interval'.
I agree with Karel
29 matches
Mail list logo