It depends. Some people consider beating with a belt or a switch as a spanking. Others think a light swat on a diapered bottom is a spanking. In my opinion anything that administers purposeful pain to a child for the sake of discipline is too much.
I disagree, God intended that we discipline our children and gave them a place receive it. My dad used to say "the fastest way to a child's brain is through his butt" and having two boys of my own I know what he meant. If applied properly it has been very effective in shaping my sons in knowing where the barriers lie, and the consequences for crossing them. Like my father I have only had to go there a few times and now they know I mean what I say. As they are getting older now corporal punishment is not needed, I have possessions and privileges to use as punishment but, thankfully my boys are well behaved being I established that early on through corporal punishment. I think your use of Psalm 23 is rather out of context anna.