Save "Nursing on Shabbos
"
Nursing on Shabbos
If she is in pain due to engorgement, she may pump on Shabbos as long as it goes to waste. Doing so is only a “Melacha she’Eina Tzricha leGufa”, as the milk is being extracted to alleviate her discomfort and not to make use of the milk. A Melacha she’Eina Tzricha leGufa is permitted in cases of discomfort.

(ח) נולד לח' או ספק בן ז' בן ח' שלא גמרו שעריו וצפרניו אסור לטלטלו אבל אמו שוחה עליו ומניקתו מפני צער החלב שמצערה וכן היא בעצמה יכולה להוצי' בידה החלב המצער אותה:

(8) 8. If the infant was born after an eight-month pregnancy or after a pregnancy which may be either seven or eight months and he does not have grown hair or nails, it is forbidden to carry him. His mother leans over him and breastfeeds him because the milk pains her. She can also use her hand to release the milk that pains her.

(ז) הַדָּשׁ כִּגְרוֹגֶרֶת חַיָּב וְאֵין דִּישָׁה אֶלָּא בְּגִדּוּלֵי קַרְקַע. וְהַמְפָרֵק הֲרֵי הִיא תּוֹלֶדֶת הַדָּשׁ וְחַיָּב וְכֵן כָּל כַּיּוֹצֵא בָּזֶה. הַחוֹלֵב אֶת הַבְּהֵמָה חַיָּב מִשּׁוּם מְפָרֵק וְכֵן הַחוֹבֵל בְּחַי שֶׁיֵּשׁ לוֹ עוֹר חַיָּב מִשּׁוּם מְפָרֵק. וְהוּא שֶׁיִּהְיֶה צָרִיךְ לַדָּם שֶׁיֵּצֵא מִן הַחַבּוּרָה. אֲבָל אִם נִתְכַּוֵּן לְהַזִּיק בִּלְבַד פָּטוּר מִפְּנֵי שֶׁהוּא מְקַלְקֵל. וְאֵינוֹ חַיָּב עַד שֶׁיִּהְיֶה בַּדָּם אוֹ בַּחָלָב שֶׁהוֹצִיא כִּגְרוֹגֶרֶת:

(7) A person who threshes [an amount of grain the size of] a dried fig is liable. [The forbidden labor of] threshing applies only with regard to the earth's produce.27 is a derivative of threshing; [a person who performs this activity] is liable. The same applies in all similar situations.

Similarly, a person who milks an animal is liable for extracting food.29The Rambam's opinion is also accepted by Rashi (Shabbat 95a) and other authorities. Rabbenu Tam and other Rishonim agree that milking is forbidden according to Torah law, but consider it a derivative of other categories of labor. The Ramban (Shabbat 145) considers this merely a Rabbinic prohibition.
Note the Shulchan Aruch (Orach Chayim 305:20), which states that one may tell a gentile to milk an animal. This leniency is permitted because the animal will suffer pain if it is not milked. Other leniencies are also granted on the basis of the Rambam's statements in Halachah 10.

Tosefes Shabbos says that pumping breast milk, unlike milking an animal, is only an Issur d’Rabbanan as it is not the regular way of extracting breast milk (i.e. nursing). However, since many women pump nowadays, this is probably no longer the case. Regardless, the Sha’ar haTziyun dismisses his contention.

רַב נַחְמָן בַּר גּוּרְיָא אִיקְּלַע לִנְהַרְדָּעָא. בְּעוֹ מִינֵּיהּ: חוֹלֵב, מִשּׁוּם מַאי מִיחַיַּיב? אֲמַר לְהוּ: מִשּׁוּם חוֹלֵב. מְחַבֵּץ, מִשּׁוּם מַאי מִיחַיַּיב? אֲמַר לְהוּ: מִשּׁוּם מְחַבֵּץ. מְגַבֵּן, מִשּׁוּם מַאי חַיָּיב? אֲמַר לְהוּ: מִשּׁוּם מְגַבֵּן. אֲמַרוּ לֵיהּ: רַבָּךְ קָטֵיל קְנֵי בְּאַגְמָא הֲוָה. אֲתָא שְׁאֵיל בֵּי מִדְרְשָׁא. אֲמַרוּ לֵיהּ: חוֹלֵב חַיָּיב — מִשּׁוּם מְפָרֵק. מְחַבֵּץ חַיָּיב — מִשּׁוּם בּוֹרֵר, מְגַבֵּן חַיָּיב — מִשּׁוּם בּוֹנֶה.

The Gemara relates: Rav Naḥman bar Gurya happened to come to Neharde’a. The students asked him: For what prohibited labor is one who milks liable? He said to them: For milking. For what prohibited labor is one who sets milk to curdle liable? He said to them: For setting milk to curdle. For what is a person who makes cheese liable? He said to them: For making cheese. They said to him: Your teacher was a reed cutter in a swamp who did not know how to explain the mishna to his students. He came and asked those questions in the study hall. They said to him: One who milks is liable for performing the prohibited labor of extracting, which is a subcategory of threshing, on Shabbat. This is because when one extracts milk from a cow it is similar to the act of threshing, where one removes the desired content from its covering. One who sets milk is liable for the prohibited labor of selecting because part of the milk is separated and made into congealed milk. And one who makes cheese is liable for building because the cheese within the milk assumes a solid form, which is similar to the process of building.

(ד) המתכוין להוציא בפונדתו ופיה למעלה והוציא בפונדתו ופיה למטה בתוך פונדתו והוציא בין פונדתו לחלוקו [ובשפת חלוקו פטור] המתכוין להוציא בפונדתו ופיה למטה ר' יהודה מחייב אמר ר' יהודה אני [אומר] דבר אחד והן אומרים דבר א' אני אומר להם אי אתם מודים במתכוין להוציא לפניו ובא לו לאחריו שהוא פטור ואם נתכוין והוציא לאחריו שהוא חייב והם אמרו לי אי אתה מודה במוציא [באחר ידו ואחר רגלו] בפיו ובמרפקו שהוא פטור שלא הוציא כדרך המוציאים אני לא מצאתי תשובה לדבריהם והם לא מצאו תשובה לדברי.