The Senate came to the aid of unemployed oil and gas workers, sidestepped higher entrance fees for national parks and agreed to pay its postal bills yesterday as it approved a $3.9 billion wrap-up spending bill for the rest of fiscal 1986.

As the first major spending bill to go through Congress since the Gramm-Rudman-Hollings budget law took effect, the measure was notable both for offsetting cutbacks and its relative restraint in doling out new money, especially unusual conduct for an election year.

But the bill did contain some political favors, ranging from flood-control funds for West Virginia to citrus-canker control aid for Florida, and the Senate waived the new budget law constraints twice, dealing with unpopular Internal Revenue Service reporting provisions and the aid for jobless petroleum workers.

In all, the measure, passed 71 to 8, contains enough features that are objectionable to the White House to raise the possibility of a veto, despite the fact that it provides urgently needed funding for farming and other politically sensitive programs.

The White House has even more problems with a previously approved House version of the legislation. A House-Senate conference to iron out differences between the two versions, and possibly to reach accommodations with the White House, is expected to convene shortly.

The measure includes $660 million to improve security at U.S. embassies and $13 million for security at the Capitol, perhaps including a fence around the plaza. It also provides $100 million in economic aid and $50 million in military assistance for the Philippines, $526 million to repair the three grounded space shuttles and $1 million to restore evening and Sunday hours at the Library of Congress reading room.

After the Senate Thursday came to the rescue of the Midwest with rural electrification loan relief and the Pacific Northwest with a move to prevent sale of hydroelectric power-marketing authorities, it bowed toward the nation's oil patch, where several tight senatorial races are expected this fall.

The Senate approved trade adjustment assistance, normally associated with manufacturing jobs lost to low-cost industrial competition from abroad, for oil and gas workers threatened by chaos in the international oil markets. The cost was estimated at $44 million.

The action came as the government reported yesterday that the oil price slump has eliminated 100,000 jobs in the oil and gas fields this year.

In Louisiana, the civilian unemployment rate in May was 13.2 percent, up from 13.1 percent in April. Texas reported May unemployment at 9.6 percent, compared with 8.5 percent in April. Oklahoma's rate was 8.1 percent in April; the figure for May is scheduled for release next week.

Trade adjustment aid traditionally has been directed at parts of the Rust Belt, such as Michigan's auto industry. Yesterday, Michigan reported unemployment of 9.8 percent for May, up from 9.2 percent.

The Senate also approved a proposal by Sen. Pete Wilson (R-Calif.), who is on a crusade against costly congressional mailings, to force Congress to appropriate more funds for its postal costs if they exceed the appropriated levels.

Under a recent ruling by the comptroller general, whatever Congress appropriates for its mail has to be accepted as payment in full by the Postal Service, which is left holding the bag for any excess costs. But Wilson lost in an attempt to ban unsolicited congressional mailings, except those announcing meetings with constituents.

Sen. James A. McClure (R-Idaho) also lost in an attempt to raise entrance fees at national parks to help pay for additional employes to handle this summer's expected heavy load of visitors.

Opponents, led by Sen. Bill Bradley (D-N.J.), contended that Congress should finance any additional costs through appropriations rather than raising entrance fees. When Bradley won on a procedural point, McClure said icily, "When people can't get in to the parks , I hope they write him, not me."

Passage of the measure occurred at the end of the first week of live television broadcasts of Senate proceedings, which -- aside from a nattier senatorial attire, more speeches and fewer quorum calls and a somewhat less languid pace -- seemed to have less of a dramatic effect on the institution's behavior than many had expected.

As if to confound critics' suggestions that television would put an end to its quaint eccentricities, the Senate droned on Thursday until 2:15 a.m. in an attempt to avoid a regular Friday session but failed as the list of amendments continued to grow like mushrooms in the night.

It dawdled through much of yesterday until an informal group of senators who have banded together to improve the institution's "quality of life" rose up and quickened the pace by challenging the germaneness of irrelevant amendments.

By the time of the final vote shortly after 6 p.m., 21 senators had left for the weekend, apparently unconcerned that the cameras would silently record their absences.