pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedSELECTing from a function where i don't want the results
16+ messages / 8 participants
[nested] [flat]
* SELECTing from a function where i don't want the results
@ 2020-07-07 22:34 Wells Oliver <wells.oliver@gmail.com>
2020-07-07 22:38 ` Re: SELECTing from a function where i don't want the results Holger Jakobs <holger@jakobs.com>
2020-07-08 00:18 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 12:52 ` Re: SELECTing from a function where i don't want the results hubert depesz lubaczewski <depesz@depesz.com>
0 siblings, 3 replies; 16+ messages in thread
From: Wells Oliver @ 2020-07-07 22:34 UTC (permalink / raw)
To: pgsql-admin
Vanilla SQL script calls a plpgsql function to delete some number of rows
from three tables:
SELECT mydelete(r) FROM sometable;
Where sometable contains maybe 100+ records. This causes the results from
the function (integer of number of rows removed) to be displayed in the
output, like you'd kinda expect with a SELECT call, except I don't want to
see it all, I just want the function quietly executed and rows removed.
Can I accomplish this?
--
Wells Oliver
wells.oliver@gmail.com <wellsoliver@gmail.com>
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
@ 2020-07-07 22:38 ` Holger Jakobs <holger@jakobs.com>
2020-07-08 00:07 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
2 siblings, 1 reply; 16+ messages in thread
From: Holger Jakobs @ 2020-07-07 22:38 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
You could combine the result with a NULL value, as any operations with
NULL result in NULL.
SELECT mydelete(r) + NULL FROM sometable;
Am 08.07.20 um 00:34 schrieb Wells Oliver:
> Vanilla SQL script calls a plpgsql function to delete some number of
> rows from three tables:
>
> SELECT mydelete(r) FROM sometable;
>
> Where sometable contains maybe 100+ records. This causes the results
> from the function (integer of number of rows removed) to be displayed
> in the output, like you'd kinda expect with a SELECT call, except I
> don't want to see it all, I just want the function quietly executed
> and rows removed.
>
> Can I accomplish this?
>
> --
> Wells Oliver
> wells.oliver@gmail.com <mailto:wellsoliver@gmail.com>
--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-07 22:38 ` Re: SELECTing from a function where i don't want the results Holger Jakobs <holger@jakobs.com>
@ 2020-07-08 00:07 ` David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 00:10 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: David G. Johnston @ 2020-07-08 00:07 UTC (permalink / raw)
To: Holger Jakobs <holger@jakobs.com>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
On Tuesday, July 7, 2020, Holger Jakobs <holger@jakobs.com> wrote:
> You could combine the result with a NULL value, as any operations with
> NULL result in NULL.
>
> SELECT mydelete(r) + NULL FROM sometable;
>
So now you have 100 rows containing null (assuming that indeed function
result + unknown means something and you don’t just get an error) which is
no better than what is the probably 100 rows of void output the OP is
complaining about.
David J.
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-07 22:38 ` Re: SELECTing from a function where i don't want the results Holger Jakobs <holger@jakobs.com>
2020-07-08 00:07 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
@ 2020-07-08 00:10 ` Wells Oliver <wells.oliver@gmail.com>
0 siblings, 0 replies; 16+ messages in thread
From: Wells Oliver @ 2020-07-08 00:10 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Holger Jakobs <holger@jakobs.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Yeah. I just kinda want a silent SELECT since the function I'm calling just
deletes, and I don't care about the output.
I'm guessing this is just something I need to get over.
On Tue, Jul 7, 2020 at 5:07 PM David G. Johnston <david.g.johnston@gmail.com>
wrote:
> On Tuesday, July 7, 2020, Holger Jakobs <holger@jakobs.com> wrote:
>
>> You could combine the result with a NULL value, as any operations with
>> NULL result in NULL.
>>
>> SELECT mydelete(r) + NULL FROM sometable;
>>
> So now you have 100 rows containing null (assuming that indeed function
> result + unknown means something and you don’t just get an error) which is
> no better than what is the probably 100 rows of void output the OP is
> complaining about.
>
> David J.
>
>
--
Wells Oliver
wells.oliver@gmail.com <wellsoliver@gmail.com>
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
@ 2020-07-08 00:18 ` David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 00:21 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2 siblings, 1 reply; 16+ messages in thread
From: David G. Johnston @ 2020-07-08 00:18 UTC (permalink / raw)
To: Wells Oliver <wells.oliver@gmail.com>; +Cc: pgsql-admin
On Tuesday, July 7, 2020, Wells Oliver <wells.oliver@gmail.com> wrote:
> Vanilla SQL script calls a plpgsql function to delete some number of rows
> from three tables:
>
> SELECT mydelete(r) FROM sometable;
>
> Where sometable contains maybe 100+ records. This causes the results from
> the function (integer of number of rows removed) to be displayed in the
> output, like you'd kinda expect with a SELECT call, except I don't want to
> see it all, I just want the function quietly executed and rows removed.
>
> Can I accomplish this?
>
>
Pure SQL, no, you cannot just ignore the output. You can perform
post-processing (via CTE/WITH) to reduce how much is printed (aggregates).
If you are using psql you can send it to /dev/null. You could use a DO
block and (kinda) ignore the result (SQL) and/or stick it into a throw-away
variable (plpgsql).
David J.
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:18 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
@ 2020-07-08 00:21 ` Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:45 ` Re: SELECTing from a function where i don't want the results Ron <ronljohnsonjr@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: Wells Oliver @ 2020-07-08 00:21 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: pgsql-admin
ha, the CTE approach to only get one line of output versus however many
hundreds of rows were used for the delete is perfect. Thanks.
On Tue, Jul 7, 2020 at 5:18 PM David G. Johnston <david.g.johnston@gmail.com>
wrote:
> On Tuesday, July 7, 2020, Wells Oliver <wells.oliver@gmail.com> wrote:
>
>> Vanilla SQL script calls a plpgsql function to delete some number of rows
>> from three tables:
>>
>> SELECT mydelete(r) FROM sometable;
>>
>> Where sometable contains maybe 100+ records. This causes the results from
>> the function (integer of number of rows removed) to be displayed in the
>> output, like you'd kinda expect with a SELECT call, except I don't want to
>> see it all, I just want the function quietly executed and rows removed.
>>
>> Can I accomplish this?
>>
>>
> Pure SQL, no, you cannot just ignore the output. You can perform
> post-processing (via CTE/WITH) to reduce how much is printed (aggregates).
> If you are using psql you can send it to /dev/null. You could use a DO
> block and (kinda) ignore the result (SQL) and/or stick it into a throw-away
> variable (plpgsql).
>
> David J.
>
>
--
Wells Oliver
wells.oliver@gmail.com <wellsoliver@gmail.com>
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:18 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 00:21 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
@ 2020-07-08 00:45 ` Ron <ronljohnsonjr@gmail.com>
2020-07-08 00:48 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
0 siblings, 1 reply; 16+ messages in thread
From: Ron @ 2020-07-08 00:45 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
Your original question says that the function returns the number of rows
deleted. That's one line. Now you're saying that it returns one row per
table-row deleted. Which is it?
On 7/7/20 7:21 PM, Wells Oliver wrote:
> ha, the CTE approach to only get one line of output versus however many
> hundreds of rows were used for the delete is perfect. Thanks.
>
> On Tue, Jul 7, 2020 at 5:18 PM David G. Johnston
> <david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com>> wrote:
>
> On Tuesday, July 7, 2020, Wells Oliver <wells.oliver@gmail.com
> <mailto:wells.oliver@gmail.com>> wrote:
>
> Vanilla SQL script calls a plpgsql function to delete some number
> of rows from three tables:
>
> SELECT mydelete(r) FROM sometable;
>
> Where sometable contains maybe 100+ records. This causes the
> results from the function (integer of number of rows removed) to
> be displayed in the output, like you'd kinda expect with a SELECT
> call, except I don't want to see it all, I just want the function
> quietly executed and rows removed.
>
> Can I accomplish this?
>
>
> Pure SQL, no, you cannot just ignore the output. You can perform
> post-processing (via CTE/WITH) to reduce how much is printed
> (aggregates). If you are using psql you can send it to /dev/null. You
> could use a DO block and (kinda) ignore the result (SQL) and/or stick
> it into a throw-away variable (plpgsql).
>
> David J.
>
>
>
> --
> Wells Oliver
> wells.oliver@gmail.com <mailto:wellsoliver@gmail.com>
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:18 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 00:21 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:45 ` Re: SELECTing from a function where i don't want the results Ron <ronljohnsonjr@gmail.com>
@ 2020-07-08 00:48 ` Wells Oliver <wells.oliver@gmail.com>
2020-07-08 01:06 ` Re: SELECTing from a function where i don't want the results Scott Ribe <scott_ribe@elevated-dev.com>
0 siblings, 1 reply; 16+ messages in thread
From: Wells Oliver @ 2020-07-08 00:48 UTC (permalink / raw)
To: Ron <ronljohnsonjr@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org
Yes: it returns one row per record for deletion with a deleted row count,
and is called for hundreds (sometimes thousands) of records.
On Tue, Jul 7, 2020 at 5:45 PM Ron <ronljohnsonjr@gmail.com> wrote:
> Your original question says that the function returns the number of rows
> deleted. That's one line. Now you're saying that it returns one row per
> table-row deleted. Which is it?
>
> On 7/7/20 7:21 PM, Wells Oliver wrote:
>
> ha, the CTE approach to only get one line of output versus however many
> hundreds of rows were used for the delete is perfect. Thanks.
>
> On Tue, Jul 7, 2020 at 5:18 PM David G. Johnston <
> david.g.johnston@gmail.com> wrote:
>
>> On Tuesday, July 7, 2020, Wells Oliver <wells.oliver@gmail.com> wrote:
>>
>>> Vanilla SQL script calls a plpgsql function to delete some number of
>>> rows from three tables:
>>>
>>> SELECT mydelete(r) FROM sometable;
>>>
>>> Where sometable contains maybe 100+ records. This causes the results
>>> from the function (integer of number of rows removed) to be displayed in
>>> the output, like you'd kinda expect with a SELECT call, except I don't want
>>> to see it all, I just want the function quietly executed and rows removed.
>>>
>>> Can I accomplish this?
>>>
>>>
>> Pure SQL, no, you cannot just ignore the output. You can perform
>> post-processing (via CTE/WITH) to reduce how much is printed (aggregates).
>> If you are using psql you can send it to /dev/null. You could use a DO
>> block and (kinda) ignore the result (SQL) and/or stick it into a throw-away
>> variable (plpgsql).
>>
>> David J.
>>
>>
>
> --
> Wells Oliver
> wells.oliver@gmail.com <wellsoliver@gmail.com>
>
>
> --
> Angular momentum makes the world go 'round.
>
--
Wells Oliver
wells.oliver@gmail.com <wellsoliver@gmail.com>
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:18 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 00:21 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:45 ` Re: SELECTing from a function where i don't want the results Ron <ronljohnsonjr@gmail.com>
2020-07-08 00:48 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
@ 2020-07-08 01:06 ` Scott Ribe <scott_ribe@elevated-dev.com>
2020-07-08 01:14 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 01:23 ` Re: SELECTing from a function where i don't want the results Ron <ronljohnsonjr@gmail.com>
0 siblings, 2 replies; 16+ messages in thread
From: Scott Ribe @ 2020-07-08 01:06 UTC (permalink / raw)
To: Wells Oliver <wells.oliver@gmail.com>; +Cc: Ron <ronljohnsonjr@gmail.com>; pgsql-admin@lists.postgresql.org
> On Jul 7, 2020, at 6:48 PM, Wells Oliver <wells.oliver@gmail.com> wrote:
>
> Yes: it returns one row per record for deletion with a deleted row count, and is called for hundreds (sometimes thousands) of records.
Why not write a function that works the way you want?
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:18 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 00:21 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:45 ` Re: SELECTing from a function where i don't want the results Ron <ronljohnsonjr@gmail.com>
2020-07-08 00:48 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 01:06 ` Re: SELECTing from a function where i don't want the results Scott Ribe <scott_ribe@elevated-dev.com>
@ 2020-07-08 01:14 ` Wells Oliver <wells.oliver@gmail.com>
2020-07-08 01:24 ` Re: SELECTing from a function where i don't want the results Scott Ribe <scott_ribe@elevated-dev.com>
1 sibling, 1 reply; 16+ messages in thread
From: Wells Oliver @ 2020-07-08 01:14 UTC (permalink / raw)
To: Scott Ribe <scott_ribe@elevated-dev.com>; +Cc: Ron <ronljohnsonjr@gmail.com>; pgsql-admin@lists.postgresql.org
Sorry guys, it works exactly the way I want, just wanted to suppress its
output when called for thousands of rows. Apologies if I wasn't clear
enough.
On Tue, Jul 7, 2020 at 6:07 PM Scott Ribe <scott_ribe@elevated-dev.com>
wrote:
> > On Jul 7, 2020, at 6:48 PM, Wells Oliver <wells.oliver@gmail.com> wrote:
> >
> > Yes: it returns one row per record for deletion with a deleted row
> count, and is called for hundreds (sometimes thousands) of records.
>
> Why not write a function that works the way you want?
--
Wells Oliver
wells.oliver@gmail.com <wellsoliver@gmail.com>
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:18 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 00:21 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:45 ` Re: SELECTing from a function where i don't want the results Ron <ronljohnsonjr@gmail.com>
2020-07-08 00:48 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 01:06 ` Re: SELECTing from a function where i don't want the results Scott Ribe <scott_ribe@elevated-dev.com>
2020-07-08 01:14 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
@ 2020-07-08 01:24 ` Scott Ribe <scott_ribe@elevated-dev.com>
2020-07-08 01:28 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 01:30 ` Re: SELECTing from a function where i don't want the results Jim Gmail <jimbog599@gmail.com>
0 siblings, 2 replies; 16+ messages in thread
From: Scott Ribe @ 2020-07-08 01:24 UTC (permalink / raw)
To: Wells Oliver <wells.oliver@gmail.com>; +Cc: Ron <ronljohnsonjr@gmail.com>; pgsql-admin@lists.postgresql.org
> On Jul 7, 2020, at 7:14 PM, Wells Oliver <wells.oliver@gmail.com> wrote:
>
> Sorry guys, it works exactly the way I want, just wanted to suppress its output when called for thousands of rows. Apologies if I wasn't clear enough.
It seems that it doesn't work the way you want, because it can output thousands of rows ;-)
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:18 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 00:21 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:45 ` Re: SELECTing from a function where i don't want the results Ron <ronljohnsonjr@gmail.com>
2020-07-08 00:48 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 01:06 ` Re: SELECTing from a function where i don't want the results Scott Ribe <scott_ribe@elevated-dev.com>
2020-07-08 01:14 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 01:24 ` Re: SELECTing from a function where i don't want the results Scott Ribe <scott_ribe@elevated-dev.com>
@ 2020-07-08 01:28 ` David G. Johnston <david.g.johnston@gmail.com>
1 sibling, 0 replies; 16+ messages in thread
From: David G. Johnston @ 2020-07-08 01:28 UTC (permalink / raw)
To: Scott Ribe <scott_ribe@elevated-dev.com>; +Cc: Wells Oliver <wells.oliver@gmail.com>; Ron <ronljohnsonjr@gmail.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
On Tuesday, July 7, 2020, Scott Ribe <scott_ribe@elevated-dev.com> wrote:
> > On Jul 7, 2020, at 7:14 PM, Wells Oliver <wells.oliver@gmail.com> wrote:
> >
> > Sorry guys, it works exactly the way I want, just wanted to suppress its
> output when called for thousands of rows. Apologies if I wasn't clear
> enough.
>
> It seems that it doesn't work the way you want, because it can output
> thousands of rows ;-)
>
You all may want to re-read the original post before commenting further.
I’m finding nothing particularly unusual about this setup. Sure, multiple
delete using commands or cascade delete may be a bit more performant if the
api described in the OP is sufficiently fast it is definitely the easiest
to program against.
David J.
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:18 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 00:21 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:45 ` Re: SELECTing from a function where i don't want the results Ron <ronljohnsonjr@gmail.com>
2020-07-08 00:48 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 01:06 ` Re: SELECTing from a function where i don't want the results Scott Ribe <scott_ribe@elevated-dev.com>
2020-07-08 01:14 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 01:24 ` Re: SELECTing from a function where i don't want the results Scott Ribe <scott_ribe@elevated-dev.com>
@ 2020-07-08 01:30 ` Jim Gmail <jimbog599@gmail.com>
1 sibling, 0 replies; 16+ messages in thread
From: Jim Gmail @ 2020-07-08 01:30 UTC (permalink / raw)
To: Scott Ribe <scott_ribe@elevated-dev.com>; +Cc: Wells Oliver <wells.oliver@gmail.com>; Ron <ronljohnsonjr@gmail.com>; pgsql-admin@lists.postgresql.org
Perhaps the OP could supply the function definition to make things clearer.
Sent from my iPhone
On 8 Jul 2020, at 11:24, Scott Ribe <scott_ribe@elevated-dev.com> wrote:
>> On Jul 7, 2020, at 7:14 PM, Wells Oliver <wells.oliver@gmail.com> wrote:
>>
>> Sorry guys, it works exactly the way I want, just wanted to suppress its output when called for thousands of rows. Apologies if I wasn't clear enough.
>
> It seems that it doesn't work the way you want, because it can output thousands of rows ;-)
>
>
>
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:18 ` Re: SELECTing from a function where i don't want the results David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 00:21 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:45 ` Re: SELECTing from a function where i don't want the results Ron <ronljohnsonjr@gmail.com>
2020-07-08 00:48 ` Re: SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 01:06 ` Re: SELECTing from a function where i don't want the results Scott Ribe <scott_ribe@elevated-dev.com>
@ 2020-07-08 01:23 ` Ron <ronljohnsonjr@gmail.com>
1 sibling, 0 replies; 16+ messages in thread
From: Ron @ 2020-07-08 01:23 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
Especially since deleting one row at a time is very slow.
On 7/7/20 8:06 PM, Scott Ribe wrote:
>> On Jul 7, 2020, at 6:48 PM, Wells Oliver <wells.oliver@gmail.com> wrote:
>>
>> Yes: it returns one row per record for deletion with a deleted row count, and is called for hundreds (sometimes thousands) of records.
> Why not write a function that works the way you want?
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 16+ messages in thread
* Re: SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
@ 2020-07-08 12:52 ` hubert depesz lubaczewski <depesz@depesz.com>
2020-07-08 13:49 ` SELECTing from a function where i don't want the results Marlene Villanueva <villanuevamarlene906@gmail.com>
2 siblings, 1 reply; 16+ messages in thread
From: hubert depesz lubaczewski @ 2020-07-08 12:52 UTC (permalink / raw)
To: Wells Oliver <wells.oliver@gmail.com>; +Cc: pgsql-admin
On Tue, Jul 07, 2020 at 03:34:31PM -0700, Wells Oliver wrote:
> Vanilla SQL script calls a plpgsql function to delete some number of rows
> from three tables:
>
> SELECT mydelete(r) FROM sometable;
select count( mydelete(r) ) from sometable;
this will return just one row regardless of how many rows are in
sometable.
Best regards,
depesz
^ permalink raw reply [nested|flat] 16+ messages in thread
* SELECTing from a function where i don't want the results
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-08 12:52 ` Re: SELECTing from a function where i don't want the results hubert depesz lubaczewski <depesz@depesz.com>
@ 2020-07-08 13:49 ` Marlene Villanueva <villanuevamarlene906@gmail.com>
0 siblings, 0 replies; 16+ messages in thread
From: Marlene Villanueva @ 2020-07-08 13:49 UTC (permalink / raw)
To: depesz@depesz.com; +Cc: Wells Oliver <wells.oliver@gmail.com>; pgsql-admin
Please send me a link to my actual open bank account.
Get BlueMail for Android
^ permalink raw reply [nested|flat] 16+ messages in thread
end of thread, other threads:[~2020-07-08 13:49 UTC | newest]
Thread overview: 16+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07 22:34 SELECTing from a function where i don't want the results Wells Oliver <wells.oliver@gmail.com>
2020-07-07 22:38 ` Holger Jakobs <holger@jakobs.com>
2020-07-08 00:07 ` David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 00:10 ` Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:18 ` David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 00:21 ` Wells Oliver <wells.oliver@gmail.com>
2020-07-08 00:45 ` Ron <ronljohnsonjr@gmail.com>
2020-07-08 00:48 ` Wells Oliver <wells.oliver@gmail.com>
2020-07-08 01:06 ` Scott Ribe <scott_ribe@elevated-dev.com>
2020-07-08 01:14 ` Wells Oliver <wells.oliver@gmail.com>
2020-07-08 01:24 ` Scott Ribe <scott_ribe@elevated-dev.com>
2020-07-08 01:28 ` David G. Johnston <david.g.johnston@gmail.com>
2020-07-08 01:30 ` Jim Gmail <jimbog599@gmail.com>
2020-07-08 01:23 ` Ron <ronljohnsonjr@gmail.com>
2020-07-08 12:52 ` hubert depesz lubaczewski <depesz@depesz.com>
2020-07-08 13:49 ` Marlene Villanueva <villanuevamarlene906@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox